Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forge verify-contract is unable to verify #2996

Closed
defijesus opened this issue Aug 29, 2022 · 7 comments
Closed

forge verify-contract is unable to verify #2996

defijesus opened this issue Aug 29, 2022 · 7 comments
Assignees
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug

Comments

@defijesus
Copy link

defijesus commented Aug 29, 2022

Foundry can't verify this contract. This contract was deployed by running make deploy. Trying to verify directly on Etherscan with same build config also doesn't work. Trying to build and verify using Remix also doesn't work. Am I stoned, or is this gods work?

The Foundry version is updated to latest using foundryup.
The platform you are on: M1 Mac
Code snippets: This repo has a single contract with no imports.
Concrete steps to reproduce the bug: make verify

More info:

~/.svm/0.8.11/solc-0.8.11 --version
solc, the solidity compiler commandline interface
Version: 0.8.11+commit.d7f03943.Darwin.appleclang

papa bless ☀️

@gakonst gakonst added this to Foundry Aug 29, 2022
@gakonst gakonst moved this to Todo in Foundry Aug 29, 2022
@rkrasiuk rkrasiuk added T-bug Type: bug C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check labels Aug 29, 2022
@rkrasiuk
Copy link
Collaborator

@defijesus could you give some more context, please - which version of foundry are you using, how were you deploying the contracts and how did you resolve version incompatibility between contracts?
here's the deployed & verified contract using forge create --verify ...
https://goerli.etherscan.io/address/0xa7113f460ef29e93c67cbd0788e7a62af80a7b47#code

@rkrasiuk rkrasiuk self-assigned this Aug 29, 2022
@defijesus
Copy link
Author

defijesus commented Aug 29, 2022

Hey, sure thing. What version incompatibility?

forge 0.2.0 (307576d 2022-08-29T00:05:05.72678Z)
cast 0.2.0 (307576d 2022-08-29T00:05:05.72678Z)

I deployed by running the FeiRiskParamsUpdatePayload.s.sol script.

@rkrasiuk
Copy link
Collaborator

rkrasiuk commented Aug 29, 2022

@defijesus same story. after i resolved version incompatibility and stack too deep errors, i ran the following command and got the contract verified

forge script script/FeiRiskParamsUpdatePayload.s.sol --verify --fork-url <rpc-url> --broadcast --sender <sender> --private-key $PRIVATE_KEY 

https://goerli.etherscan.io/address/0xD77644A6B0B5B3e330B30531Df3456c2bBe64F81

p.s. i added one more attribute, so that etherscan does not match the similar bytecode verified previously

@defijesus
Copy link
Author

defijesus commented Aug 29, 2022

after i resolved version incompatibility and stack too deep errors

Those are not from the Payload but from the Tests, correct? The Payload has no imports so it shouldn't have any stack too deep or version incompatibility,

Can you try to simply pull the repo, compile as is, run the make deploy command for a testnet and see if it works? It's not working on my end for some reason. I'm trying to figure out whats happening here.

@rkrasiuk
Copy link
Collaborator

ah, it's the usual suspect - via-ir

@defijesus
Copy link
Author

gl & hf 🫡

@rkrasiuk
Copy link
Collaborator

rkrasiuk commented Sep 5, 2022

@defijesus should be fixed now. feel free to reopen if the issue persists

@rkrasiuk rkrasiuk closed this as completed Sep 5, 2022
Repository owner moved this from Todo to Done in Foundry Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants