Call Header
Typed Struct (EIP712)
Params
call_index
uint16
payer_index
uint16
call_type
string
from
address
to
address
to_ens
string
value
uint256
gas_limit
uint32
permissions
uint16
validation
uint16
flow_control
string
returned_false_means_fail
bool
jump_on_success
uint16
jump_on_fail
uint16
variable_arguments_start
uint32
variable_arguments_end
uint32
method_interface
string
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.
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.
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.
"action"
0
Executing the call using the low level "call" function. The contract being called can change blockchain state and sees the FCT_Runner as the calling entity.
"view only"
1
Executing the call using the low level "staticcall" function. The contract being called is not allowed to change the blockchain state and sees the FCT_Runner as the calling entity.
"library"
2
Executing the call using the low level "delegatecall" function. The contract being called runs in the context of the FCT_Runner, has access the FCT_Runner storage variables and any calls from it to an external contracts will be looked as being called directly from the FCT_Runner address.
"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.
value
The native token 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
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.
validation
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.
"continue on success, revert on fail"
0
If call reverts, revert the whole FCT, otherwise, continue to the next call according to the jump_on_success field
"continue on success, stop on fail"
1
If call reverts, stop FCT execution (previous calls are not reverted), otherwise, continue to the next call according to the jump_on_success field
"continue on success, continue on fail"
2
Whether call reverts or not, continue to the next call according to the jump_on_success and jump_on_fail fields respectively
"revert on success, continue on fail"
3
If call reverts, continue to the next call according to the jump_on_fail field, otherwise, revert the whole FCT
"revert on success, stop on fail"
4
If call reverts, stop FCT execution (previous calls are not reverted), otherwise, revert the whole FCT
"stop on success, continue on fail"
5
If call reverts, continue to the next call according to the jump_on_fail field, otherwise, stop FCT execution (previous calls are not reverted)
"stop on success, revert on fail"
6
If call reverts, revert the whole FCT, otherwise, stop FCT execution (previous calls are not reverted)
"stop on success, stop on fail"
7
Whether call reverts or not, stop FCT execution (previous calls are not reverted)
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.
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.
variable_arguments_start
Specify the staring point, in bytes, for the FCT engine's variables searcher.
Set both to 0, if no variables are being used in method's call data, in order to save gas.
variable_arguments_end
Specify the ending point (not including), in bytes, for the FCT engine's variables searcher.
method_interface
Last updated