Skip to content

FluidDexT1DeploymentLogic ​

Git Source

Inherits:Error

State Variables ​

NATIVE_TOKEN ​

solidity
address internal constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

POOL_T1_CREATIONCODE_ADDRESS_1 ​

SSTORE2 pointer for the PoolT1 creation code. Stored externally to reduce factory bytecode (in 2 parts)

solidity
address internal immutable POOL_T1_CREATIONCODE_ADDRESS_1;

POOL_T1_CREATIONCODE_ADDRESS_2 ​

solidity
address internal immutable POOL_T1_CREATIONCODE_ADDRESS_2;

COL_OPERATIONS_CREATIONCODE_ADDRESS ​

SSTORE2 pointers for the creation code of various operations contracts

solidity
address internal immutable COL_OPERATIONS_CREATIONCODE_ADDRESS;

DEBT_OPERATIONS_CREATIONCODE_ADDRESS ​

solidity
address internal immutable DEBT_OPERATIONS_CREATIONCODE_ADDRESS;

PERFECT_OPERATIONS_AND_SWAP_OUT_CREATIONCODE_ADDRESS ​

solidity
address internal immutable PERFECT_OPERATIONS_AND_SWAP_OUT_CREATIONCODE_ADDRESS;

LIQUIDITY ​

address of liquidity contract

solidity
address public immutable LIQUIDITY;

DEX_FACTORY ​

address of dexfactory contract

solidity
address public immutable DEX_FACTORY;

ADMIN_IMPLEMENTATION ​

address of Admin implementation

solidity
address public immutable ADMIN_IMPLEMENTATION;

SHIFT_IMPLEMENTATION ​

address of Shift implementation

solidity
address public immutable SHIFT_IMPLEMENTATION;

CONTRACT_DEPLOYER ​

address of Deployer Contract

solidity
address public immutable CONTRACT_DEPLOYER;

MINI_DEPLOYER ​

address of MiniDeployer Contract

solidity
MiniDeployer public immutable MINI_DEPLOYER;

ADDRESS_THIS ​

address of this contract

solidity
address public immutable ADDRESS_THIS;

Functions ​

_deploy ​

Deploys a contract using the CREATE opcode with the provided bytecode (bytecode_). This is an internal function, meant to be used within the contract to facilitate the deployment of other contracts.

solidity
function _deploy(bytes memory bytecode_) internal returns (address address_);

Parameters

NameTypeDescription
bytecode_bytesThe bytecode of the contract to be deployed.

Returns

NameTypeDescription
address_addressReturns the address of the deployed contract.

constructor ​

solidity
constructor(
    address liquidity_,
    address dexFactory_,
    address contractDeployer_,
    address colOperations_,
    address debtOperations_,
    address perfectOperationsAndSwapOut_,
    address mainAddress1_,
    address mainAddress2_
);

dexT1 ​

solidity
function dexT1(address token0_, address token1_, uint256 oracleMapping_)
    external
    returns (bytes memory dexCreationBytecode_);

dexT1CreationBytecode ​

returns the stored DexT1 creation bytecode

solidity
function dexT1CreationBytecode() public view returns (bytes memory);

colOperationsCreationCode ​

Retrieves the creation code for the FluidDexT1OperationsCol contract

solidity
function colOperationsCreationCode() public view returns (bytes memory);

debtOperationsCreationCode ​

Retrieves the creation code for the FluidDexT1OperationsDebt contract

solidity
function debtOperationsCreationCode() public view returns (bytes memory);

perfectOperationsCreationCode ​

Retrieves the creation code for the FluidDexT1PerfectOperations contract

solidity
function perfectOperationsCreationCode() public view returns (bytes memory);

_calculateLiquidityDexSlots ​

Calculates the liquidity dex slots for the given supply token, borrow token, and dex (dex_).

solidity
function _calculateLiquidityDexSlots(IFluidDexT1.ConstantViews memory constants_, address dex_)
    private
    pure
    returns (IFluidDexT1.ConstantViews memory);

Parameters

NameTypeDescription
constants_IFluidDexT1.ConstantViewsConstants struct as used in Dex T1
dex_addressThe address of the dex.

Returns

NameTypeDescription
<none>IFluidDexT1.ConstantViewsliquidityDexSlots_ Returns the calculated liquidity dex slots set in the IFluidDexT1.ConstantViews struct.

Events ​

DexT1Deployed ​

Emitted when a new dexT1 is deployed.

solidity
event DexT1Deployed(address indexed dex, uint256 dexId, address indexed supplyToken, address indexed borrowToken);

Parameters

NameTypeDescription
dexaddressThe address of the newly deployed dex.
dexIduint256The id of the newly deployed dex.
supplyTokenaddressThe address of the supply token.
borrowTokenaddressThe address of the borrow token.