agent0.ethpy.hyperdrive.deploy ============================== .. py:module:: agent0.ethpy.hyperdrive.deploy .. autoapi-nested-parse:: Helper functions for deploying Hyperdrive contracts. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: agent0.ethpy.hyperdrive.deploy.UINT256_MAX Classes ------- .. autoapisummary:: agent0.ethpy.hyperdrive.deploy.DeployedBaseAndVault agent0.ethpy.hyperdrive.deploy.DeployedHyperdriveFactory agent0.ethpy.hyperdrive.deploy.DeployedHyperdrivePool agent0.ethpy.hyperdrive.deploy.HyperdriveDeployType Functions --------- .. autoapisummary:: agent0.ethpy.hyperdrive.deploy.deploy_base_and_vault agent0.ethpy.hyperdrive.deploy.deploy_hyperdrive_factory agent0.ethpy.hyperdrive.deploy.deploy_hyperdrive_from_factory Module Contents --------------- .. py:data:: UINT256_MAX :value: 115792089237316195423570985008687907853269984665640564039457584007913129639935 .. py:class:: DeployedBaseAndVault Bases: :py:obj:`NamedTuple` Collection of attributes associated with a locally deployed Hyperdrive factory. .. !! processed by numpydoc !! .. py:attribute:: deployer_account :type: eth_account.signers.local.LocalAccount .. py:attribute:: base_token_contract :type: hyperdrivetypes.types.ERC20MintableContract | web3.contract.contract.Contract .. py:attribute:: vault_shares_token_contract :type: hyperdrivetypes.types.MockERC4626Contract | hyperdrivetypes.types.MockLidoContract .. py:class:: DeployedHyperdriveFactory Bases: :py:obj:`NamedTuple` Collection of attributes associated with a locally deployed Hyperdrive factory. .. !! processed by numpydoc !! .. py:attribute:: deployer_account :type: eth_account.signers.local.LocalAccount .. py:attribute:: factory_contract :type: hyperdrivetypes.types.HyperdriveFactoryContract .. py:attribute:: deployer_coordinator_contract :type: hyperdrivetypes.types.ERC4626HyperdriveDeployerCoordinatorContract | hyperdrivetypes.types.StETHHyperdriveDeployerCoordinatorContract .. py:attribute:: factory_deploy_config :type: hyperdrivetypes.types.HyperdriveFactory.FactoryConfig .. py:class:: DeployedHyperdrivePool Bases: :py:obj:`NamedTuple` Collection of attributes associated with a locally deployed chain with a Hyperdrive pool. .. !! processed by numpydoc !! .. py:attribute:: deployer_account :type: eth_account.signers.local.LocalAccount .. py:attribute:: hyperdrive_contract :type: hyperdrivetypes.types.IHyperdriveContract .. py:attribute:: base_token_contract :type: hyperdrivetypes.types.ERC20MintableContract | web3.contract.contract.Contract .. py:attribute:: vault_shares_token_contract :type: hyperdrivetypes.types.MockERC4626Contract | hyperdrivetypes.types.MockLidoContract .. py:attribute:: deploy_block_number :type: int .. py:attribute:: pool_deploy_config :type: hyperdrivetypes.types.IHyperdrive.PoolDeployConfig .. py:class:: HyperdriveDeployType Bases: :py:obj:`enum.Enum` The deploy type for the hyperdrive pool. .. !! processed by numpydoc !! .. py:attribute:: ERC4626 :value: 0 .. py:attribute:: STETH :value: 1 .. py:function:: deploy_base_and_vault(web3: web3.Web3, deploy_type: HyperdriveDeployType, deploy_account: eth_account.signers.local.LocalAccount, initial_variable_rate: fixedpointmath.FixedPoint) -> DeployedBaseAndVault Deploys the underlying base and vault contracts :param web3: Web3 provider object. :type web3: Web3 :param deploy_type: The deploy type for the hyperdrive pool. :type deploy_type: HyperdriveDeployType :param deploy_account: The account that's deploying the contract. :type deploy_account: LocalAccount :param initial_variable_rate: The starting variable rate for an underlying vault. :type initial_variable_rate: FixedPoint :returns: Containing the deployed base and vault contracts. :rtype: DeployedBaseAndVault .. !! processed by numpydoc !! .. py:function:: deploy_hyperdrive_factory(web3: web3.Web3, deployer_account: eth_account.signers.local.LocalAccount, deployed_base_and_vault: DeployedBaseAndVault, deploy_type: HyperdriveDeployType, factory_deploy_config: hyperdrivetypes.types.HyperdriveFactory.FactoryConfig) -> DeployedHyperdriveFactory Deploys the hyperdrive factory and supporting contracts on the rpc_uri chain. :param web3: Web3 provider object. :type web3: Web3 :param deployer_account: The account that's deploying the contract. :type deployer_account: LocalAccount :param deployed_base_and_vault: The base and vault contracts that were deployed on the local chain. :type deployed_base_and_vault: DeployedBaseAndVault :param deploy_type: The deploy type for the hyperdrive pool. :type deploy_type: HyperdriveDeployType :param factory_deploy_config: The factory configuration for initializing the hyperdrive factory. The type is generated from the Hyperdrive ABI using Pypechain. :type factory_deploy_config: FactoryConfig :returns: Containing the deployed factory, the deploy coordinator contracts, the updated factory config, and the hyperdrive registry contract. :rtype: DeployedHyperdriveFactory .. !! processed by numpydoc !! .. py:function:: deploy_hyperdrive_from_factory(web3: web3.Web3, deployer_account: eth_account.signers.local.LocalAccount, deployed_base_and_vault: DeployedBaseAndVault, deployed_factory: DeployedHyperdriveFactory, deploy_type: HyperdriveDeployType, initial_liquidity: fixedpointmath.FixedPoint, initial_fixed_apr: fixedpointmath.FixedPoint, initial_time_stretch_apr: fixedpointmath.FixedPoint, pool_deploy_config: hyperdrivetypes.types.IHyperdrive.PoolDeployConfig) -> DeployedHyperdrivePool Initializes a Hyperdrive pool and supporting contracts on an existing chain. :param web3: Web3 provider object. :type web3: Web3 :param deployer_account: The local account deploying Hyperdrive. :type deployer_account: LocalAccount :param deployed_base_and_vault: The base and vault contracts that were deployed on the local chain. :type deployed_base_and_vault: DeployedBaseAndVault :param deployed_factory: The factory and supporting contracts that were deployed on the local chain. :type deployed_factory: DeployedHyperdriveFactory :param deploy_type: The deploy type for the hyperdrive pool. :type deploy_type: HyperdriveDeployType :param initial_liquidity: The amount of money to be provided by the `deployer_account` for initial pool liquidity. :type initial_liquidity: FixedPoint :param initial_fixed_apr: The fixed rate of the pool on initialization. :type initial_fixed_apr: FixedPoint :param initial_time_stretch_apr: The apr to target for the time stretch calculation. :type initial_time_stretch_apr: FixedPoint :param pool_deploy_config: The configuration for initializing hyperdrive pool. The type is generated from the Hyperdrive ABI using Pypechain. :type pool_deploy_config: PoolDeployConfig :returns: A named tuple with the following fields: deploy_account: LocalAccount The local account that deploys and initializes hyperdrive. hyperdrive_contract: IHyperdriveContract Web3 contract instance for the hyperdrive contract. base_token_contract: Contract Web3 contract instance for the base token contract. vault_shares_token_contract: Contract Web3 contract instance for the vault shares token contract. deploy_block_number: int The block number hyperdrive was deployed at. :rtype: DeployedHyperdrivePool .. !! processed by numpydoc !!