Skip to content

API docs

BrownieSafe creates a Safe instance for the contract version at the given address. The returned instance exposes the methods and properties documented under BrownieSafeBase.

The default backend uses the hosted Safe Queue Service for proposals, confirmations, and pending transactions. safe.transaction_service is the separate client for indexed on-chain history. Supply base_url to use a custom Safe Transaction Service for queue operations, and pass auth_token explicitly if it requires authentication. For the hosted queue, auth_token takes precedence over SAFE_AUTH_TOKEN and its legacy alias SAFE_TRANSACTION_SERVICE_API_KEY.

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

Create a BrownieSafe from an address or ENS name.

Use the hosted Safe Queue Service by default. Pass base_url to use a custom Safe Transaction Service for off-chain operations. Pass auth_token explicitly to authenticate to a custom service.

brownie_safe.BrownieSafeBase

account property

Brownie account for the Safe, impersonated on a development fork.

client cached property

contract = ContractWrapper(self.account, self.contract) instance-attribute

pending_transactions property

Retrieve pending transactions from the hosted Queue Service or custom service.

transaction_service cached property

Client for the Transaction Service, including its indexed history.

__init__(address, ethereum_client)

__repr__()

__str__()

confirmations_to_signatures(confirmations)

Convert service confirmations to combined signatures.

estimate_gas(safe_tx)

Estimate gas limit for successful execution.

execute_transaction(safe_tx, signer=None)

Execute a fully signed transaction on the connected Brownie network.

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

Switch Frame to the connected chain ID and submit a fully signed transaction.

get_signer(signer=None)

multisend_from_receipts(receipts=None, safe_nonce=None)

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

pending_nonce()

Subsequent nonce which accounts for the on-chain nonce and pending transactions.

post_signature(safe_tx, signature)

Submit a confirmation to the hosted Queue Service or configured custom service.

post_transaction(safe_tx)

Submit a proposal to the hosted Queue Service or configured custom service. Prompts for a signature if needed.

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

Dry run a Safe transaction on a fork, funding the impersonated sender if needed.

preview_pending(events=True, call_trace=False)

Dry run all pending transactions in a forked environment.

preview_tx(safe_tx, events=True, call_trace=False)

set_storage(account, slot, value)

sign_transaction(safe_tx, signer=None)

Sign with a local Brownie account and return the signature bytes.

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

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

sign_with_trezor(safe_tx, derivation_path="m/44'/60'/0'/0/0", use_passphrase=False, force_eth_sign=False)

Sign a Safe transaction with a Trezor wallet.

Request a passphrase when use_passphrase is true. Prefer on-device entry when the device supports it.

Use EIP-712 on Model T firmware 2.4.3 or later. Other devices or force_eth_sign=True use the eth_sign path.

tx_from_receipt(receipt, operation=SafeOperationEnum.CALL, safe_nonce=None)

Convert Brownie transaction receipt to a Safe transaction.

brownie_safe.ApiError

Bases: Exception

brownie_safe.ExecutionFailure

Bases: Exception