deploy_vault_with_generic_adapter

Documentation for eth_defi.enzyme.generic_adapter_vault.deploy_vault_with_generic_adapter function.

deploy_vault_with_generic_adapter(deployment, deployer, asset_manager, owner, denomination_asset, terms_of_service, fund_name='Example Fund', fund_symbol='EXAMPLE', whitelisted_assets=None, etherscan_api_key=None, production=False, meta='', uniswap_v2=True, uniswap_v3=True, mock_guard=False)[source]

Deploy an Enzyme vault and make it secure.

Deploys an Enzyme vault in a specific way we want to have it deployed.

  • Because we want multiple deployed smart contracts to be verified on Etherscan, this deployed uses a Forge-based toolchain and thus the script can be only run from the git checkout where submodules are included.

  • Set up default policies

  • Assign a generic adapter

  • Assign a USDC payment forwarder with terms of service sign up

  • Assign asset manager role and transfer ownership

  • Whitelist USDC and the other given assets

  • Whitelist Uniswap v2 and v3 spot routers

Note

The GuardV0 ownership is not transferred to the owner at the end of the deployment. You need to do it manually after configuring the guard.

Parameters
  • deployment (eth_defi.enzyme.deployment.EnzymeDeployment) – Enzyme deployment we use.

  • deployer (eth_defi.hotwallet.HotWallet) – Web3.py deployer account we use.

  • asset_manager (Union[eth_typing.evm.HexAddress, str]) –

    Give trading access to this hot wallet address.

    Set to the deployer address to ignore.

  • terms_of_service (web3.contract.contract.Contract | None) – Terms of service contract we use.

  • owner (Union[eth_typing.evm.HexAddress, str]) –

    Nominated new owner.

    Immediately transfer vault ownership from a deployer to a multisig owner. Multisig needs to confirm this by calling claimOwnership.

    Set to the deployer address to ignore.

  • whitelisted_assets (Optional[Collection[eth_defi.token.TokenDetails]]) –

    Whitelist these assets on Uniswap v2 and v3 spot market.

    USDC is always whitelisted.

  • denomination_asset (web3.contract.contract.Contract) – USDC token used as the vault denomination currency.

  • etherscan_api_key (Optional[str]) – Needed to verify deployed contracts.

  • production – Production flag set on GuardedGenericAdapterDeployed event.

  • meta (str) – Metadata for GuardedGenericAdapterDeployed event.

  • uniswap_v2 – Whiteliste Uniswap v2 trading

  • uniswap_v3 – Whiteliste Uniswap v3 trading

  • mock_guard – Deploy unit test mock of the guard

Returns

Freshly deployed vault

Return type

eth_defi.enzyme.vault.Vault