Return
use fuel_types::ContractId;
pub struct Return {
pub contract_id: ContractId,
pub val: u64,
pub pc: u64,
pub is: u64,
}
- A
Returnreceipt is generated when returning a non-reference type in a Sway contract.- Specifically
bool,u8,u16,u32, andu64.
- Specifically
- The
valfield includes the value being returned. - Read more about
Login the Fuel protocol ABI spec
You can handle functions that produce a Return receipt type by adding a parameter with the type abi::Return.
fn handle_return(data: abi::Return) {
// handle the returned data
}