How to verify smart contracts using the Etherscan Remix plugin

There are many ways to verify contracts on Moonbeam, and using the Etherscan Remix plug-in is the fastest and easiest way.

In this example, we show how to activate the Etherscan plugin on Remix and verify a simple incremental smart contract. Before you begin, please prepare the following:

  • MetaMask wallet

  • Account with DEV in it

  • Moonscan API keys that will verify the contract network

  • Install and configure Git

picture

First, on the left side of the Remix interface, click Plugin Manager, search for the Etherscan plug-in, and select Activate.

Here you need to provide a Moonscan API key. If you choose to verify the contract on Moonbeam and Moonbase Alpha, please go to http://moonscan.io ; if you choose to verify the contract on Moonriver, please go to http://moonriver.moonscan.io .

After logging in on Moonscan, select API Keys on the left, copy your API key, and save it using the Etherscan Remix plugin.

picture

Next, compile the contract and then deploy the contract. Please ensure that the environment is selected as Injected Provider, and the incremental smart contract needs to set an initial numeric parameter. Confirm this deployment transaction in MetaMask.

After the contract is deployed, open the Etherscan plug-in, confirm the network you selected, and then set the contract name (incremental in this example).

Copy the contract address and paste it in the address bar. Recompile the contract and the constructor will be filled in automatically. Provide the parameters you use for contract deployment to ensure the contract is verified.

Click Verify. Go back to Moonscan and check that the contract should have been verified.

For more information, check out the video tutorial: https://www.youtube.com/watch?v=kSCfWBLV6Zs

Guess you like

Origin blog.csdn.net/Moonbuilder/article/details/133352144