Expand description
Cross-contract call utilities for contract composability.
This module provides functions to invoke other contracts from within your contract, enabling composability and modular contract design.
§Features
- Legacy calls: Basic cross-contract invocation without value transfer
- Value transfer: Call contracts while transferring native tokens
- Return data: Capture and process return values from called contracts
§Example
ⓘ
use truthlinked_sdk::call;
// Call another contract
let token_contract = [0x12; 32];
let calldata = encode_transfer_call(recipient, amount);
let result = call::call_contract(&token_contract, &calldata)?;
// Call with value transfer
let result = call::call_contract_with_value(
&contract_id,
&calldata,
1000, // Transfer 1000 base units
)?;Functions§
- call_
contract - Invokes another contract without transferring value.
- call_
contract_ with_ value - Invokes another contract while transferring native tokens.
Type Aliases§
- Account
Id - Type alias for 32-byte account identifiers.