Skip to content

packages.valory.contracts.gnosis_safe_proxy_factory.contract

This module contains the class to connect to an Gnosis Safe Proxy Factory contract.

GnosisSafeProxyFactoryContract Objects

class GnosisSafeProxyFactoryContract(Contract)

The Gnosis Safe Proxy Factory contract.

get_raw_transaction

@classmethod
def get_raw_transaction(cls, ledger_api: LedgerApi, contract_address: str,
                        **kwargs: Any) -> Optional[JSONLike]

Get the raw transaction.

get_raw_message

@classmethod
def get_raw_message(cls, ledger_api: LedgerApi, contract_address: str,
                    **kwargs: Any) -> Optional[bytes]

Get raw message.

get_state

@classmethod
def get_state(cls, ledger_api: LedgerApi, contract_address: str,
              **kwargs: Any) -> Optional[JSONLike]

Get state.

get_deploy_transaction

@classmethod
def get_deploy_transaction(cls, ledger_api: LedgerApi, deployer_address: str,
                           **kwargs: Any) -> Optional[JSONLike]

Get deploy transaction.

Arguments:

  • ledger_api: ledger API object.
  • deployer_address: the deployer address.
  • kwargs: the keyword arguments.

Returns:

an optional JSON-like object.

build_tx_deploy_proxy_contract_with_nonce

@classmethod
def build_tx_deploy_proxy_contract_with_nonce(
        cls,
        ledger_api: EthereumApi,
        proxy_factory_address: str,
        master_copy: str,
        address: str,
        initializer: bytes,
        salt_nonce: int,
        gas: int = MIN_GAS,
        gas_price: Optional[int] = None,
        max_fee_per_gas: Optional[int] = None,
        max_priority_fee_per_gas: Optional[int] = None,
        nonce: Optional[int] = None) -> Tuple[TxParams, str]

Deploy proxy contract via Proxy Factory using createProxyWithNonce (create2)

Arguments:

  • ledger_api: ledger API object
  • proxy_factory_address: the address of the proxy factory
  • address: Ethereum address
  • master_copy: Address the proxy will point at
  • initializer: Data for safe creation
  • salt_nonce: Uint256 for create2 salt
  • gas: Gas
  • gas_price: Gas Price
  • max_fee_per_gas: max
  • max_priority_fee_per_gas: max
  • nonce: Nonce

Returns:

Tuple(tx-hash, tx, deployed contract address)

verify_contract

@classmethod
def verify_contract(cls, ledger_api: EthereumApi,
                    contract_address: str) -> JSONLike

Verify the contract's bytecode

Arguments:

  • ledger_api: the ledger API object
  • contract_address: the contract address

Returns:

the verified status