Approve TokenMessenger contract for on Ethereum

In the process of transferring USDC from Ethereum to Polygon, you'll need to give the TokenMessenger contract the necessary permissions to execute the USDC transfer on your behalf. In essence, you're empowering the TokenMessenger contract to access and transfer the specified amount of USDC from your source wallet.

For this, the Programmable Wallets' contract execution API will be put into play:

Request Parameters

  • contractAddress

    You will be interacting with the USDC contract on the source chain, so the contractAddress parameter of the request is 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238.

  • abiFunctionSignature

    The function being called on the USDC contract is approve(address spender, uint256 value). Calling approve allows spender to spend value USDC on your behalf. This will be necessary in the depositForBurn step later on.

    value is denominated in the smallest unit of USDC, which is a millionth of a dollar.

    In this case it's approve(address,uint256)

  • abiParameters

    In this case, address is the TokenMessenger contract's address and value is 100000000 (100 USDC).

    In this case it's ["0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5", 100000000]

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

Try it out:Approve USDC Sepolia from source wallet

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.

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.