blacksmith-eth/blacksmith

Unable to verify contract using foundry script

AnonJon opened this issue · 4 comments

Describe the bug
Running the script command in foundry with the added blacksmith variables doesnt seem to verify and imports fail. Not a bug but didnt know if anyway else ran into this issue.

To Reproduce
forge script script/Counter.s.CounterScript
--fork-url http://localhost:8545 --verifier-url http://localhost:3000/api/verify --etherscan-api-key blacksmith --broadcast --verify

Expected behavior
To mimic forge create which does verify/import

Screenshots

System (please complete the following information):

  • Browser [e.g. brave, chrome]
  • firefox
  • Blacksmith Short SHA [e.g. a06328c]
  • Anvil Version [e.g. anvil 0.1.0 (e9f274d 2022-12-11T00:08:46.560086Z)]
  • 0.1.0 (d8f2434 2023-01-20T00:09:44.342972052Z)
  • Forge Version [e.g. forge 0.2.0 (e9f274d 2022-12-11T00:08:13.093857Z)]
  • forge 0.2.0 (d8f2434 2023-01-20T00:09:17.907613959Z)

Additional context
Tried a couple different flags but nothing seems to actually verify/import. Everything else works great!

@jongregis thanks for opening this issue! I did a little digging into this a while back and it seemed like this was actually an issue with forge script.

Others do seem to be experiencing this same behavior and opened an issue in foundry:

foundry-rs/foundry#3872

I may have found a workaround. Posted on the ticket listed above.

Resolved in foundry-rs/foundry#4233. Once this change goes to release I'll close this issue. I'll also add some documentation for using forge script with Blacksmith in the README.

@jongregis That workaround makes sense given the solution. Nice find.

Closing now since the fix went out in this nightly release: forge 0.2.0 (cd7850b 2023-02-01T00:16:50.352348Z).

Thanks again for reporting this @jongregis!

For anyone else that might be experiencing this issue make sure that you are on a nightly release of foundry after the commit/date listed above, or just run foundryup.