# Sub-systems

The FCT platform is constructed from a core sub-system and some modular / replaceable / extendable sub-systems as follows:

<img alt="" class="gitbook-drawing">

## FCT Core

Holds contracts that are responsible for management and execution of FCTs.\
It allows to register engine and economy contracts, route execution to the right engine version, ens services and provides an authentication service for the runner in order to make sure engine being used is genuine.

#### Contracts

FCT\_Authenticator.sol\
FCT\_Auth\_FlashLoan.sol\
FCT\_Auth\_Vault.sol\
FCT\_Auth\_SecureStorage.sol\
FCT\_Controller.sol\
FCT\_ENS.sol

#### Interfaces

IFCT\_Authenticator.sol\
IFCT\_Controller.sol\
IFCT\_Engine.sol\
IFCT\_ENS.sol\
IFCT\_Runner.sol\
IFCT\_RunnerOptional.sol<br>

## FCT Engines

FCT Engines hold the logic for executing FCTs.\
They are recognized by their interface and version number.\
The FCT Core subsystem makes sure only signal engine interface + version, exist in the system.\
It also makes sure, once engine was registred in the system it is immutable.

#### Contracts

FCT\_BatchMultiSig.sol\
FCT\_Constants.sol\
FCT\_Helpers.sol<br>

## FCT Economy

FCT Economy contracts implements the tokenomics as defined on the whitepaper.\
It supports multi tokenomics contracts, allowing the runners to decide on which one they are willing to support. This also eliminate the need for assets migrations of the "gas station" (FCT\_Actuator) assets in case of upgrades of the tokenomics logic.\
Older tokenomics cannot be deleted, making the FCT system future proof, allowing the runners to keep working with an older and battle tested tokenomics.

#### Contracts

FCT\_Actuator.sol\
FCT\_ActuatorCore.sol\
FCT\_ActuatorStorage.sol\
FCT\_Arch.sol\
FCT\_Tokenomics.sol\
FCT\_Funding.sol

#### Interfaces

IFCT\_Tokenomics.sol\
IFCT\_Actuator.sol\
IFCT\_Funding.sol<br>

## FCT Libraries

FCT Libraries are special contracts that are executed by the runners via delegate calls.\
They can be considered as an "internal" extensions of the FCT system.\
In order to use an official library there is a need to use "library@\<name>" as ens\_name along with the contract address for extra safety. Furthermore, those ens addresses are FCT internal and added only by the FCT system owners.<br>

{% hint style="warning" %}
Because the security concern of using delegate calls, it is recommended to use only official libraries&#x20;
{% endhint %}

#### Contracts

FCT\_Lib\_MultiCall.sol\
FCT\_Lib\_UniswapV2.sol<br>

## FCT Extensions

FCT Extensions are stand alone contracts that perform generic actions, eg. math, storage, etc.\
They are used on an FCT message just like any other existing protocol.\
The generic nature of this contracts combined with the ability to use return values as variables for calls, extends the capabilities of the FCT platform.&#x20;

#### Contracts

Decimals.sol\
FCT\_Ext\_SecureStorage.sol\
FCT\_Ext\_SignersValidator.sol\
FCT\_Ext\_TokensSafeMath.sol\
FCT\_Ext\_TokensValidator.sol<br>

## Smart Wallet (FCT Runner)

Smart wallet is implementation of a smart account, supporting backup and inheritance functionality.\
FCT\_Runner interface also implemented, making smart wallet capable of execution FCTs.

#### Contracts

Activator.sol\
ActivatorBase.sol\
Backupable.sol\
Factory.sol\
FactoryProxy.sol\
Heritable.sol\
Proxy.sol\
ProxyLatest.sol\
SmartOracle.sol\
SmartWallet.sol\
SmartWalletCore.sol\
Storage.sol\
StorageBase.sol

#### Interfaces

IBackupable.sol\
ICreator.sol\
IFactory.sol\
IGasReturn.sol\
IHeritable.sol\
Interface.sol\
IOracle.sol\
ITokenEconomy.sol\
IWallet.sol<br>

## Flash Loans Executors

Flash loans are special contracts that act both as activators and runners.\
They work with the economy contracts in order to execute FCTs after a flash loan was given and make sure it was returned at the end of the execution.\
They also holds the flash load assets, giving the ability to set special calls inside an FCT, that move this assets to one of the participants or directly to other protocols.\
It extends that capabilities of both, flash loan protocols and the FCT system, allowing spreading the flash loan among different protocols and runners during the execution process.

#### Contracts

FCT\_FlashLoan.sol\
FCT\_FlashSwap\_Uniswap\_v2.sol\
FCT\_FlashLoan\_Aave\_v2.sol\
FCT\_FlashLoan\_Aave\_v3.sol
