logoDocumentation

Deploy with Remix IDE

Learn how to deploy smart contracts on Avalanche using Remix and Core Wallet.

Avalanche's Primary 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 protocol. 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 all of the benefits of using Avalanche. 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 Core Wallet.

Setting up Core

If you don't already have a Core wallet, follow this guide to create a new wallet.

If you want to use the Avalanche C-Chain, it can be selected from the networks list.

To switch to the Fuji test network, go to Settings, select Advanced, and then toggle Testnet Mode to ON.

Local Testnet Settings

  • Network Name: Avalanche Local C-Chain
  • New RPC URL: http://127.0.0.1:34890/ext/bc/C/rpc (Note: the port number should match your local setting which can be different from 34890.)
  • ChainID: 43112
  • Symbol: AVAX
  • Explorer: N/A

Funding Your C-Chain Address

Using Core Web

On the Mainnet, you can use Core web to transfer funds from the X-Chain to your C-Chain address. The process is simple, as explained in this tutorial. Please note that you will need Core wallet connected to Core web for making cross-chain transfers. Core wallet can be used on test and local networks, too. This wallet is available for mobile too.

Using Testnet Faucet

For funding on the test network, Avalanche has a Faucet that drips test tokens to the address of your choice. If you already have an AVAX balance greater than zero on Mainnet, paste your C-Chain address there, and request test tokens. Otherwise, please request a faucet coupon on Guild. Admins and mods on the official Discord can provide testnet AVAX if developers are unable to obtain it from the other two options.

Funding on Local Testnet

On a local network, you can easily fund your addresses by following this guide.

Connect Core & Deploy Smart Contract Using Remix

Open Remix → Select Solidity

Load or create the smart contracts that we want to compile and deploy using Remix file explorer.

For this example, we will deploy a simple Hello World contract from here.

Select the Solidity compiler tab and compile the contract.

Navigate to Deploy & Run transactions Tab -> Open the "ENVIRONMENT" drop-down and select Injected Provider (make sure Core is loaded).

A pop up will ask which wallet to use. Select Core.

Now, the smart contract is compiled, Core is injected, and we are ready to deploy our Hello world contract. Click "Deploy."

Confirm the transaction on the Core pop up.

Our contract is successfully deployed!

Now, we can expand it by selecting it from the "Deployed Contracts" tab and test it out.

The contract ABI and Bytecode are available on the Solidity compiler tab.

If you had any difficulties following this tutorial or simply want to discuss Avalanche with us, you can join our community at Discord!

Last updated on

On this page

Edit on Github