π’Verifying Using Remix Ethereum
Verifying a Smart Contract on Avenium Using Remix Ethereum
Step-by-Step Guide
1. Deploy Your Smart Contract
First, let's assume you have already deployed your smart contract using Remix Ethereum. For the purpose of this guide, we'll use a simple ERC-20 token contract as an example.
2. Get Deployment Details
After deploying the contract, you'll need the following details:
The address of the deployed contract.
The compiler version and settings used for deployment.
3. Navigate to the Block Explorer
Go to the Avenium block explorer for the appropriate network:
Testnet: testnet.avescan.net
Mainnet: Coming Soon
4. Verify the Contract
Search for Your Contract: Enter the contract address in the search bar on the explorer to navigate to your contractβs page.
Verify & Publish: Click on the "Verify & Publish" button.
5. Fill in Verification Details
Contract Address: Ensure the correct contract address is entered.
Compiler Type: Select
Solidity (Single file)
orSolidity (Multi-Part files)
depending on your setup.Compiler Version: Select the same compiler version used in Remix. You can find this version in the Solidity Compiler tab in Remix (e.g.,
v0.8.0
).Optimization: Choose the optimization settings used during compilation. If you enabled optimization in Remix, ensure this is set to
Yes
and provide the optimization runs (usually200
).Enter Solidity Contract Code: Paste your entire Solidity contract code into the provided field. Ensure it includes any necessary imports and pragma statements.
6. Enter Constructor Arguments
If your contract constructor requires arguments, you need to encode these arguments in ABI-encoded format.
Constructor Arguments: Encode the constructor parameters using ABI encoding. You can do this with tools like the Remix console or an online ABI encoder.
For example, if your constructor requires a string name and string symbol:
Constructor arguments for
AveToken("Ave Token", "AVE")
are["Ave Token", "AVE"]
.
7. Submit Verification
After filling out the required information and pasting your contract code:
Click the
Verify
button.Wait for the explorer to process and verify your contract. This may take a few moments.
Example: Step-by-Step Verification in Remix
Step 1: Deploy Contract Using Remix
Write your contract in Remix and compile it.
Deploy the contract using MetaMask connected to the Avenium testnet or mainnet.
Step 2: Copy Contract Code and ABI
Copy the entire source code of your contract.
If constructor arguments are required, use Remix's deployment logs or the Remix console to get the ABI-encoded constructor arguments.
Step 3: Access the Block Explorer
Go to testnet.avescan.net for testnet verification.
Search for your deployed contract address.
Step 4: Verify & Publish
Click on
Verify & Publish
.Fill out the form with your contract details:
Compiler Type:
Solidity (Single file)
orSolidity (Multi-Part files)
.Compiler Version: Select the same version you used in Remix.
Optimization: Match the setting from Remix.
Paste the entire contract source code.
Add any necessary constructor arguments in ABI-encoded format.
Submit the form to verify.
By following these steps, you can successfully verify your smart contract deployed using Remix Ethereum on the Avenium blockchain explorer. This process ensures transparency and allows users to view your contract's source code and interactions, enhancing trust and security. Always double-check your compiler settings and constructor arguments to ensure successful verification.
4o
Last updated