Skip to content

Commit 4e216dc

Browse files
bantegclaude
authored andcommitted
docs: create comprehensive modern documentation
- Create detailed documentation to replace outdated docs - Add new documentation structure with separate guides for each topic - Add CLI reference with all available commands - Add API reference with key classes and methods - Update README with links to new documentation - Fix examples to use correct Ape patterns and ape-tokens plugin 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3fca4b1 commit 4e216dc

9 files changed

Lines changed: 1437 additions & 39 deletions

File tree

README.md

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
# Quick Start
1+
# Ape Safe
22

3-
Account plugin for the [Safe](https://safe.global//) Multisig wallet (previously known as Gnosis Safe).
3+
Account plugin for the [Safe](https://safe.global/) multisig wallet (previously known as Gnosis Safe) for the [Ape Framework](https://github.com/ApeWorX/ape).
4+
5+
## Features
6+
7+
- **Safe Account Management**: Add, list, and remove Safe multisig wallets
8+
- **Transaction Management**: Create, propose, sign, and execute Safe transactions
9+
- **Multisig Workflows**: Manage transaction approval workflows with multiple signers
10+
- **MultiSend Support**: Batch multiple transactions together efficiently
11+
- **CLI Interface**: Comprehensive command line tools for Safe management
12+
- **Python API**: Programmatic access to all Safe functionality
413

514
## Dependencies
615

7-
- [python3](https://www.python.org/downloads) version 3.9 up to 3.12.
16+
- [python3](https://www.python.org/downloads) version 3.9 or newer
817

918
## Installation
1019

@@ -73,19 +82,22 @@ To specify via environment variable, do:
7382
APE_SAFE_DEFAULT_SAFE="my-safe"
7483
```
7584

76-
**NOTE**: Also, to avoid always needing to specify `--network`, you can set a default ecosystem, network, and provider in your config file.
77-
The rest of the guide with not specify `--network` on each command but assume the correct one is set in the config file.
85+
**NOTE**: To avoid always needing to specify `--network`, you can set a default ecosystem, network, and provider in your config file.
7886
Here is an example:
7987

8088
```yaml
81-
default_ecosystem: optimism
89+
default_ecosystem: ethereum
8290
8391
ethereum:
84-
default_network: sepolia
85-
sepolia:
92+
default_network: mainnet
93+
mainnet:
8694
default_provider: infura
8795
```
8896

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+
89101
Once you have a safe, you can view pending transactions:
90102

91103
```sh
@@ -104,46 +116,31 @@ Transaction 8 rejection (1/2) safe_tx_hash=0x09ab9a229fc60da66ec0fa8fa886ab7c959
104116
Transaction 8 transfer (1/2) safe_tx_hash=0xed43d80255bcd5ffacb755e8f51bee825913373705d6baea006419d2a33a0a5b
105117
```
106118

107-
**NOTE**: Use the `--verbose` flag to see more information about each transaction.
119+
Use the `--verbose` flag to see more information about each transaction:
108120

109121
```sh
110122
ape safe pending list --verbose
111123
```
112124

113-
There are several operations you can do on a pending transaction.
114-
One of them is "approve" which adds your local signers' signatures to the transaction.
125+
There are several operations you can do on a pending transaction:
115126

116127
```sh
128+
# Approve a transaction (add your signature)
117129
ape safe pending approve 0x09ab9a229fc60da66ec0fa8fa886ab7c95902fdf5df5a5009ba06010fbb9a9a7
118-
```
119130

120-
**NOTE**: Here we are using the transaction hash `0x09ab9a229fc60da66ec0fa8fa886ab7c95902fdf5df5a5009ba06010fbb9a9a7` to specify the transaction because there are more than one.
121-
However, you can also use the nonce if there is only a single transaction.
122-
123-
If you want to both execute and approve at the same time, you can use the `--execute` option on approve and specify a sender:
124-
125-
```sh
131+
# Approve and execute in one step
126132
ape safe pending approve 2 --execute my_account
127-
```
128-
129-
Else, you can use the `execute` command directly:
130133

131-
```sh
134+
# Execute a fully signed transaction
132135
ape safe pending execute 2
133-
```
134-
135-
**NOTE**: `execute` requires a full signed transaction ready to be submitted on-chain.
136136

137-
The last main operation is `reject`.
138-
Rejecting a transaction replaces that transaction with a zero-value transfer from the safe to itself.
139-
140-
```sh
137+
# Reject a transaction
141138
ape safe pending reject 2
142139
```
143140

144-
### Multisend
141+
## MultiSend Example
145142

146-
The following example shows how to use multisend:
143+
The following example shows how to use multisend to batch transactions:
147144

148145
```python
149146
from ape_safe import multisend
@@ -152,7 +149,7 @@ from ape_tokens import tokens
152149

153150
safe = accounts.load("my-safe")
154151

155-
# Load some contracts (here using ape-tokens)
152+
# Load some contracts using ape-tokens
156153
dai = tokens["DAI"]
157154
vault = tokens["yvDAI"]
158155
amount = dai.balanceOf(safe) # How much we want to deposit
@@ -162,14 +159,12 @@ txn = multisend.MultiSend()
162159
txn.add(dai.approve, vault, amount)
163160
txn.add(vault.deposit, amount)
164161

165-
# Fetch signatures from any local signers, and broadcast if confirmations are met
166-
# Note that in case the user intends to only stage a transaction, then `submit=False` argument can also be added
167-
# It is normal that when a user only intend to stage a transaction, an error is thrown
168-
# this can be ignored by including the necessary try-catch (from ape.exceptions import SignatureError)
169-
# Note that transaction is automatically prompted for execution if enough signers are available in local
170-
txn(sender=safe,gas=0)
162+
# Fetch signatures from local signers and broadcast if confirmations are met
163+
txn(sender=safe, gas=0)
171164
```
172165

166+
<<<<<<< HEAD
167+
173168
## Cloud Usage
174169

175170
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.
@@ -202,12 +197,27 @@ APE_SAFE_REQUIRE='{"my-safe":{"address":"0x1234...AbCd","deployed_chain_ids":[1,
202197
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.
203198
```
204199

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+
205215
## Development
206216

207217
Please see the [contributing guide](CONTRIBUTING.md) to learn more how to contribute to this project.
208218
Comments, questions, criticisms and pull requests are welcomed.
209219

210220
## Acknowledgements
211221

212-
This package was inspired by [the original ape-safe](https://github.com/banteg/ape-safe#readme) by [banteg](https://github.com/banteg).
222+
This package was inspired by the original ape-safe, now [brownie-safe](https://github.com/banteg/brownie-safe) by [banteg](https://github.com/banteg).
213223
For versions prior to v0.6.0, the original package should be referenced.

0 commit comments

Comments
 (0)