Burn USDC on Ethereum

The second step of the process facilitates a burn of the specified amount of USDC on Ethereum Sepolia (the source chain) that you are looking to move to Polygon (the destination chain).

Mint and Burn are the terms used to refer to the creation and removal of a token from a blockchain network. During the CCTP transfer, tokens on one blockchain are burnt, removing them from the total supply, before new tokens are minted on the destination blockchain - effectively moving USDC across chains.

To do this, you will again use Programmable Wallets' contract execution API:

Request Parameters

  • contractAddress

    You will be interacting with the Token Messenger contract on the source chain, so the contractAddress parameter of the request is 0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5.

  • abiFunctionSignature

    The function being called on the TokenMessenger contract is:
    depositForBurn(uint256 amount, uint32 destinationDomain, bytes32 mintRecipient, address burnToken)

    This will be the abiFunctionSignature property of the request. In this case it's depositForBurn(uint256,uint32,bytes32,address)

  • abiParameters

    The abiParameters property defines the values to pass to the function. For the call to depositForBurn, they are amount, destinationDomain, mintRecipient and burnToken.

    • amount: the amount of USDC to burn. This amount will be created on the destination chain after the mint. You will burn 1 USDC of the allowance you approved earlier.
    • destinationDomain: a Circle-issued identifier for a network/chain where CCTP contracts are deployed. Since the destination is Polygon, you will use 7. See CCTP: Domain List.
    • mintRecipient: this is the destination address, encoded to a Solidity address representation. This will be the same address as the source wallet. In your application, you will need to encode the destination address to the correct format using a library like web3js - but we have done it for you here.
    • burnToken: the contract address of the token that is being burnt. In this case, it is the USDC contract on the source chain. Other tokens will be supported in the near future.

    JavaScript
    const encodedDestinationAddress = web3.eth.abi.encodeParameter('address', destinationAddress);
    

    Therefore, the complete abiParameters value is [1000000, 7, {encodedDestinationAddress}, “0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238”].

  • walletId

    The wallet that is performing the contract execution. This will be the ID of the developer-controlled wallet you created earlier.

  • feeLevel

    A dynamic blockchain fee level setting (LOW, MEDIUM, or HIGH) that will be used to pay gas for the transaction. HIGH is used for this transaction.

  • idempotencyKey

    Universally unique identifier (UUID v4) idempotency key. This is automatically generated for you.

  • entitySecretCiphertext

    A base64 string expression of the entity secret ciphertext. Refer to this helpful tool.

Import Messege Transmitter Contract

Just like your first contract execution request, the other parameters - walletId, feeLevel, idempotencyKey and EntitySecretCiphertext - have been automatically populated in the request.

Try it out:Deposit for Burn on Ethereum

Note: The input parameters of this component differ from those of the actual endpoint. For instance, we automatically generate the Entity Secret Ciphertext to simplify the process and ensure a better experience for you.

Validating the Burn of 1 USDC in your Developer Console

After initiating the Burn of USDC through our API, you'll be able to check if it was successful in our Developer Console.

  • 1

    Login to the Web3 Services Console

    To begin the process of validating your burn of USDC, log in to the Web3 Services Console.

  • 2

    Navigate to the List of Wallets

    Within the console, locate the "Developer-Controlled wallets" section and access the "List of Wallets." This section displays all the wallets you have created thus far. Open list of wallets.

  • 3

    Open the Wallet Details Screen

    Find and click on the Ethereum Sepolia wallet from which you initiated the USDC burn.

  • 4

    View Your Wallet Balance

    On the wallet details screen, scroll down to the bottom to find the section displaying your wallet balances. As you successfully created your Sepolia Wallet, an initial deposit of 10 USDC was made. If you have successfully burned 1 USDC, the total wallet balance should now reflect 9 USDC, indicating the accurate deduction of the burned amount.

    Successful Burn Image

By following these step-by-step instructions and reviewing your wallet balance in the Web3 Services Console, you can confidently validate the burn of your USDC tokens and verify the correct adjustment in your wallet's overall balance.

Need help or have questions?

Here are some helpful links:

🎮Join our Discord Community: Engage, learn, and collaborate.
🛎Visit our Help-Desk Page: Dive into curated FAQs and guides.
📧Direct Email: We're always a message away.
📖Read docs: Check out our developer documentation.
© 2023 Circle Technology Services, LLC. All rights reserved.