Call Header

Typed Struct (EIP712)

Call(uint16 call_index,uint16 payer_index,string call_type,address from,address to,string to_ens,uint256 eth_value,uint32 gas_limit,uint16 permissions,string flow_control,uint16 jump_on_success,uint16 jump_on_fail,string method_interface)

Params

call_index

Call index is the call position, stating from 1. The value must be equal to position of the call in the list of calls inside the FCT.

Call index param helps the user to identify the call from which a returned data s used when signing an EIP-712 FCT message

payer_index

The index of the "from" address that will pay for the call, starting from 1. Usually it will be the same value as the call_index. If the payer is 0, the payment of the call will be equally divided by the other payers of the FCT.

If all payer indexes on an FCT are 0, the activator will pay for this FCT

call_type

FCT supports three types of calls: call, staticcall and delegatecall

flow_control is defined using human readable string, so the user can easily see the call type.

"library" is extremely powerful, yet dangerous. It is recommended to use only trusted contracts for "library" calls and protect the calling address by forcing to use both "to" address and "to_ens" (Preferred LocalENS of type: library)

from

From is the contract that executes the call, usually an on-chain-wallet like the vault. This contract must implement the IFCT_Runner interface.

to

Destination of the call. A smart contract address in case of calling a contract, or any address in case of sending ETH.

to_ens (optional)

ENS is also supported.

eth_value

The ETH value that will be sent with the call.

gas_limit

There is possibly to limit the gas usage per call. When set to 0, no limit is enforced.

permissions

permissions are 16 bits that can be used to define security groups for FCTs

The permissions are just passed transparently, by the FCT_Engine, to the FCT Runner. The FCT Runner can implement any logic regarding the permissions bits enabling an extendable execution model for FCTs.

For example, FCT Runner can allow a specific address (child account) to run only FCTs that has 0x0001 permission, while limiting execution of FCTs with 0x0001 permissions in terms of protocols, amounts and rate.

flow_control

FCT supports if/then functionality via the flow_control field combined with the "jump on" fields.

flow_control is defined using human readable string, so the user can easily see the flow condition.

if/then blocks can be achieved by using one of the "cont" flow controls and setting the "jump_on" values

jump_on_success

Part of the flow control. Specify the amount of calls to jump over when current call succeed. When setting to 0 and the current call succeed, the adjacent call will be executed.

This value is ignored when "stop on success" or "revert on success" is being used

jump_on_fail

Part of the flow control. Specify the amount of calls to jump over when current call fails. When setting to 0 and the current call fails, the adjacent call will be executed.

This value is ignored when "stop on fail" or "revert on fail" is being used

method_interface

The name of the function to be called followed by type-names, in parentheses, without any spaces. This is used in order to calculate the function signature and selector. See more info here

ERC20 transfer method interface looks like this: "transfer(address,uint256)"

Last updated