Remix

Ethereum's Online IDE

Connect MetaMask to Remix

In Remix, Go to the "DEPLOY & RUN TRANSACTIONS" icon on left side:

DEPLOY & RUN TRANSACTIONS ICON

In the “ENVIRONMENT” drop-down menu, select “Injected Provider - MetaMask”:

Select Injected Provider - MetaMask

Make sure you are on Custom (43113) network, which is Avalanche Fuji Testnet:

Connected to (43113) - Avalanche Fuji Testnet

Creating your Smart Contract

Create a smart contract called GettingStartedFunctionsConsumer.sol. First, go to the 1. “FILE EXPLORER” icon and then click the 2. “Create new file” icon:

Create a new Solidity file

Name the new Solidity file GettingStartedFunctionsConsumer.sol and a new tab will open in Remix:

Blank Solidity file

Adding Code

Go to Getting Started | Chainlink Documentation and you will see a "Open in Remix" button, click that and Remix will open with the code loaded.

GettingStartedFunctionsConsumer.sol

Since contract we copied over was written for deployment on Sepolia, you will need to change configuration parameters like the address router and donID to the relevant addresses for Avalanche Fuji Testnet. Specifically:

Update the address router and donID by copying and pasting the following addresses into GettingStartedFunctionsConsumer.sol:

You can get these configuration details from Supported Networks | Chainlink Documentation. Always cross-check that for the correct configs!

  1. Copy the full code below and paste into GettingStartedFunctionsConsumer.sol:


Compile your Contract

You will need to compile your contract, so navigate to the 1. “SOLIDITY COMPILER” icon and then 2. click on the “Compile” button. You will see a green check when it has compiled successfully on the icon.

Successful compiled contract

Deploy your Smart Contract

Time to deploy your contract, perform the following steps:

  1. Go to the "DEPLOY & RUN TRANSACTIONS" tab, and make sure you're connected to Fuji

  2. Click the "Deploy" button at the bottom

  3. MetaMask will pop-up and click the "Confirm" button

Deployment

Upon a successful deployment, you will see your contract at the bottom the of "DEPLOY & RUN TRANSACTIONS" section:

Successfully deployed your contract

In the next section, we will create a Chainlink Functions Subscription.

Last updated