Skip to content

Latest commit

 

History

History
204 lines (190 loc) · 6.88 KB

VaultFactoryLibV1.md

File metadata and controls

204 lines (190 loc) · 6.88 KB

VaultFactoryLibV1.sol

View Source: contracts/libraries/VaultFactoryLibV1.sol

VaultFactoryLibV1

Functions

getByteCode

Gets the bytecode of the Vault contract

function getByteCode(IStore s, bytes32 coverKey, string tokenName, string tokenSymbol, address stablecoin) external pure
returns(bytecode bytes, salt bytes32)

Arguments

Name Type Description
s IStore Provide the store instance
coverKey bytes32 Provide the cover key
tokenName string
tokenSymbol string
stablecoin address Specify the liquidity token for this Vault
Source Code
function getByteCode(
    IStore s,
    bytes32 coverKey,
    string calldata tokenName,
    string calldata tokenSymbol,
    address stablecoin
  ) external pure returns (bytes memory bytecode, bytes32 salt) {
    salt = keccak256(abi.encodePacked(ProtoUtilV1.NS_CONTRACTS, ProtoUtilV1.CNS_COVER_VAULT, coverKey));

    //slither-disable-next-line too-many-digits
    bytecode = abi.encodePacked(type(Vault).creationCode, abi.encode(s, coverKey, tokenName, tokenSymbol, stablecoin));
  }

Contracts