5 使用foundry对已部署的合约进行验证,出现`Unable to verify. Compiled contract deployment bytecode does NOT match the transaction deployment bytecode.`

在remix上进行部署的合约,使用以下命令用foundry验证合约出现报错,请问如何fix?

forge verify-contract \ --chain-id 137 \ --num-of-optimizations 200 \ --watch \ --verifier-url 'https://api.phalcon.xyz/api/rpc_id'\ contract_address \ src/bank.sol:Bank \ --etherscan-api-key phalcon api key \ --compiler-version 0.8.22

报错如下: Submitting verification for [src/bank.sol:Bank] "0x4c5B37834917f0B69A4a2E0234B19cF5A94dC4d4". Submitted contract for verification: Response:OK GUID:9grc4e0rq2ccptyouueddsjkm0ypb5os56d28oo4uoa90iowbg URL: https://polygonscan.com/address/0x4c5b37834917f0b69a4a2e0234b19cf5a94dc4d4 Contract verification status: Response:NOTOK Details:Unable to verify. Compiled contract deployment bytecode does NOT match the transaction deployment bytecode. Contract failed to verify.

compile的配置:

Screenshot 2023-12-30 at 00.56.11.png

deploy的配置:

Screenshot 2023-12-30 at 00.54.47.png

请先 登录 后评论

2 个回答

Tiny熊
  擅长:智能合约,以太坊
请先 登录 后评论
寻月隐君
请先 登录 后评论
  • 2 关注
  • 0 收藏,2195 浏览
  • minaWang 提出于 2023-12-30 00:13