Skip to content

Commit

Permalink
Merge pull request #3142 from ethereum/veri
Browse files Browse the repository at this point in the history
new verification page
  • Loading branch information
ryestew committed Jun 30, 2023
2 parents a7ab58c + 2c0dcbc commit 99ef32a
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 0 deletions.
82 changes: 82 additions & 0 deletions docs/contract_verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Contract Verification
====================

There are two contract verification services in Remix, Sourcify and Etherscan and the extended [Etherscan family](https://etherscan.io/eaas) of block explorers.

Sourcify
--------

Documentation about Sourcify is found [here]( https://docs.sourcify.dev/docs/how-to-verify/#remix-plugin).

Etherscan
---------

The Etherscan plugin is called: **CONTRACT VERIFICATION - ETHERSCAN**.

You can access it from the Plugin Manager.

The plugin has 3 pages, the **verification** page, the **receipts** page, and the **settings** page.

When you go to the plugin for the first time, the settings page will load for inputting the API key.

![](images/a-cv-etherscan-plugin-api-needed.png)


### Etherscan API Key - settings page
Etherscan is a block explorer for Ethereum mainnet and they make block explorers for other chains.

For Ethereum testnets like Goerli or Sepolia, the same API key works.

If you are trying to verify on L2 chains like Optimism, a different API key is needed for their block explorer. Not all of the block explorers made by Etherscan have API keys. The Remix Contract Verification - Etherscan plugin only works where you can login to that block explorer to get the API key.

Once the API key is input, the verification page (the homepage) is opened.

### Verification page

![](images/a-cv-etherscan-verify-page1.png)

The network is NOT selected in the Etherscan plugin. The network is chosen in the Deploy & Run plugin and in your browser's wallet (if using).

#### The prerequisites for verification are:
1. The address of a deployed contract on a public network
2. That same contract compiled in Remix
3. Constructor parameters same as used during deployment (if required)


### Receipts page
Verification receipts are found on the receipts page.

![](images/a-cv-etherscan-receipts.png)

### Verification with constructor arguments
When a contract has arguments in the constructor, a text box will show for inputting the same constructor inputs as the deployed contract.

![](images/a-cv-etherscan-constructor-args.png)

### Verifying a proxy contract
Before verifying a proxy contract, the associated implementation contract must already be verified.

Just for review, the implementation contract is you wrote or adapted and the proxy is, for example, an ERC1967Proxy.

**Do not check the proxy box when verifying the implementation.**
Then after verifying the implementation contract:
1. Cut out the implementation contract's address from the Contract Address box.
2. Click the "It's a proxy contract address" checkbox.
3. Paste the verified implementation contract's address in the Expected Implementation Address box.
4. Paste in the proxy contract address into the Contract Address box.

To explain this visually, verify the implmentation contract:

![](images/a-cv-etherscan-verify-implementation.png)

Then check the "It's a proxy contract" checkbox and cut and paste the implementation address from the contract address to the implementation contract box:

![](images/a-cv-etherscan-move-addr.png)

And then paste the address of the proxy contract into the Contract Address box.
![](images/a-cv-etherscan-verify-proxy2.png)

### Generate Verfication Scripts
Clicking the Generate Verification Scripts on the Verification page, will create a folder named etherscan in the Workspace's scripts folder that contains .ts files for verifying and returning the receipt status.

![](images/a-cv-etherscan-gen-scripts.png)
Binary file added docs/images/a-cv-etherscan-constructor-args.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-cv-etherscan-gen-scripts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-cv-etherscan-implemenation2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-cv-etherscan-move-addr.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-cv-etherscan-plugin-api-needed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-cv-etherscan-receipts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-cv-etherscan-verify-page1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a-cv-etherscan-verify-proxy2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Useful links:
import
plugin_list
remix_commands
contract_verification
running_js_scripts
testing_using_Chai_&_Mocha
FAS
Expand Down

0 comments on commit 99ef32a

Please sign in to comment.