♈
Bootcamp-2024
  • Intro
  • 1. Blockchain & Wallet Fundamentals
    • Blockchain Introduction
    • State Machines
    • Cryptography
    • Distributed Networks
    • Game Theory
    • What is Web3
    • MetaMask Wallet Installation
    • Transferring Tokens with MetaMask
  • 2. Smart Contract & Solidity Fundamentals
    • Using Remix
    • Create, compile and publish your first smart contract
    • Interact with already published smart contracts
    • Blockchain Explorer
    • Verify source code on Etherscan
  • 3. Oracles, ERC20 & Chainlink Data Feeds
    • Oracles
    • Create & Deploy ERC20
    • Data Feeds
  • 4. Cross-Chain Tokens With Chainlink CCIP
    • Setting up MetaMask
    • Getting USDC Testnet Tokens
    • Create Smart Contract In Remix
    • Compile and Deploy
    • Approve USDC
    • Send LINK to your Contract
    • Send USDC from Fuji to Sepolia
    • USDC on Sepolia
  • 5. Mentoring Session
  • 6. NFTs & Chainlink Automation
    • NFT Basics
    • Dynamic NFTs
    • Creating an NFT Smart Contract
    • Deploying Your Dynamic NFTs
  • 7. Chainlink CCIP & Cross-Chain NFT dApps
    • Create and deploy CCIP NFT Contracts
    • Mint on Source Chain
    • Fund Contract
    • Mint On Sepolia From Fuji
    • Mint from Destination 2 - Base Sepolia
  • 8. Random Numbers with Chainlink VRF
    • Introduction to Chainlink VRF
    • Hands On Game Using VRF
  • 9. Off-Chain Data with Chainlink Functions
    • Chainlink Functions Playground
    • Setting up MetaMask
    • Remix
    • Functions Subscription
    • Creating The Functions Consumer Contract
    • Sending a Request from Remix
    • City Weather and Examples
    • City Weather on Chainlink Functions
  • 10. Connecting the 🌏 with Chainlink
  • Glossary
Powered by GitBook
On this page
  1. 4. Cross-Chain Tokens With Chainlink CCIP

Approve USDC

Approve our smart contract to use USDC

PreviousCompile and DeployNextSend LINK to your Contract

Last updated 1 year ago

You need to now approve the smart contract you just deployed to spend the USDC that belongs to you! This is how you authorize your smart contract to transfer your USDC to another chain. Go to the USDC contract on Avalanche Fuji () and first click the “Sign In” button at the top right to connect your MetaMask wallet.

Click “Metamask” on the far left and then it will ask you to sign a message to verify your account. Click the “Sign message” button and MetaMask will pop-up asking you a “Sign-in request” for Snowtrace Explorer. Click the “Sign-in” button on the bottom right.

Once signed in, click the “Contract” tab of the USDC contract:

In order to approve USDC for our TransferUSDCBasic.sol contract, you need to do the following steps:

  1. Click on “Write as Proxy” button

  2. Click on the approve function and it will expand to the inputs

  3. Copy your TransferUSDCBasic.sol contract address from Remix and paste into spender (address)

  4. Enter 100000 for the value (uint256), which is 0.1 USDC

  5. Click on the “Write” button

MetaMask will pop-up with a “Spending cap request for your USDC”, and since you entered in 100000 on the previous step, it will fill in 0.1 (because USDC token has only 6 decimal places) so all you need to do is click the “Next” button at the bottom right:

After that, click the “Approve” button to finalize this step:

That's it for this step! Next you will fund your newly deployed contract with LINK tokens.

USD//C | Token Tracker - Snowtrace Testnet
Login to Snowtrace
Connect MetaMask
Sign the message
Sign-In to Snowtrace
Click the Contract tab
In Remix: Your deployed contract address
In the block explorer: Write as Proxy tab and the inputs for the approve function
Click "Next"
Approve the request