Skip to content

Commit bca813d

Browse files
committed
docs(README): update readme to add more clear multisend docs
1 parent c40c2a7 commit bca813d

1 file changed

Lines changed: 43 additions & 61 deletions

File tree

README.md

Lines changed: 43 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,28 @@ $ python3 setup.py install
4545

4646
## Quick Usage
4747

48-
To use the plugin, first use the CLI extension to add a safe you created:
48+
To use the plugin, first use the Ape CLI extension to add a safe you want to control:
4949

5050
```sh
51-
ape safe add --network ethereum:mainnet "my-safe.eth" my-safe
51+
# ape safe add ADDRESS ALIAS
52+
ape safe add --network ethereum:mainnet my-safe.eth my-safe
5253
```
5354

5455
If you made a mistake or just need to remove the safe, use the `remove` command:
5556

5657
```sh
58+
# ape safe remove ALIAS
5759
ape safe remove my-safe --yes
5860
```
5961

60-
**NOTE** `--yes` is a way to skip the prompt.
62+
```{note}
63+
`--yes` is a way to skip the prompt.
64+
```
6165

62-
If you only add one safe, you will not have to specify which safe to use other commands.
66+
If you only have one safe, you will not have to specify which safe to use other commands.
6367
Otherwise, for most `pending` commands, you specify the safe to use (by alias) via the `--safe` option.
6468

65-
Additionally, you can configure a safe to use as the default in your `ape-config.yaml` file:
69+
Additionally, you can configure a safe to use as the default when no `--safe` argument is present by configuring the following in your `ape-config.yaml` file:
6670

6771
```yaml
6872
safe:
@@ -76,28 +80,17 @@ or via `pyproject.toml`:
7680
default_safe = "my-safe"
7781
```
7882

79-
To specify via environment variable, do:
83+
or specify via environment variable:
8084

8185
```sh
82-
APE_SAFE_DEFAULT_SAFE="my-safe"
86+
export APE_SAFE_DEFAULT_SAFE="my-safe"
8387
```
8488

85-
**NOTE**: To avoid always needing to specify `--network`, you can set a default ecosystem, network, and provider in your config file.
86-
Here is an example:
87-
88-
```yaml
89-
default_ecosystem: ethereum
90-
91-
ethereum:
92-
default_network: mainnet
93-
mainnet:
94-
default_provider: infura
89+
```{note}
90+
To avoid always needing to specify `--network`, you can set a default ecosystem, network, and provider in your config file.
91+
The rest of the guide will not specify `--network` on each command but assume it matches the network your Safe is on.
9592
```
9693

97-
The rest of the guide will not specify `--network` on each command but assume the correct one is set in the config file.
98-
99-
---
100-
10194
Once you have a safe, you can view pending transactions:
10295

10396
```sh
@@ -106,14 +99,14 @@ ape safe pending list
10699

107100
```{note}
108101
You must specify the environment variable `APE_SAFE_GATEWAY_API_KEY=` to use the Safe Gateway API.
109-
Get an API key at https://developer.safe.global/.
102+
Get an API key at the [Safe Developer Portal](https://developer.safe.global).
110103
```
111104

112105
It should show transactions like this:
113106

114107
```sh
115-
Transaction 8 rejection (1/2) safe_tx_hash=0x09ab9a229fc60da66ec0fa8fa886ab7c95902fdf5df5a5009ba06010fbb9a9a7
116-
Transaction 8 transfer (1/2) safe_tx_hash=0xed43d80255bcd5ffacb755e8f51bee825913373705d6baea006419d2a33a0a5b
108+
Transaction 8 rejection (1/2) safe_tx_hash=0x09ab...a9a7
109+
Transaction 8 transfer (1/2) safe_tx_hash=0xed43...0a5b
117110
```
118111

119112
Use the `--verbose` flag to see more information about each transaction:
@@ -125,47 +118,51 @@ ape safe pending list --verbose
125118
There are several operations you can do on a pending transaction:
126119

127120
```sh
128-
# Approve a transaction (add your signature)
129-
ape safe pending approve 0x09ab9a229fc60da66ec0fa8fa886ab7c95902fdf5df5a5009ba06010fbb9a9a7
121+
# Add more signatures using locally-configured Ape signer(s)
122+
# NOTE: can specify either SafeTxID or Nonce
123+
ape safe pending approve 0x09ab...a9a7
130124

131-
# Approve and execute in one step
132-
ape safe pending approve 2 --execute my_account
125+
# Add remaining signatures and execute transction w/ account alias `submitter`
126+
# NOTE: can specify either SafeTxID or Nonce
127+
ape safe pending approve 2 --execute submitter
133128

134-
# Execute a fully signed transaction
135-
ape safe pending execute 2
129+
# Execute an already-signed transaction using `submitter`
130+
ape safe pending execute 2 --account submitter
136131

137-
# Reject a transaction
132+
# Create an on-chain rejection for an existing transaction queue item
138133
ape safe pending reject 2
139134
```
140135

141-
## MultiSend Example
136+
### MultiSend Support
142137

143-
The following example shows how to use multisend to batch transactions:
138+
Ape Safe allows sending "batched transactions" using the `MultiSend` module:
144139

145140
```python
146-
from ape_safe import multisend
147141
from ape import accounts
142+
from ape_safe import multisend
148143
from ape_tokens import tokens
149144

145+
me = accounts.load("my-key")
150146
safe = accounts.load("my-safe")
151147

152148
# Load some contracts using ape-tokens
153149
dai = tokens["DAI"]
154150
vault = tokens["yvDAI"]
155151
amount = dai.balanceOf(safe) # How much we want to deposit
156152

157-
# Create a multisend transaction (a transaction that executes multiple calls)
158-
txn = multisend.MultiSend()
159-
txn.add(dai.approve, vault, amount)
160-
txn.add(vault.deposit, amount)
153+
# Create a multisend batch transaction
154+
batch = safe.create_batch()
155+
batch.add(dai.approve, vault, amount)
156+
batch.add(vault.deposit, amount)
161157

162-
# Fetch signatures from local signers and broadcast if confirmations are met
163-
txn(sender=safe, gas=0)
158+
# Fetch signatures from local signer(s)
159+
# NOTE: will broadcast unless `submit=False`
160+
batch(submitter=me)
161+
# OR add to the Safe Gateway for later execution
162+
batch.propose()
164163
```
165164

166-
<<<<<<< HEAD
167-
168-
## Cloud Usage
165+
### Cloud Environment
169166

170167
To use this plugin in a cloud environment, such as with the [Silverback Platform](https://silverback.apeworx.io), you will need to make sure that you have configured your Safe to exist within the environment.
171168
The easiest way to do this is to use the `require` configuration item.
@@ -176,15 +173,15 @@ safe:
176173
require:
177174
my-safe:
178175
address: "0x1234...AbCd"
179-
deployed_chain_ids: [1, ...]
176+
deployed_chain_ids: [1, 10] # Add all deployed chains here
180177
```
181178
182179
or in `pyproject.toml`:
183180

184181
```toml
185182
[tool.ape.safe.require."my-safe"]
186183
address = "0x1234...AbCd"
187-
deployed_chain_ids = [1, ...]
184+
deployed_chain_ids = [1, 10] # Add all deployed chains here
188185
```
189186

190187
To specify via environment variable, do:
@@ -193,25 +190,10 @@ To specify via environment variable, do:
193190
APE_SAFE_REQUIRE='{"my-safe":{"address":"0x1234...AbCd","deployed_chain_ids":[1,...]}}'
194191
```
195192

196-
```{notice}
193+
```{note}
197194
If a safe with the same alias as an entry in `require` exists in your local environment, this will skip adding it, even if the existing alias points to a different address than the one in the config item.
198195
```
199196

200-
=======
201-
202-
## Documentation
203-
204-
For more detailed documentation, see:
205-
206-
- [Setup](./docs/setup.md) - Configuration and initial setup
207-
- [Basic Usage](./docs/basic_usage.md) - Essential operations
208-
- [Safe Management](./docs/safe_management.md) - Adding, listing and removing Safes
209-
- [Transaction Workflows](./docs/transactions.md) - Understanding the transaction lifecycle
210-
- [MultiSend](./docs/multisend.md) - Batching transactions
211-
- [CLI Reference](./docs/cli.md) - Command line interface documentation
212-
- [API Reference](./docs/api.md) - Python API documentation
213-
> > > > > > > 1a59826 (docs: create comprehensive modern documentation)
214-
215197
## Development
216198

217199
Please see the [contributing guide](CONTRIBUTING.md) to learn more how to contribute to this project.

0 commit comments

Comments
 (0)