![](/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.