-
Notifications
You must be signed in to change notification settings - Fork 91
Etherscan V2 workaround #2679
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
base: master
Are you sure you want to change the base?
Etherscan V2 workaround #2679
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 | ||
``` | ||
|
There was a problem hiding this comment.
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
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