prepare_deposit_for_burn
Documentation for eth_defi.cctp.transfer.prepare_deposit_for_burn function.
- prepare_deposit_for_burn(web3, amount, destination_chain_id, mint_recipient, burn_token=None, destination_caller=None, max_fee=0, min_finality_threshold=2000)
Build a bound
depositForBurn()call on TokenMessengerV2.This burns USDC on the source chain to be minted on the destination chain. USDC must be approved to TokenMessengerV2 before calling this.
- Parameters
web3 (web3.main.Web3) – Web3 connection to the source chain
amount (int) – Amount of USDC to transfer in raw token units (6 decimals). E.g. 1_000_000 for 1 USDC.
destination_chain_id (int) – EVM chain ID of the destination (e.g. 42161 for Arbitrum). Automatically converted to CCTP domain ID.
mint_recipient (Union[eth_typing.evm.HexAddress, str]) – Address to receive USDC on the destination chain.
burn_token (Optional[Union[eth_typing.evm.HexAddress, str]]) – USDC address on the source chain. If
None, auto-detected from the source chain ID.destination_caller (bytes | None) – If set, restricts who can call
receiveMessage()on the destination chain.Nonemeans anyone can relay (bytes32 zero).max_fee (int) – Maximum fee for fast finality transfers. 0 for standard transfers.
min_finality_threshold (int) – Finality level: 2000 for standard (finalized), 1000 for fast (confirmed).
- Returns
Bound contract function ready to be transacted or encoded.
- Raises
ValueError – If the destination chain or source chain is not supported by CCTP.
- Return type
web3.contract.contract.ContractFunction