部署zkSync合约触发INSUFFICIENT_FUNDS错误的排查求助
zkSync合约部署提示"insufficient funds for intrinsic transaction cost"的排查方案
错误日志
Running deploy script for the Greeter contract implementation deploy fee: 0.00495816775eth deploying from wallet: 0x23BD0EefC73b68f8C47D66F1e94a4dea5d90f8EA ========= NOTICE ========= Request-Rate Exceeded (this message will not be repeated) The default API keys for each service are provided as a highly-throttled, community resource for low-traffic projects and early prototyping. While your application will continue to function, we highly recommended signing up for your own API keys to improve performance, increase your request rate/limit and enable other perks, such as metrics and advanced APIs. For more details: https://docs.ethers.io/api-keys/ ========================== An unexpected error occurred: Error: insufficient funds for intrinsic transaction cost [ See: https://links.ethers.org/v5-errors-INSUFFICIENT_FUNDS ] (method="estimateGas", transaction={"from":"0x23BD0EefC73b68f8C47D66F1e94a4dea5d90f8EA","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x067537d20f"},"to":"0x32400084C286CF3E17e7B677ea9583e60a000324","value":{"type":"BigNumber","hex":"0x24af022a5961c4"},"data":"0xeb67241900000000000000000000000023bd0eefc73b68f8c47d66f1e94a4dea5d90f8ea00000000000000000000000000000000000000000000000000233adac6f37b0000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000a97e60000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000010000000000000000000000000023bd0eefc73b68f8c47d66f1e94a4dea5d90f8ea00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","type":2,"accessList":null}, code=INSUFFICIENT_FUNDS, version=providers/5.7.2) at Logger.makeError (C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\logger\src.ts\index.ts:269:28) at Logger.throwError (C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\logger\src.ts\index.ts:281:20) at C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\providers\src.ts\fallback-provider.ts:632:24 at Array.forEach (<anonymous>) at C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\providers\src.ts\fallback-provider.ts:614:33 at step (C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\providers\lib\fallback-provider.js:48:23) at Object.next (C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\providers\lib\fallback-provider.js:29:53) at step (C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\providers\lib\fallback-provider.js:33:139) at Object.next (C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\providers\lib\fallback-provider.js:29:53) at fulfilled (C:\Users\Envy\Desktop\HELLO-ZKSYNC\node_modules\@ethersproject\providers\lib\fallback-provider.js:20:58) { reason: 'insufficient funds for intrinsic transaction cost', code: 'INSUFFICIENT_FUNDS', method: 'estimateGas', transaction: { from: '0x23BD0EefC73b68f8C47D66F1e94a4dea5d90f8EA', maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true }, maxFeePerGas: BigNumber { _hex: '0x067537d20f', _isBigNumber: true }, to: '0x32400084C286CF3E17e7B677ea9583e60a000324', value: BigNumber { _hex: '0x24af022a5961c4', _isBigNumber: true }, data: '0xeb67241900000000000000000000000023bd0eefc73b68f8c47d66f1e94a4dea5d90f8ea00000000000000000000000000000000000000000000000000233adac6f37b0000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000a97e60000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000010000000000000000000000000023bd0eefc73b68f8c47d66f1e94a4dea5d90f8ea00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', type: 2, accessList: null
问题描述
尝试部署zkSync的Greeter合约时,持续返回上述资金不足错误,但已确认钱包持有足够部署资金,且操作在资金所在的正确主网进行。
排查方向及解决方法
- 交易意外携带大额ETH:从日志的transaction字段可见,本次部署请求附带了
value: 0x24af022a5961c4(约1.5 ETH),而你预估的部署费仅0.0049 ETH。如果Greeter合约构造函数不需要接收ETH,这大概率是部署脚本错误,比如误加了value参数。检查部署代码,移除不必要的value字段,仅保留gas相关参数。 - 请求限速导致Gas估算偏差:日志中出现
Request-Rate Exceeded提示,说明使用的默认API Key请求频率超限,可能导致节点返回的Gas估算值不准确,进而误判资金不足。解决方式包括更换为个人API Key、降低部署脚本请求频率,或者手动指定合理的gasLimit、maxFeePerGas和maxPriorityFeePerGas参数,不依赖节点估算。 - 钱包实际可用余额不足:确认余额时,需注意是否有未确认交易占用资金,或跨链转账的资金尚未到账(zkSync跨链转账需等待以太坊主网确认)。可在zkSync区块浏览器查询钱包实时可用余额,确保余额大于
部署费 + 可能的value金额。 - 部署工具适配问题:zkSync合约部署流程与以太坊原生部署不同,若使用普通Hardhat/Ethers脚本,需适配zkSync专属插件(如@matterlabs/hardhat-zksync-deploy)。确认是否使用了正确的zkSync部署工具,脚本中的provider是否指向zkSync节点而非以太坊主网节点。
内容的提问来源于stack exchange,提问作者Envy
相关产品推荐
相关产品推荐

