deploy_safe_with_deterministic_address

Documentation for eth_defi.safe.deployment.deploy_safe_with_deterministic_address function.

deploy_safe_with_deterministic_address(web3, deployer, owners, threshold, salt_nonce, master_copy_address='0x29fcB43b46531BcA003ddC8FCB67FFE91900C762', proxy_factory_address='0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67', post_deploy_delay_seconds=10.0)

Deploy a new Safe wallet at a deterministic address using CREATE2.

Uses the canonical Safe v1.4.1 ProxyFactory (deployed at the same address on all EVM chains) with createProxyWithNonce() to produce the same Safe address across multiple chains, given identical parameters.

For cross-chain deterministic deployment, ensure:

  • Same owners list (same order)

  • Same threshold

  • Same salt_nonce

  • Same master_copy_address and proxy_factory_address (defaults are fine)

Parameters
  • deployer (eth_account.signers.local.LocalAccount) – Must be LocalAccount due to Safe library limitations.

  • owners (list[Union[eth_typing.evm.HexAddress, str]]) – List of owner addresses. Must be in the same order across chains.

  • threshold (int) – Number of required confirmations.

  • salt_nonce (int) – Uint256 salt for CREATE2. Use the same value across chains for the same address.

  • master_copy_address (Union[eth_typing.evm.HexAddress, str]) – Safe singleton address. Default is Safe v1.4.1 L2.

  • proxy_factory_address (Union[eth_typing.evm.HexAddress, str]) – Safe ProxyFactory address. Default is the canonical v1.4.1 factory.

  • post_deploy_delay_seconds (float) – Sleep after deployment on non-Anvil networks to let state propagate.

  • web3 (web3.main.Web3) –

Return type

safe_eth.safe.safe.Safe