FluidVaultT1DeploymentLogic ​
Inherits:Error
State Variables ​
NATIVE_TOKEN ​
solidity
address internal constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
VAULT_T1_CREATIONCODE_ADDRESS_1 ​
SSTORE2 pointer for the VaultT1 creation code. Stored externally to reduce factory bytecode (in 2 parts)
solidity
address internal immutable VAULT_T1_CREATIONCODE_ADDRESS_1;
VAULT_T1_CREATIONCODE_ADDRESS_2 ​
solidity
address internal immutable VAULT_T1_CREATIONCODE_ADDRESS_2;
LIQUIDITY ​
address of liquidity contract
solidity
address public immutable LIQUIDITY;
ADMIN_IMPLEMENTATION ​
address of Admin implementation
solidity
address public immutable ADMIN_IMPLEMENTATION;
SECONDARY_IMPLEMENTATION ​
address of Secondary implementation
solidity
address public immutable SECONDARY_IMPLEMENTATION;
ADDRESS_THIS ​
address of this contract
solidity
address public immutable ADDRESS_THIS;
Functions ​
constructor ​
solidity
constructor(address liquidity_, address vaultAdminImplementation_, address vaultSecondaryImplementation_);
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
Name | Type | Description |
---|---|---|
supplyToken_ | address | The address of the supply token. |
borrowToken_ | address | The address of the borrow token. |
Returns
Name | Type | Description |
---|---|---|
vaultCreationBytecode_ | bytes | Returns the bytecode of the new vault to deploy. |
vaultT1CreationBytecode ​
returns the stored VaultT1 creation bytecode
solidity
function vaultT1CreationBytecode() public view returns (bytes memory);
_calculateLiquidityVaultSlots ​
Calculates the liquidity vault slots for the given supply token, borrow token, and vault (vault_
).
solidity
function _calculateLiquidityVaultSlots(IFluidVaultT1.ConstantViews memory constants_, address vault_)
private
pure
returns (IFluidVaultT1.ConstantViews memory);
Parameters
Name | Type | Description |
---|---|---|
constants_ | IFluidVaultT1.ConstantViews | Constants struct as used in Vault T1 |
vault_ | address | The address of the vault. |
Returns
Name | Type | Description |
---|---|---|
<none> | IFluidVaultT1.ConstantViews | liquidityVaultSlots_ Returns the calculated liquidity vault slots set in the IFluidVaultT1.ConstantViews struct. |
_bytesConcat ​
solidity
function _bytesConcat(bytes memory _preBytes, bytes memory _postBytes) private pure returns (bytes memory);
_bytesSlice ​
solidity
function _bytesSlice(bytes memory _bytes, uint256 _start, uint256 _length) private pure returns (bytes memory);
Events ​
VaultT1Deployed ​
Emitted when a new vaultT1 is deployed.
solidity
event VaultT1Deployed(address indexed vault, uint256 vaultId, address indexed supplyToken, address indexed borrowToken);
Parameters
Name | Type | Description |
---|---|---|
vault | address | The address of the newly deployed vault. |
vaultId | uint256 | The id of the newly deployed vault. |
supplyToken | address | The address of the supply token. |
borrowToken | address | The address of the borrow token. |