AutomatedSafe
Documentation for eth_defi.erc_4626.vault_protocol.lagoon.vault.AutomatedSafe Python class.
- class AutomatedSafe
Bases:
objectMixin for Safe multisig wallets with TradingStrategyModuleV0 guard.
Provides transaction wrapping through the guard module, used by both full Lagoon vaults (
LagoonVault) and satellite Safe-only deployments (LagoonSatelliteVault).Encapsulates Safe + TradingStrategyModuleV0 interaction
Independent of vault contracts (no ERC-4626 dependency)
- Parameters
web3 – Web3 connection to the chain where the Safe is deployed.
safe_address – Address of the Gnosis Safe multisig. Can be None for
LagoonVaultwhere it is lazily resolved from the vault contract.trading_strategy_module_address – Address of the TradingStrategyModuleV0 guard module enabled on the Safe.
Attributes summary
Get the underlying Safe object used as an API from safe-eth-py library.
Get Safe multisig contract address.
Safe multisig as a contract.
Get the TradingStrategyModuleV0 contract instance.
Get TradingStrategyModuleV0 contract address.
Get TradingStrategyModuleV0 contract ABI version.
Methods summary
__init__(web3[, safe_address, ...])- param web3
fetch_safe(address)Create a Safe object from an address.
Perform deployed smart contract probing.
transact_via_exec_module(func_call[, value, ...])Create a multisig transaction using a module.
transact_via_trading_strategy_module(func_call)Create a Safe multisig transaction using TradingStrategyModuleV0.
- __init__(web3, safe_address=None, trading_strategy_module_address=None)
- Parameters
web3 (web3.main.Web3) – Web3 connection to the chain where the Safe is deployed.
safe_address (Optional[eth_typing.evm.HexAddress]) – Address of the Gnosis Safe multisig. Can be None for
LagoonVaultwhere it is lazily resolved from the vault contract.trading_strategy_module_address (Optional[eth_typing.evm.HexAddress]) – Address of the TradingStrategyModuleV0 guard module enabled on the Safe.
- fetch_safe(address)
Create a Safe object from an address.
Use
safeproperty for cached access.- Parameters
address (Union[eth_typing.evm.HexAddress, str]) –
- Return type
safe_eth.safe.safe.Safe
- fetch_trading_strategy_module_version()
Perform deployed smart contract probing.
- property safe: safe_eth.safe.safe.Safe
Get the underlying Safe object used as an API from safe-eth-py library.
Wraps Safe contract using Gnosis’s in-house library
- property safe_address: eth_typing.evm.HexAddress
Get Safe multisig contract address.
- property safe_contract: web3.contract.contract.Contract
Safe multisig as a contract.
Interact with Safe multisig ABI
- property trading_strategy_module: web3.contract.contract.Contract
Get the TradingStrategyModuleV0 contract instance.
- property trading_strategy_module_address: Optional[eth_typing.evm.HexAddress]
Get TradingStrategyModuleV0 contract address.
- property trading_strategy_module_version: str
Get TradingStrategyModuleV0 contract ABI version.
Subject to change, development in progress
- transact_via_exec_module(func_call, value=0, operation=0)
Create a multisig transaction using a module.
Calls
execTransactionFromModuleon Gnosis Safe contractExecutes a transaction as a multisig
Mostly used for testing w/whitelist ignore
Warning
A special gas fix is needed, because
eth_estimateGasseems to fail for these Gnosis Safe transactions.- Parameters
func_call (web3.contract.contract.ContractFunction) – Bound smart contract function call
value (int) – ETH attached to the transaction
operation –
Gnosis enum.
Call = 0, DelegateCall = 1.
- Return type
web3.contract.contract.ContractFunction
- transact_via_trading_strategy_module(func_call, value=0, abi_version=None)
Create a Safe multisig transaction using TradingStrategyModuleV0.
- Parameters
- Returns
Bound Solidity function call you need to turn to a transaction
- Return type
web3.contract.contract.ContractFunction