Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update comments in Multisend example #33

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ape_safe/multisend.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MultiSend(ManagerAccessMixin):

from ape_safe import multisend
from ape import accounts
from ape.exceptions import SignatureError

# load the safe
safe = accounts.load("my-safe")
Expand All @@ -46,9 +47,16 @@ class MultiSend(ManagerAccessMixin):
... # Add as many calls as desired to execute
.add(contract.myMethod, *call_args)

# Stage the transaction to publish on-chain
# NOTE: if not enough signers are available, publish to Safe API instead
receipt = txn(sender=safe,gas=0)
# Fetch signatures from any local signers, and broadcast if confirmations are met.
# NOTE: in case the user intends to only stage a transaction then `submit_transaction=False`
# argument can also be added. It is normal that when you only intend to stage a
# transaction that an error is thrown, and this behavior can be skipped by using try-
# catch when trying to submit the transaction (`ape.exceptions.SignatureError`).
# NOTE: SafeTx is automatically prompted for execution if there are enough local signers.
try:
receipt = txn(sender=safe,gas=0)
except SignatureError:
pass
"""

def __init__(self) -> None:
Expand Down
Loading