use fuel_types::{ContractId, AssetId};
pub struct Transfer {
pub contract_id: ContractId,
pub to: ContractId,
pub amount: u64,
pub asset_id: AssetId,
pub pc: u64,
pub is: u64,
}
Transfer
receipt is generated when coins are transferred to a contract as part of a Sway contract. asset_id
field contains the asset ID of the transferred coins, as the FuelVM has built-in support for working with multiple assets.
pc
and is
fields aren't currently used for anything, but are included for completeness. Transfer
in the Fuel protocol ABI spec You can handle functions that produce a Transfer
receipt type by adding a parameter with the type Transfer
.
fn handle_transfer(transfer: Transfer) {
// handle the emitted Transfer receipt
}
Was this page helpful?