API docs

exception brownie_safe.ApiError

Bases: Exception

class brownie_safe.BrownieSafe(address, base_url=None, multisend=None)

Bases: Safe

property account: LocalAccount

Unlocked Brownie account for Gnosis Safe.

confirmations_to_signatures(confirmations: List[Dict]) bytes

Convert confirmations as returned by the transaction service to combined signatures.

contract(address) Contract

Instantiate a Brownie Contract owned by Safe account.

estimate_gas(safe_tx: SafeTx) int

Estimate gas limit for successful execution.

execute_transaction(safe_tx: SafeTx, signer=None) TransactionReceipt

Execute a fully signed transaction likely retrieved from the pending_transactions method.

execute_transaction_with_frame(safe_tx: SafeTx, frame_rpc='http://127.0.0.1:1248') bytes

Execute a fully signed transaction with frame. Use this option with hardware wallets.

get_signer(signer: LocalAccount | str | None = None) LocalAccount
multisend_from_receipts(receipts: List[TransactionReceipt] | None = None, safe_nonce: int | None = None) SafeTx

Convert multiple Brownie transaction receipts (or history) to a multisend Safe transaction.

pending_nonce() int

Subsequent nonce which accounts for pending transactions in the transaction service.

property pending_transactions: List[SafeTx]

Retrieve pending transactions from the transaction service.

post_signature(safe_tx: SafeTx, signature: bytes)

Submit a confirmation signature to a transaction service.

post_transaction(safe_tx: SafeTx)

Submit a Safe transaction to a transaction service. Prompts for a signature if needed.

See also https://github.com/gnosis/safe-cli/blob/master/safe_cli/api/gnosis_transaction.py

preview(safe_tx: SafeTx, events=True, call_trace=False, reset=True, include_pending=False)

Dry run a Safe transaction in a forked network environment.

preview_pending(events=True, call_trace=False)

Dry run all pending transactions in a forked environment.

preview_tx(safe_tx: SafeTx, events=True, call_trace=False) TransactionReceipt
set_storage(account: str, slot: int, value: int)
sign_transaction(safe_tx: SafeTx, signer=None) SafeTx

Sign a Safe transaction with a private key account.

sign_with_frame(safe_tx: SafeTx, frame_rpc='http://127.0.0.1:1248') bytes

Sign a Safe transaction using Frame. Use this option with hardware wallets.

sign_with_trezor(safe_tx: SafeTx, derivation_path: str = "m/44'/60'/0'/0/0", use_passphrase: bool = False, force_eth_sign: bool = False) bytes

Sign a Safe transaction with a Trezor wallet.

Defaults to no passphrase (and skips passphrase prompt) by default. Uses on-device passphrase input if use_passphrase is truthy

Defaults to EIP-712 signatures on wallets & fw revisions that support it: - TT fw >v2.4.3 (clear signing only) - T1: not yet, and maybe only blind signing Otherwise (or if force_eth_sign is truthy), use eth_sign instead

tx_from_receipt(receipt: TransactionReceipt, operation: SafeOperation = SafeOperation.CALL, safe_nonce: int | None = None) SafeTx

Convert Brownie transaction receipt to a Safe transaction.

class brownie_safe.EthereumNetworkBackport(value)

Bases: Enum

An enumeration.

ARBITRUM_ONE = 42161
AURORA_MAINNET = 1313161554
AVALANCHE_C_CHAIN = 43114
BINANCE_SMART_CHAIN_MAINNET = 56
BOBA_NETWORK = 288
ENERGY_WEB_CHAIN = 246
ENERGY_WEB_VOLTA_TESTNET = 73799
FANTOM = 250
GNOSIS = 100
GOERLI = 5
MAINNET = 1
OPTIMISM = 10
POLYGON = 137
exception brownie_safe.ExecutionFailure

Bases: Exception

class brownie_safe.TransactionServiceBackport(network: EthereumNetwork, ethereum_client: EthereumClient | None = None, base_url: str | None = None)

Bases: TransactionServiceApi

URL_BY_NETWORK: Dict[EthereumNetwork, str] = {<EthereumNetworkBackport.ARBITRUM_ONE: 42161>: 'https://safe-transaction-arbitrum.safe.global', <EthereumNetworkBackport.AURORA_MAINNET: 1313161554>: 'https://safe-transaction-aurora.safe.global', <EthereumNetworkBackport.AVALANCHE_C_CHAIN: 43114>: 'https://safe-transaction-avalanche.safe.global', <EthereumNetworkBackport.BINANCE_SMART_CHAIN_MAINNET: 56>: 'https://safe-transaction-bsc.safe.global', <EthereumNetworkBackport.ENERGY_WEB_CHAIN: 246>: 'https://safe-transaction-ewc.safe.global', <EthereumNetworkBackport.GOERLI: 5>: 'https://safe-transaction-goerli.safe.global', <EthereumNetworkBackport.MAINNET: 1>: 'https://safe-transaction-mainnet.safe.global', <EthereumNetworkBackport.POLYGON: 137>: 'https://safe-transaction-polygon.safe.global', <EthereumNetworkBackport.OPTIMISM: 10>: 'https://safe-transaction-optimism.safe.global', <EthereumNetworkBackport.ENERGY_WEB_VOLTA_TESTNET: 73799>: 'https://safe-transaction-volta.safe.global', <EthereumNetworkBackport.GNOSIS: 100>: 'https://safe-transaction-gnosis-chain.safe.global', <EthereumNetworkBackport.FANTOM: 250>: 'https://safe-txservice.fantom.network', <EthereumNetworkBackport.BOBA_NETWORK: 288>: 'https://safe-transaction.mainnet.boba.network'}