'polkadot canvas testnet contract deploy error "contracts.contractTrapped"

I'm trying to deploy basic erc20 example contract on rococo canvas but "contracts.ContractTrapped" error popped on deployment? any hint will be much appreciated, Thanks!



Solution 1:[1]

A common source of ContractTrapped are Integer overflows, those can cause your contract to trap as well.

Please, check the source of this paragraph to see if it solves your issue.

Solution 2:[2]

I have had the issue ContractTrapped while I wanted to add values in Solidity code without SafeMath library. The solution was to ensure safety of a source code like:

function sum(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a);
    return c;
}

Solution 3:[3]

It still seems to be a timeout issue. From the source code of slack sdk for python:

class WebClient(BaseClient):
    ...
    Attributes:
        ...
        timeout (int): The maximum number of seconds the client will wait
            to connect and receive a response from Slack.
            Default is 30 seconds.

If you init a WebClient instance without the timeout parameter, the timeout parameter is 30 seconds by default.

Trying to upload a small size file, or set a longer timeout option, to test is it a real timeout issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alejandro Martínez
Solution 2 Tomasz Waszczyk
Solution 3 Vokey