Skip to content

Commit

Permalink
Add Safe recovery documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 committed Oct 27, 2023
1 parent 09e8507 commit f5ac7cd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,34 @@ configured by default. If you want to use your own you can edit the file `safe_c
Be careful when modifying these addresses, the funds in a Safe can get stuck if an invalid address it's used when updating
to an invalid Safe Master Copy.

## **Recovery Safe**: deploy a Safe in other network and drain funds
If you sent funds to Safe address without Safe deployed there, this section explains how to recreate a Safe in other network and drain funds to other address that you own.
### Recreate Safe 1.3.0
To recreate a Safe 1.3.0, you will need the following data from creation transaction:
- The `Singleton` address
- The `ProxyFactory` address
- The `FallbackHandler` address
- The `Owners` addresses with which Safe was created
- The `SaltNonce` value
- The `threeshold` value
- A RPC node provider for the chain where you want to deploy the new Safe
- The private-key of deployer address
Ensure that the `Singleton`, `ProxyFactory`, and `FallbackHandler` are deployed in the target chain.
At this point execute:
```commandline
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>
```
At this point the Safe should be recreated correctly with the same address on the target chain, if not, recheck the collected data from transaction and if all the needed contracts are deployed in the chain.

### Drain the funds
After recreate the Safe we can use the drain command of safe-cli to move everything to a new address of your own.
The process is explained in the following steps:
- run `safe-cli <Safe-recovered-address> <url-rpc-target-chain>`
- in the safe-cli, load as many owners as Safe threeshold with `load_cli_owners` command
- run `drain` command with the target address to send everything to other address

## Safe contracts
- [Safe contracts](https://github.com/safe-global/safe-contracts)
- [Safe contracts deployment info and addreses](https://github.com/safe-global/safe-deployments/tree/main/src/assets)
Expand Down

0 comments on commit f5ac7cd

Please sign in to comment.