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

Automate Etherscan Contract Verification #43

Closed
terminator0x opened this issue Jun 25, 2021 · 1 comment
Closed

Automate Etherscan Contract Verification #43

terminator0x opened this issue Jun 25, 2021 · 1 comment
Assignees

Comments

@terminator0x
Copy link
Collaborator

terminator0x commented Jun 25, 2021

Problem

Right now, verifying the plexus eco-system contracts requires us manually do so in etherscan which is not ideal, especially considering the speed at which we want to push out new contracts and functionality.

Solution

An easy solution to this, is to integrate the etherscan api and use to automatically publish and verify any new contracts we deploy as follows.

  1. Create a new script called verify.js in the scripts folder. This script will be called by the current deploy.js script after it has deployed all the contracts to mainnet.
  2. The script will work as follows.
  • Read the etherscan api key from a .env file
  • Remove all the imports and flatten the solidity files using the solidity-flattener tool.
  • Push all the contracts into etherscan and verify them using the api as shown here

Acceptance Criteria

After adding my mnemonic phrase and etherscan api key to the .env file, I should be able to deploy and verify all the deployed contracts in etherscan in 1 clean sweep using the yarn deploy command.

ETA

3 days.

@softskillpro
Copy link
Member

@terminator0x
I've got a problem with solidity-flattener.
It has a bug not working with solidity files included OpenZeppelin
Here is the open issue addresses about that.
poanetwork/solidity-flattener#49
And I also tried it with truffle-flattener.
It also has some issues, I think that it's related to new features came up with solidity 0.8.
For example, the tool cannot parse "unchecked block" syntax of solidity which was introduced from Solidity 0.8
NomicFoundation/truffle-flattener#77

I keep investigation and trying to find a new tool for flattening solidity files.
Do you have any idea for alternative tools for solidity-flattener or truffle-flattener?

@terminator0x terminator0x changed the title Automate Etherscan Contract Verication Automate Etherscan Contract Verification Jun 28, 2021
@terminator0x terminator0x changed the title Automate Etherscan Contract Verification Automate Etherscan, Binancescan, Polygonscan Contract Verification Jul 1, 2021
@terminator0x terminator0x changed the title Automate Etherscan, Binancescan, Polygonscan Contract Verification Automate Etherscan Contract Verification Jul 1, 2021
@terminator0x terminator0x added on hold More discussion needed and removed on hold More discussion needed labels Jul 1, 2021
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

No branches or pull requests

2 participants