pub struct BurnMessageV2 {
pub version: u32,
pub burn_token: Address,
pub mint_recipient: Address,
pub amount: U256,
pub message_sender: Address,
pub max_fee: U256,
pub fee_executed: U256,
pub expiration_block: U256,
pub hook_data: Bytes,
}Expand description
CCTP v2 Burn Message Body
The burn message body contains information about a token burn operation for cross-chain USDC transfers.
§Format
- version: uint32 (4 bytes)
- burnToken: bytes32 (32 bytes) - address of token being burned
- mintRecipient: bytes32 (32 bytes) - address to receive minted tokens
- amount: uint256 (32 bytes) - amount being transferred
- messageSender: bytes32 (32 bytes) - original sender address
- maxFee: uint256 (32 bytes) - maximum fee willing to pay
- feeExecuted: uint256 (32 bytes) - actual fee charged
- expirationBlock: uint256 (32 bytes) - block number when message expires
- hookData: dynamic bytes - arbitrary data for destination chain hooks
Total fixed size: 4 + 32 + 32 + 32 + 32 + 32 + 32 + 32 = 228 bytes + dynamic hookData
Fields§
§version: u32Message body version
burn_token: AddressAddress of the token being burned (USDC contract)
mint_recipient: AddressAddress that will receive minted tokens on destination chain
amount: U256Amount of tokens being transferred (in wei/smallest unit)
message_sender: AddressAddress of the original message sender
max_fee: U256Maximum fee the sender is willing to pay (for Fast Transfers)
fee_executed: U256Actual fee that was charged
expiration_block: U256Block number after which the message expires (anti-replay protection)
hook_data: BytesOptional hook data for programmable transfers
Implementations§
Source§impl BurnMessageV2
impl BurnMessageV2
Sourcepub const MIN_SIZE: usize = 228
pub const MIN_SIZE: usize = 228
Minimum size of the burn message body in bytes (without hookData)
Sourcepub fn new(
burn_token: Address,
mint_recipient: Address,
amount: U256,
message_sender: Address,
) -> Self
pub fn new( burn_token: Address, mint_recipient: Address, amount: U256, message_sender: Address, ) -> Self
Creates a new burn message with standard settings (no fast transfer, no hooks)
Sourcepub fn new_with_fast_transfer(
burn_token: Address,
mint_recipient: Address,
amount: U256,
message_sender: Address,
max_fee: U256,
) -> Self
pub fn new_with_fast_transfer( burn_token: Address, mint_recipient: Address, amount: U256, message_sender: Address, max_fee: U256, ) -> Self
Creates a new burn message with fast transfer settings
Sourcepub fn new_with_hooks(
burn_token: Address,
mint_recipient: Address,
amount: U256,
message_sender: Address,
hook_data: Bytes,
) -> Self
pub fn new_with_hooks( burn_token: Address, mint_recipient: Address, amount: U256, message_sender: Address, hook_data: Bytes, ) -> Self
Creates a new burn message with hook data
Sourcepub fn with_hook_data(self, hook_data: Bytes) -> Self
pub fn with_hook_data(self, hook_data: Bytes) -> Self
Sets the hook data for this message
Sourcepub fn with_max_fee(self, max_fee: U256) -> Self
pub fn with_max_fee(self, max_fee: U256) -> Self
Sets the maximum fee for fast transfer
Sourcepub fn with_expiration_block(self, expiration_block: U256) -> Self
pub fn with_expiration_block(self, expiration_block: U256) -> Self
Sets the expiration block
Sourcepub fn is_fast_transfer(&self) -> bool
pub fn is_fast_transfer(&self) -> bool
Returns true if this message is configured for fast transfer (max_fee > 0)
Trait Implementations§
Source§impl Clone for BurnMessageV2
impl Clone for BurnMessageV2
Source§fn clone(&self) -> BurnMessageV2
fn clone(&self) -> BurnMessageV2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BurnMessageV2
impl Debug for BurnMessageV2
Source§impl PartialEq for BurnMessageV2
impl PartialEq for BurnMessageV2
impl Eq for BurnMessageV2
impl StructuralPartialEq for BurnMessageV2
Auto Trait Implementations§
impl !Freeze for BurnMessageV2
impl RefUnwindSafe for BurnMessageV2
impl Send for BurnMessageV2
impl Sync for BurnMessageV2
impl Unpin for BurnMessageV2
impl UnwindSafe for BurnMessageV2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more