Skip to content

Latest commit

 

History

History
89 lines (58 loc) · 2.18 KB

Verify.md

File metadata and controls

89 lines (58 loc) · 2.18 KB

Verify Contracts

For each contract whose address appears in migration.json (and therefore is a "migrated contract") we send the contract's solidity code to etherscan.io which will attempt to "verify" that the given code corresponds to the bytecodes deployed at the address given in migration.json.

Note Contract validation via this script currently does not work on Windows (truffle-flattener generates invalid flattened .sol files). The fix for that is at this writing in PR at truffle-flattener.

Setup

  1. In the project root, create an ".env" file (or use the existing one) that contains:
APIKEY=[API key from https://etherscan.io/myapikey]

Alternately you can supply this as an OS environment variable when you run build.verify.

  1. initialize just one time, required by build.verify:
npm run verify.initialize
  1. build just one time or whenever you modify verify.ts, required by verify:
npm run verify.build

Verify

Verify all of the contracts migrated to the given network

npm run verify -- -p [provider url] -n kovan

Verify all of the contracts of a specific Arc version migrated to the given network

npm run verify -- -p [provider url] -n kovan -v 0.0.1-rc.18

The default Arc version is the last version listed in the migration.json file for the given network.

Verify a single scheme

npm run verify -- -c UpgradeScheme -p [provider url] -n kovan

Outputs a GUID that you can use with npm run verify -- -g.

Verify a single scheme at an address

npm run verify -- -c UpgradeScheme -a 0x12345... -p [provider url] -n kovan

Obtain a flattened contract

Output the flattened script to a file named "flattened.[contractName].sol", by supplying the absolute path to a folder in which to write the file(s):

npm run verify -- -f [absolute folder path] [...] -p [provider url] -n kovan

Check verification status, given GUID

Given the GUID that is output by npm run verify:

npm run verify -- -g [GUID] -n kovan

Help

npm run verify.help

Lint

npm run verify.lint

And fix:

npm run verify.lint.andFix