πSmart Contract Deployment
Deploy smart contracts instantly using Remix's web-based IDE and built-in deployment tools.
Here are the step-by-step instructions to deploy a smart contract on the Avalanche L1 Demo Network using Remix:
Deployment Steps-
π§βπ» Step 1: Connect MetaMask to the Avalanche L1 Demo Network
Follow this link to complete this step - Adding to MetaMask
π§± Step 2: Open Remix and Write Your Contract
Visit Remix IDE.
In the File Explorer, create a new Solidity file (e.g.,
MyContract.sol
).Write or paste your smart contract code.
π¨ Step 3: Compile the Contract
Go to the Solidity Compiler tab on the left.
Select the appropriate compiler version for your code.
Click Compile.
π Step 4: Deploy Using Injected Web3 (MetaMask)
Go to the Deploy & Run Transactions tab.
Under Environment, select Injected Provider - MetaMask.
MetaMask will prompt you to connect β approve it.
Ensure it's connected to the Avalanche L1 Demo Network.
Select the contract from the dropdown.
If your contract has constructor parameters, input them.
Click Deploy.
MetaMask will pop up to confirm the transaction, approve it.
π Step 5: Confirm Deployment
Once the transaction is mined, the contract will appear under Deployed Contracts in Remix.
You can interact with the contract directly from here.
Optionally, copy the contract address and check it on the Tracehawk to verify.
Verify & publish contract via Explorer-
π οΈ Step 1: Verify & publish contract via Explorer
Click on Others, and then choose Verify Contract.
Click it to open the verification form.
π§Ύ Step 2: Fill in Verification Details
Contract Address:
Contract License Dropdown: Choose MIT License
Compiler Type: Select Solidity (Single File) or Multi-part depending on your project.
Compiler Version: Must match what was used in Remix (e.g.,
0.8.22
).Optimization Enabled: Yes / No (indicates if optimization was enabled during contract deployment)
Enter Solidity Source Code in the provided text box.
πΎ Step 3: Submit
Click "Verify and Publish".
The explorer will compile and compare the code with the on-chain bytecode.
π Step 4: Verification Complete
Once verified:
The contractβs source will be publicly visible on the explorer.
A β Verified badge will appear.
You can now read/write to your contract directly from the explorer.
Last updated