Skip to content

FluidVaultT1DeploymentLogic_Not_For_Prod ​

Git Source

Inherits:Error

State Variables ​

NATIVE_TOKEN ​

solidity
address internal constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

LIQUIDITY ​

address of liquidity contract

solidity
address public immutable LIQUIDITY;

DEPLOYER ​

solidity
address public immutable DEPLOYER;

MINI_DEPLOYER ​

address of MiniDeployer Contract

solidity
MiniDeployer public immutable MINI_DEPLOYER;

ADMIN_IMPLEMENTATION ​

address of Admin implementation

solidity
address public immutable ADMIN_IMPLEMENTATION;

SECONDARY_IMPLEMENTATION ​

address of Secondary implementation

solidity
address public immutable SECONDARY_IMPLEMENTATION;

VAULT_T1_CREATIONCODE_MAIN_OPERATE ​

solidity
address public immutable VAULT_T1_CREATIONCODE_MAIN_OPERATE;

VAULT_T1_CREATIONCODE_MAIN ​

solidity
address public immutable VAULT_T1_CREATIONCODE_MAIN;

ADDRESS_THIS ​

address of this contract

solidity
address public immutable ADDRESS_THIS;

Functions ​

constructor ​

each vault type has different vaultAdminImplementation but same vaultSecondaryImplementatio

solidity
constructor(
    address liquidity_,
    address vaultFactory_,
    address deployer_,
    address vaultAdminImplementation_,
    address vaultSecondaryImplementation_,
    address vaultOperateImplementation_,
    address vaultMainImplementation_
);

vaultT1 ​

Computes vaultT1 bytecode for the given supply token (supplyToken_) and borrow token (borrowToken_). This will be called by the VaultFactory via .delegateCall

solidity
function vaultT1(address supplyToken_, address borrowToken_) external returns (bytes memory vaultCreationBytecode_);

Parameters

NameTypeDescription
supplyToken_addressThe address of the supply token.
borrowToken_addressThe address of the borrow token.

Returns

NameTypeDescription
vaultCreationBytecode_bytesReturns the bytecode of the new vault to deploy.

_calculateLiquidityVaultSlots ​

Calculates the liquidity vault slots for the given supply token, borrow token, and vault (vault_).

solidity
function _calculateLiquidityVaultSlots(IFluidVaultT1_Not_For_Prod.ConstantViews memory constants_, address vault_)
    private
    pure
    returns (IFluidVaultT1_Not_For_Prod.ConstantViews memory);

Parameters

NameTypeDescription
constants_IFluidVaultT1_Not_For_Prod.ConstantViewsConstants struct as used in Vault T1
vault_addressThe address of the vault.

Returns

NameTypeDescription
<none>IFluidVaultT1_Not_For_Prod.ConstantViewsliquidityVaultSlots_ Returns the calculated liquidity vault slots set in the IFluidVaultT1.ConstantViews struct.

Events ​

VaultT1Deployed ​

Emitted when a new vaultT1 is deployed.

solidity
event VaultT1Deployed(address indexed vault, uint256 vaultId, address indexed supplyToken, address indexed borrowToken);

Parameters

NameTypeDescription
vaultaddressThe address of the newly deployed vault.
vaultIduint256The id of the newly deployed vault.
supplyTokenaddressThe address of the supply token.
borrowTokenaddressThe address of the borrow token.