FCT_Controller

FCT_Controller.sol is a single, non-upgradable, non-replaceable, smart contract that act as a proxy for FCT engines.

It supports multiple implementations of the same interface by enabling interface versioning:

  • The controller is agnostic to the content and structure of the FCT (except the selector and version calldata)

  • The controller passes activation requests to the right FCT_Engine and the return values to the FCT_Actuator

circle-info

FCT_Controller supports multiple actuators defined by the ACTUATOR_ROLE

circle-info

The first 24 bytes of an activation call acts as an Id of the engine's function as follows: 4 bytes (function selector), 3 bytes (version), 25 bytes (reserved)

FCT_Controller.sol keeps track of executed FCTs, protects against double spending and enables recurrent execution.

FCT_Controller.sol secures the platform by checking the authenticity of an FCT_Engine implementation when FCT_Runner is getting requests to execute calls.

call id

The first 32 bytes of an activation call received from the FCT_Actuator. Structure: function_selector(4 bytes), version(3 bytes), reserved(25 bytes), not used(4 bytes)

activation id

Structure: function_selector(4 bytes), version(3 byte), reserved(25 bytes), nonce (4 bytes)

Main Functions

fallback

Implements the enhanced proxy and generates unique activation id for every FCT execution.

circle-info

Nonce is a sequence number that represents activation per major version of a selector.

purge

Used by the FCT_Engine to delete old FCTs from the blockchain storage in order to save gas.

register

Used by the FCT_Engine to keep information about the executed FCT.

addTarget

Used by the DAO to add a new version to one of the FCT_Engine implementations.

setEnsManager

Used by the DAO to replace the FCT_ENS smart contract.

version

Returns the engine version from an activation id.

engine

Returns the address of the FCT_Engine for an activation id.

activationId

Returns the activation id for a given call id

isExecuting

Returns true when an activation id belongs to the current running FCT.

isExecutingFCT

Returns true when a fct id (messageHash) belongs to the current running FCT.

Last updated