![](/img/trans.png)
[英]How can I query contract info with the latest polkadot-js and substrate contracts node?
[英]polkadot canvas testnet contract deploy error "contracts.contractTrapped"
我正在尝试在 rococo canvas 上部署基本的 erc20 示例合同,但在部署时弹出“contracts.ContractTrapped”错误? 任何提示将不胜感激,谢谢!
ContractTrapped
的一个常见来源是 Integer 溢出,这些也可能导致您的合约陷入陷阱。
请检查本段的来源,看看它是否解决了您的问题。
当我想在没有SafeMath 库的情况下在 Solidity 代码中添加值时,我遇到了ContractTrapped
问题。 解决方案是确保源代码的安全,例如:
function sum(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.