pub fn Invoke(
address: &ContractAddress,
calldata: &[u8],
owned_auth_token_ids_list: &[u8],
inputs: &CopyableInvokeInputs,
) -> Result<CopyableInvokeOutputs, SysErr>Expand description
Invokes the specified method of the contract at the specified address, with the supplied parameters. Creates a new invocation frame, which terminates upon conclusion of the Invoke() syscall.
The frame will be limited to the minimum of gas_limit units of gas and the remaining gas in the current frame. The SDK sets the default gas limit as UINT64_MAX, meaning i.e. all of the remaining gas in the current frame. Any unused gas will be returned to the caller.
The entrypoint is the entrypoint_id field of inputs, a u64 holding the big-endian interpretation of the ContractEntrypointID ([u8; 8]) bytes (ContractEntrypointID::into_u64 in the Rust bindings).
The list of auth tokens is passed as a span, which should be interpreted as a u32 slice.
§Arguments
addresscalldataowned_auth_token_ids_listinputs
§Outputs
outputs
This is a convenience wrapper around uninit_Invoke that returns the result as SyscallResult<T>.
§Errors
-
kSyscallErrorCodeInvalidSyscallInput: The invocation was rejected before any child frame ran: the contract was not found, the invoke flags were invalid, the calldata is longer than kConfigParamMaxCalldataLen, more auth token ids were supplied than kConfigParamMaxAuthTokens, or one or more of the supplied auth token ids are malformed, duplicated, or not owned by the current frame. The syscall is a complete no-op in this case.
-
kSyscallErrorCodeReentrance: The invoked address is already on the stack. The invocation is rejected before any child frame runs and the syscall is a no-op.
-
kSyscallErrorCodeInvokeDepthExceeded: The transaction already holds kConfigParamMaxCrossInvokeDepth invocation frames open, so admitting another would exceed the network’s cross-invoke depth bound. This is a resource limit rather than a malformed call – the same invocation succeeds from a shallower frame. The invocation is rejected before any child frame runs and the syscall is a no-op.