Skip to content

Commit

Permalink
Refactor README (#235)
Browse files Browse the repository at this point in the history
* Refactor README

- Split user documentation and Safe devs documentation, as that could be misleading
- Add information about the new process (sending funds to the deployer)
- Fix typo on Github issue template

---------

Co-authored-by: Mikhail <[email protected]>
  • Loading branch information
Uxio0 and mmv08 authored Oct 9, 2023
1 parent 0cb9114 commit c7a6e70
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/request_network.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
name: Request new network
about: Request to add the deployment information for a new network

---

## Network information

- Name:
- ChainId:
- RPC http/s address:
- Link to https://chainlist.org/
- Link to https://chainlist.org/
- (Optional) Blockexplorer:
- [] I have run `RPC='http://my-rpc-address' yarn estimate`
- [] I have sent `requiredFunds` to `0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37`
- [ ] I have run `RPC='http://my-rpc-address' yarn estimate`
- [ ] I have sent `requiredFunds` to `0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37`
47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,48 @@ Singleton factory used by Safe related contracts based on https://github.com/Ara

The original library used a presigned transaction without a chain id to allow deployment on different chains. Some chains do not allow such transactions to be submitted (e.g. Celo and Avalanche) therefore this repository will provide the same factory that can be deployed via a presigned transaction that includes the chain id. The key that is used to sign is controlled by the Safe team.

# Adding new networks
# User documentation

To add support for new networks the same key used for the existing networks should be used to generate a presigned transaction for a new network. To request support for a new network please open a [new issue](https://github.com/safe-global/safe-singleton-factory/issues/new/choose).
## How to get the singleton deployed to your network

As the singleton is deployed with an EIP155 transaction, we need to sign the deployment transaction for your network. But some prerequisites must be met before that, and the most important one is having funds on the deployer so we can deploy the contract.

- Make sure your network is on https://chainlist.org/ . We will not accept networks not present there.
- Install dependencies running `yarn`.
- Estimate the contract deployment: `RPC='http://my-rpc-address' yarn estimate`.
- Send `requiredFunds` to the deployer address `0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37`.
- Open a PR and we will deploy the singleton contract.

## Expected Addresses

For all networks the same deployer key is used. The address for this key is `0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37`.

This results in the address for the factory to be `0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7` for all bytecode compatible EVM networks.

For zkSync based networks the same deployer is used and expected factory address is `0xaECDbB0a3B1C6D1Fe1755866e330D82eC81fD4FD`.

Note: For zkSync the factory is deployed using the `create2` method of the system deployer using the zero hash (`0x0000000000000000000000000000000000000000000000000000000000000000`).

# Safe developers documentation

## Adding new networks

To generate the deployment data for a new network the following steps are necessary:

- Set `RPC` in the `.env` file for the new network
- Set `RPC` in the `.env` file for the new network.
- Set `MNEMONIC` in the `.env` file.
- Estimate transaction params via `yarn estimate`

- Set `MNEMONIC` in the `.env` file
- Run `yarn compile <chain_id> [--gasPrice <overwrite_gas_price>] [--gasLimit <overwrite_gas_limit>]`

To do `estimate` and `compile` steps together:

- Run `yarn estimate-compile ["$RPC"]`

# For zkSync

- Set `MNEMONIC` or `PK` in the `.env` file
- Run `yarn compile:zk`

# Expected Addresses

For all networks the same deployer key is used. The address for this key is `0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37`.
To submit a transaction after the deployment data is created:

This results in the address for the factory to be `0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7` for all bytecode compatible EVM networks.
- Run `yarn submit`

For zkSync based networks the same deployer is used and expected factory address is `0xaECDbB0a3B1C6D1Fe1755866e330D82eC81fD4FD`.
## For zkSync

Note: For zkSync the factory is deployed using the `create2` method of the system deployer using the zero hash (`0x0000000000000000000000000000000000000000000000000000000000000000`).
- Set `MNEMONIC` or `PK` in the `.env` file
- Run `yarn compile:zk`

0 comments on commit c7a6e70

Please sign in to comment.