safe.deployment
Documentation for eth_defi.safe.deployment Python module.
Deploy Safe multisig wallets.
Helpers for deploying Safe, managing owners and modifying the deployment
Safe source code:
Functions
|
Update Safe owners and threshold list. |
|
Deploy a new Safe wallet. |
|
Spoof Safe.disableModule() call on a forked mainnet. |
|
Wrap Safe contract as Safe Python proxy object |
- deploy_safe(web3, deployer, owners, threshold, master_copy_address='0x29fcB43b46531BcA003ddC8FCB67FFE91900C762', post_deploy_delay_seconds=10.0)
Deploy a new Safe wallet.
Use version Safe v 1.4.1
- Parameters
deployer (eth_account.signers.local.LocalAccount) – Must be LocalAccount due to Safe library limitations.
master_copy_address –
Default Safe 1.4.1 layer two master copy address.
See
MASTER_COPIESUse +L2 version tag for Layer two chains
Discussion
web3 (web3.main.Web3) –
owners (list[Union[eth_typing.evm.HexAddress, str]]) –
threshold (int) –
- Return type
safe_eth.safe.safe.Safe
- add_new_safe_owners(web3, safe, deployer, owners, threshold, gas_per_tx=500000, gnosis_safe_state_safety_sleep=20)
Update Safe owners and threshold list.
Safe cannot replace the existing owner list
Designed to create the owner list after a deployment.
The multisig must be in 1-of-1 deployer state
Note
We cannot remove deployer account from the list, but it must be done by the new owners
- Parameters
gas_per_tx – Gas limit for a single transaction.
between_calls_sleep – Deployer hack
web3 (web3.main.Web3) –
safe (safe_eth.safe.safe.Safe) –
deployer (eth_account.signers.local.LocalAccount) –
owners (list[Union[eth_typing.evm.HexAddress, str]]) –
threshold (int) –
More info:
- fetch_safe_deployment(web3, address)
Wrap Safe contract as Safe Python proxy object
- Parameters
web3 (web3.main.Web3) –
address (Union[eth_typing.evm.HexAddress, str]) –
- Return type
safe_eth.safe.safe.SafeV141
- disable_safe_module(web3, safe_address, module_address)
Spoof Safe.disableModule() call on a forked mainnet.
Safe makes disable module transaction unnecessary complicated, because the internal linked list is exposed
- Raises
ValueError – Module is not enabled.
- Returns
Bound ContractFunction to call on the Safe contract.
- Parameters
web3 (web3.main.Web3) –
safe_address (str) –
module_address (Union[eth_typing.evm.HexAddress, str]) –
- Return type
web3.contract.contract.ContractFunction