setup_guard
Documentation for eth_defi.lagoon.deployment.setup_guard function.
- setup_guard(*, web3, safe, deployer, owner, asset_managers, vault, module, broadcast_func, any_asset=False, uniswap_v2=None, uniswap_v3=None, aave_v3=None, erc_4626_vaults=None, cowswap=False, velora=False, gmx_deployment=None, cctp_deployment=None, hypercore_vaults=None, hack_sleep=20.0, assets=None, multicall_chunk_size=40, underlying_token_address=None)
Setups up TradingStrategyModuleV0 guard on the Lagoon vault.
Creates the guard smart contract (TradingStrategyModuleV0) and enables it on the Safe multisig as a module.
Runs through various whitelisting rules as transactions against this contract
- Parameters
vault (Optional[web3.contract.contract.Contract]) – The deployed Lagoon vault contract.
Noneon satellite chains.underlying_token_address (Optional[eth_typing.evm.HexAddress]) – Underlying token address for Hypercore whitelisting when vault is None.
web3 (web3.main.Web3) –
safe (safe_eth.safe.safe.Safe) –
deployer (eth_defi.hotwallet.HotWallet) –
owner (eth_typing.evm.HexAddress) –
asset_managers (Union[list[eth_typing.evm.HexAddress], tuple[eth_typing.evm.HexAddress, ...]]) –
module (web3.contract.contract.Contract) –
broadcast_func (Callable[[web3.contract.contract.ContractFunction], hexbytes.main.HexBytes]) –
any_asset (bool) –
uniswap_v2 (Optional[eth_defi.uniswap_v2.deployment.UniswapV2Deployment]) –
uniswap_v3 (Optional[eth_defi.uniswap_v3.deployment.UniswapV3Deployment]) –
aave_v3 (Optional[eth_defi.aave_v3.deployment.AaveV3Deployment]) –
erc_4626_vaults (Optional[list[eth_defi.erc_4626.vault.ERC4626Vault]]) –
cowswap (bool) –
velora (bool) –
gmx_deployment (Optional[eth_defi.gmx.whitelist.GMXDeployment]) –
cctp_deployment (Optional[eth_defi.cctp.whitelist.CCTPDeployment]) –
hypercore_vaults (Optional[list[eth_typing.evm.HexAddress | str]]) –
assets (Optional[list[eth_typing.evm.HexAddress | str]]) –
- Returns
List of
WhitelistEntryrecording everything that was whitelisted.- Return type
list[eth_defi.erc_4626.vault_protocol.lagoon.deployment.WhitelistEntry]