Skip to content

Conversation

sparrowDom
Copy link
Member

Etherscan has migrated to V2 api for the contract verification. There are guides on how to migrate, but I couldn't get a workable combination of packages. Increasing some of the versions also introduces great breaking changes.

This PR finds a workaround on how to verify contracts by forcing a V2 api with the necessary chainId get parameter without any changes to the installed packages

Copy link

codecov bot commented Oct 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.94%. Comparing base (c267e54) to head (83ec494).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2679      +/-   ##
==========================================
- Coverage   38.28%   34.94%   -3.34%     
==========================================
  Files         112      112              
  Lines        5331     5331              
  Branches     1412     1412              
==========================================
- Hits         2041     1863     -178     
- Misses       3289     3466     +177     
- Partials        1        2       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@naddison36 naddison36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great that hardhat-etherscan no longer works but it'll have to do for now. hardhat-verify works but it a pain when there are constructor parameters. It's manageable, though.

```
npx hardhat --network mainnet verify --contract contracts/vault/VaultAdmin.sol:VaultAdmin 0x31a91336414d3B955E494E7d485a6B06b55FC8fB
```

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an example with a constructor parameter. This one is from the deployment template in Notion

echo "module.exports = [{
  platformAddress: \"0x0000000000000000000000000000000000000001\",
  vaultAddress: \"0xe75d77b1865ae93c7eaa3040b038d7aa7bc02f70\",
}]" > flux-args.js
npx hardhat --network mainnet verify --contract contracts/strategies/FluxStrategy.sol:FluxStrategy --constructor-args flux-args.js 0x57d49c28Cf9A0f65B1279a97eD01C3e49a5A173f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants