Deploy a Smart Contract on Avalanche using Remix and MetaMask
The Avalanche network is a subnet that has three chains: P-Chain, X-Chain, and C-Chain.
The C-Chain is an instance of the Ethereum Virtual Machine powered by Avalanche’s Snowman consensus engine.
The C-Chain RPC can do anything a typical Ethereum client can by using the Ethereum-standard RPC calls. The immediate benefits of using the C-Chain rather than Ethereum are quick blocktimes which finalize in under 3 seconds, high transactional throughput, and lightweight clients that do not require Proof of Work. These properties that could considerably improve the performance of DApps and the user experience.
Today we will deploy and test a smart contract on Avalanche using Remix and MetaMask.
Step 1. Setting up MetaMask
FUJI Testnet Settings
Network Name: Avalanche FUJI C-Chain
New RPC URL: https://api.avax-test.network/ext/bc/C/rpc
ChainID: 0xa869
Symbol: AVAX
Explorer: https://cchain.explorer.avax-test.network/
Avalanche Mainnet Settings
Network Name: Avalanche Mainnet C-Chain
New RPC URL: https://api.avax.network/ext/bc/C/rpc
ChainID: 0xa86a
Symbol: AVAX
Explorer: https://cchain.explorer.avax.network/
Local Testnet (AVASH)
Network Name: Avalanche Local
New RPC URL: http://localhost:9650/ext/bc/C/rpc
ChainID: 0xa868
Symbol: AVAX
Explorer: N/A
Step 2a. Funding your C-Chain address on FUJI
Navigate to https://faucet.avax-test.network/ and paste your C-AVAX address.
Step 2b. Funding your C-Chain address on Mainnet
Funding your C-chain address on mainnet is done through a cross-chain swap from X-chain to C-chain. Tutorial
Step 3c. Funding your C-chain address on local testnet
Deploy your own faucet. Tutorial
Step 3. Remix: Connect MetaMask and Deploy a smart contract.
For this example, we will deploy an ERC20 contract from OpenZeppelin
If you had any difficulties following this tutorial or simply want to discuss Avalanche tech with us you can join our community at Discord!
About Avalanche:
Avalanche is an open-source platform for launching decentralized finance applications and enterprise blockchain deployments in one interoperable, highly scalable ecosystem. Developers who build on Avalanche can easily create powerful, reliable, and secure applications and custom blockchain networks with complex rulesets or build on existing private or public subnets.
Website | Whitepapers | Twitter | Discord | GitHub | Documentation | Explorer | Avalanche-X | Telegram | Facebook | LinkedIn | Reddit | YouTube