Remix
Ethereum's Online IDE
Connect MetaMask to Remix
In Remix, Go to the "DEPLOY & RUN TRANSACTIONS" icon on left side:

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

Make sure you are on Custom (43113) network, which is 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:

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

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.


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!
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.

Deploy your Smart Contract
Time to deploy your contract, perform the following steps:
Go to the "DEPLOY & RUN TRANSACTIONS" tab, and make sure you're connected to Fuji
Click the "Deploy" button at the bottom
MetaMask will pop-up and click the "Confirm" button

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

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