-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add Safe CLI docs * fix: fix Vale errors * fix: updates from Uxios review * fix: fix Vale errors * Update pages/advanced/cli-installation.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-installation.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-overview.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-overview.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-installation.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-installation.mdx Co-authored-by: louis-md <[email protected]> * feat: improvements to the docs structure * Update pages/advanced/cli-reference/common-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/overview.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/tx-service-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/tx-service-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/tx-service-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/common-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-guides/recovery-safe-deployment.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/common-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/common-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/common-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/common-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/common-operations.mdx Co-authored-by: Germán Martínez <[email protected]> * Update pages/advanced/cli-reference/overview.mdx Co-authored-by: Germán Martínez <[email protected]> * fix: add suggestions from German --------- Co-authored-by: Tanay Pant <tanaypantprotonmail.com> Co-authored-by: Germán Martínez <[email protected]> Co-authored-by: louis-md <[email protected]>
- Loading branch information
1 parent
b84510a
commit 55933ed
Showing
15 changed files
with
509 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Demos | ||
|
||
## Create a new Safe | ||
|
||
The `PRIVATE_KEY` environment variable for this demo was set to an EOA private key. | ||
|
||
[](https://asciinema.org/a/0jdHGLVRrkS9URxPoZ8ZJ7W2C) | ||
|
||
## Send ether using a Trezor hardware wallet | ||
|
||
[](https://asciinema.org/a/9BrQKYQRXbysmEL8rw1jDWZhn) | ||
|
||
## Create a transaction in the Safe Transaction Service to remove an owner | ||
|
||
[](https://asciinema.org/a/oV5UbXW2g1VZo2yKDQIxi0jYb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"recovery-safe-deployment": "Deploy a Recovery Safe" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Callout } from 'nextra/components' | ||
|
||
# Deploy a Recovery Safe | ||
|
||
This guide will walk you through recreating a Safe with the same address on the desired network if you send funds to your Safe address in an incorrect chain. | ||
|
||
<Callout type='info' emoji='ℹ️'> | ||
It's not always possible to recover a Safe, learn more [here](https://help.safe.global/en/articles/40812-i-sent-assets-to-a-safe-address-on-the-wrong-network-any-chance-to-recover). | ||
</Callout> | ||
|
||
## Recreate Safe 1.3.0 or 1.1.1 | ||
|
||
To recreate a Safe (version 1.3.0 or 1.1.1), you'll need the following essential data: | ||
|
||
- The `Singleton` address | ||
- The `ProxyFactory` address | ||
- The `FallbackHandler` address | ||
- The `Owners` addresses with which Safe was created | ||
- The `SaltNonce` value | ||
- The `Threshold` value | ||
- RPC node provider for the target chain. | ||
- The private-key of the deployer address | ||
|
||
The necessary addresses can be collected from [safe-deployments](https://github.com/safe-global/safe-deployments/tree/main/src/assets) and the salt nonce from the Safe creation transaction in a block explorer. | ||
|
||
<Callout type="warning" emoji="⚠️"> | ||
Ensure that the `Singleton`, `ProxyFactory`, and `FallbackHandler` are deployed in the target chain in the same addresses as the origin chain. | ||
</Callout> | ||
|
||
To recreate the Safe, it is necessary to execute the `safe-creator` as follows: | ||
|
||
```bash | ||
safe-creator --owners <owners-addresses> --safe-contract <singleton-address> | ||
--callback-handler <fallback-handler-address> --proxy-factory <proxy-factory-address> | ||
--threshold <threshold-value> --salt-nonce <salt-nonce-value> <url-rpc-node> <deployer-private-key> | ||
``` | ||
|
||
The Safe should have been successfully recreated with the same address on the target chain. If not, double-check the data collected from the transaction and ensure that all the necessary contracts are deployed in the chain. | ||
|
||
## Migrate a Safe from non-L2 to L2 | ||
|
||
Our services cannot index if you've recreated a Safe from an L1 network (like mainnet) on an L2 network. That's because for L1, we use trace-based indexing, and for L2 events indexing, L1 Safe singleton does not emit events. | ||
|
||
To address this, you'll need to update it to the L2 singleton with the command `update_to_l2` or consider transferring the funds to a new Safe on L2 that you control with the `drain` command. | ||
For detailed instructions on running these commands, please refer to the [common operations](../cli-reference/common-operations) section for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Get the Safe CLI | ||
|
||
The Safe CLI can be run using [Docker](https://www.docker.com) or [pip](https://pip.pypa.io/en/stable). | ||
|
||
## Using Docker | ||
|
||
**Prerequisite:** Install [Docker Desktop](https://www.docker.com/products/docker-desktop/). | ||
|
||
Once Docker is installed on your system, run the following command to create new Safe accounts: | ||
|
||
```bash | ||
docker run -it safeglobal/safe-cli safe-creator | ||
``` | ||
|
||
You can also run the following command to run the Safe CLI with an existing Safe: | ||
```bash | ||
docker run -it safeglobal/safe-cli safe-cli <checksummed_safe_address> <ethereum_node_url> | ||
``` | ||
|
||
## Using Python pip | ||
|
||
**Prerequisite:** [Python](https://www.python.org/downloads/) >= 3.7 (Python 3.10 is recommended). | ||
|
||
Once Python is installed on your system, run the following command to install the Safe CLI: | ||
```bash | ||
pip3 install -U safe-cli | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Cards, Card } from 'nextra/components' | ||
import Installation from '../../assets/svg/command-line.svg' | ||
import Demo from '../../assets/svg/demo.svg' | ||
import Guides from '../../assets/svg/guides.svg' | ||
import Reference from '../../assets/svg/reference.svg' | ||
|
||
# Safe CLI | ||
|
||
Safe CLI is a command-line utility for [Safe Smart Account](./smart-account-overview.md). You can use it to manage your Safe account from the command line. | ||
|
||
It does not rely on Safe\{Core\} API and can also be used in networks where the Safe services are unavailable. | ||
|
||
<Cards> | ||
<Card icon={<Installation />} title="Installation" href="./cli-installation"/> | ||
<Card icon={<Demo />} title="Demos" href="./cli-demos" /> | ||
<Card icon={<Guides />} title="Guides" href="./cli-guides/recovery-safe-deployment" /> | ||
<Card icon={<Reference />} title="Reference" href="./cli-reference" /> | ||
</Cards> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Cards, Card } from 'nextra/components' | ||
import Guides from '../../assets/svg/guides.svg' | ||
import Reference from '../../assets/svg/reference.svg' | ||
|
||
# Reference | ||
|
||
The Safe CLI has two operation modes: | ||
|
||
- **blockchain**: The default mode. Use the `blockchain` command to enable it. Transactions are sent to the blockchain. | ||
- **tx-service**: Use the `tx-service` command to enable it. Transactions are sent to the Safe Transaction Service (if available on the network), and you can see them on Safe\{Wallet\}. At least one signer is needed to send transactions to the service. Transactions are not executed. It requires Safe\{Core\} API running on the network. | ||
|
||
<Cards> | ||
<Card icon={<Guides />} title="Common Operations" href="./cli-reference/common-operations" /> | ||
<Card icon={<Reference />} title="Transaction Service Operations" href="./cli-reference/tx-service-operations" /> | ||
</Cards> | ||
|
||
## Use custom contracts | ||
|
||
The Safe CLI comes with the official deterministic Safe Smart Account addresses deployed on multiple chains configured by default. You can edit the `safe_cli/safe_addresses.py` file if you want to use your own. | ||
|
||
Be careful when modifying these addresses, as the funds in a Safe can get stuck if an invalid address is used when updating to an invalid Safe Master Copy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"common-operations": "Common Operations", | ||
"tx-service-operations": "Transaction Service Operations" | ||
} |
Oops, something went wrong.