FluidDexT1DeploymentLogic ​
Inherits:Error
State Variables ​
NATIVE_TOKEN ​
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)
address internal immutable POOL_T1_CREATIONCODE_ADDRESS_1;
POOL_T1_CREATIONCODE_ADDRESS_2 ​
address internal immutable POOL_T1_CREATIONCODE_ADDRESS_2;
COL_OPERATIONS_CREATIONCODE_ADDRESS ​
SSTORE2 pointers for the creation code of various operations contracts
address internal immutable COL_OPERATIONS_CREATIONCODE_ADDRESS;
DEBT_OPERATIONS_CREATIONCODE_ADDRESS ​
address internal immutable DEBT_OPERATIONS_CREATIONCODE_ADDRESS;
PERFECT_OPERATIONS_AND_SWAP_OUT_CREATIONCODE_ADDRESS ​
address internal immutable PERFECT_OPERATIONS_AND_SWAP_OUT_CREATIONCODE_ADDRESS;
LIQUIDITY ​
address of liquidity contract
address public immutable LIQUIDITY;
DEX_FACTORY ​
address of dexfactory contract
address public immutable DEX_FACTORY;
ADMIN_IMPLEMENTATION ​
address of Admin implementation
address public immutable ADMIN_IMPLEMENTATION;
SHIFT_IMPLEMENTATION ​
address of Shift implementation
address public immutable SHIFT_IMPLEMENTATION;
CONTRACT_DEPLOYER ​
address of Deployer Contract
address public immutable CONTRACT_DEPLOYER;
MINI_DEPLOYER ​
address of MiniDeployer Contract
MiniDeployer public immutable MINI_DEPLOYER;
ADDRESS_THIS ​
address of this contract
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.
function _deploy(bytes memory bytecode_) internal returns (address address_);
Parameters
Name | Type | Description |
---|---|---|
bytecode_ | bytes | The bytecode of the contract to be deployed. |
Returns
Name | Type | Description |
---|---|---|
address_ | address | Returns the address of the deployed contract. |
constructor ​
constructor(
address liquidity_,
address dexFactory_,
address contractDeployer_,
address colOperations_,
address debtOperations_,
address perfectOperationsAndSwapOut_,
address mainAddress1_,
address mainAddress2_
);
dexT1 ​
function dexT1(address token0_, address token1_, uint256 oracleMapping_)
external
returns (bytes memory dexCreationBytecode_);
dexT1CreationBytecode ​
returns the stored DexT1 creation bytecode
function dexT1CreationBytecode() public view returns (bytes memory);
colOperationsCreationCode ​
Retrieves the creation code for the FluidDexT1OperationsCol contract
function colOperationsCreationCode() public view returns (bytes memory);
debtOperationsCreationCode ​
Retrieves the creation code for the FluidDexT1OperationsDebt contract
function debtOperationsCreationCode() public view returns (bytes memory);
perfectOperationsCreationCode ​
Retrieves the creation code for the FluidDexT1PerfectOperations contract
function perfectOperationsCreationCode() public view returns (bytes memory);
_calculateLiquidityDexSlots ​
Calculates the liquidity dex slots for the given supply token, borrow token, and dex (dex_
).
function _calculateLiquidityDexSlots(IFluidDexT1.ConstantViews memory constants_, address dex_)
private
pure
returns (IFluidDexT1.ConstantViews memory);
Parameters
Name | Type | Description |
---|---|---|
constants_ | IFluidDexT1.ConstantViews | Constants struct as used in Dex T1 |
dex_ | address | The address of the dex. |
Returns
Name | Type | Description |
---|---|---|
<none> | IFluidDexT1.ConstantViews | liquidityDexSlots_ Returns the calculated liquidity dex slots set in the IFluidDexT1.ConstantViews struct. |
Events ​
DexT1Deployed ​
Emitted when a new dexT1 is deployed.
event DexT1Deployed(address indexed dex, uint256 dexId, address indexed supplyToken, address indexed borrowToken);
Parameters
Name | Type | Description |
---|---|---|
dex | address | The address of the newly deployed dex. |
dexId | uint256 | The id of the newly deployed dex. |
supplyToken | address | The address of the supply token. |
borrowToken | address | The address of the borrow token. |