-
Returned error: {"jsonrpc":"2.0","error":"[ethjs-query] while formatting outputs from RPC '{\"value\":{\"code\":-32603,\"data\":{\"code\":-32000,\"message\":\"transaction underpriced\"}}}'","id":4815365370376783}
gasprice定价过低,调高定价
Remix上合约调试时不能仅依赖事件是否发出为成功依据,而应该以状态变量为准,因为事件有可能不发!
-
部署时报错:code=CALL_EXCEPTION
检查gaslimit:5b8d80==6000000 ⇒contracts/src.ts/deploy.ts 6000000改8000000
-
Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fail if the current network has activated the eip 170.
合约过大,需要拆分。参考另一篇《delegatecall》
-
ProviderError: sender doesn't have enough funds to send tx. The max upfront cost is: 4845817880859375 and the sender's account only has: 0
合约部署账户没有钱,打点原生币过去就行了
-
CompilerError: Stack too deep, try removing local variables.
变量声明太多了,可以用结构体封装一些,或者把部分代码挪出去变成函数
-
Error: Transaction reverted: function call to a non-contract account
接口正在尝试调用一个不存在的合约。检查合约确实是否存在,或者在合约中增加代码检查如果是合约地址就调用,否则就不调用。
-
Explicit type conversion not allowed from "address" to "uint256".solidity(9640)
在 Solidity 0.8.0 版本中,引入了一个更为安全的类型系统,不再允许直接将
address
类型转换为uint256
类型。因此,你需要使用type
关键字进行显式类型转换。uint256 size; assembly { size := extcodesize(_addr) }
-
Explicit type conversion not allowed from "bytes memory" to "address".solidity(9640)
function bytesToAddress(bytes memory data) internal pure returns (address) { require(data.length == 20, "Invalid address length"); address result; assembly { result := mload(add(data, 32)) } return result; }
-
abi: length larger than int64: 48129323291152180489044384789343333891201197466736324414383260238138438582324
合约有bug,检查是否修改了合约但忘记重新部署
-
ProviderError: replacement transaction underpriced
gasprice过低,hardhat可以设置如下代码修复:
const contract = await Contract.deploy({ gasPrice: ethers.parseUnits("25", "gwei"), // fuji中的 gas 价格最低是25 Gwei });
常见EVM错误
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 1.编辑器说明 (1)推荐编辑器目前尝试 Solidity 编程的最好的方式是使用 Remix (需要时间加载,请...
- 1. Re-Entrancy重新入口 以太坊智能合约的一个特点是能够调用和使用其他外部合约的代码。合约也通常可以处...