diff --git a/.github/ISSUE_TEMPLATE/request_network.md b/.github/ISSUE_TEMPLATE/request_network.md index a09e5fbc..acd5007f 100644 --- a/.github/ISSUE_TEMPLATE/request_network.md +++ b/.github/ISSUE_TEMPLATE/request_network.md @@ -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` diff --git a/README.md b/README.md index 9964b349..58c5c449 100644 --- a/README.md +++ b/README.md @@ -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 [--gasPrice ] [--gasLimit ]` 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`