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 2 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
13 changes: 10 additions & 3 deletions ape_safe/multisend.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,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 @@ -101,9 +102,15 @@ class MultiSend(ManagerAccessMixin):
... # Add as many calls as desired to execute
txn.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 that in case the user intends to only stage a transaction, then `submit=False` argument can also be added
# It is normal that when a user only intends to stage a transaction, an error is thrown
# this can be ignored by including the necessary try-catch (from ape.exceptions import SignatureError)
# Note that transaction is automatically prompted for execution if enough signers are available in local
fubuloubu marked this conversation as resolved.
Show resolved Hide resolved
try:
receipt = txn(sender=safe,gas=0)
except SignatureError:
pass
"""

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