[英]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?我正在尝试在 rococo canvas 上部署基本的 erc20 示例合同,但在部署时弹出“contracts.ContractTrapped”错误? any hint will be much appreciated, Thanks!
任何提示将不胜感激,谢谢!
I have had the issue ContractTrapped
while I wanted to add values in Solidity code without SafeMath library.当我想在没有SafeMath 库的情况下在 Solidity 代码中添加值时,我遇到了
ContractTrapped
问题。 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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.