Safe{Core} contracts deployment
In this section, you will deploy the Safe{Core} contracts on your chain. All Safe contract deployments on any network follow the same procedure to ensure a deterministic address for all singleton contracts (proxy-factory, mastercopy, etc.) and verify the deployment.
Prerequisites
Open a pull request (opens in a new tab) to add your chain to chainlist.org (opens in a new tab).
Steps
Singleton factory contract deployment
You do not need to perform these tasks if your network is based on a rollup framework with Safe contracts already deployed (for example, OP Stack).
- Create a new issue in the safe-singleton-factory (opens in a new tab) repository.
- A bot will reply to the issue with the deployer address (opens in a new tab) and the amount of native token you need to send to this address.
- Once funded, mark the checkbox on the GitHub issue.
- The review of the issues happens every two weeks. Our team will perform the deterministic deployment of the
safe-singleton-factory
contract and publish a new npm release of @safe-global/safe-singleton-factory (opens in a new tab).
Singleton contracts deployment
You do not need to perform these tasks if your network is based on a rollup framework with Safe contracts already deployed (for example, OP Stack).
-
Clone the safe-smart-account (opens in a new tab) repository by running the following command:
_10git clone --branch v1.3.0-libs.0 https://github.com/safe-global/safe-smart-account.git_10cd safe-smart-account -
Get the latest version of @safe-global/safe-singleton-factory (opens in a new tab), by running the following command:
_10npm i --save-dev @safe-global/safe-singleton-factoryEnsure the latest version includes your safe-singleton-factory deployment from before.
-
Deploy Contracts.
Create a
.env
file in the root of the repository with the following content:_10MNEMONIC=funded_account_on_this_network_10INFURA_KEY=your_Infura_project_API_keyIf you deploy to a ZKsync chain, add the following line to the
.env
file:_10HARDHAT_ENABLE_ZKSYNC=1Deploy the contracts by running this command:
_10npm run deploy-all your_chain_id -
The script should deploy all the singleton contracts (nine contracts in total). Write down each address (example addresses for v1.3.0 could look like):
_10compatibility_fallback_handler: `0x017062a1dE2FE6b99BE3d9d37841FeD19F573804`_10create_call: `0xB19D6FFc2182150F8Eb585b79D4ABcd7C5640A9d`_10gnosis_safe: `0x69f4D1788e39c87893C980c06EdF4b7f686e2938`_10gnosis_safe_l2: `0xfb1bffC9d739B8D520DaF37dF666da4C687191EA`_10multi_send: `0x998739BFdAAdde7C933B942a68053933098f9EDa`_10multi_send_call_only: `0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B`_10proxy_factory: `0xC22834581EbC8527d974F8a1c97E1bEA4EF910BC`_10sign_message_lib: `0x98FFBBF51bb33A056B08ddf711f289936AafF717`_10simulate_tx_accessor: `0x727a77a074D1E6c4530e814F89E618a3298FC044`
Record your contracts in the official registry
You must share your singleton contract deployment addresses in the official public registry.
-
Fork the safe-deployments (opens in a new tab) GitHub repository.
-
Add your chain ID to each of the nine JSON files in
src/assets/<version>
. If you deployed with the singleton deployment from above, you have to mark your chain's deployment as "canonical". For example, add this line tognosis_safe.json
to indicate the gnosis safe has the canonical address on your chain:_10"<your_chain_id>": "canonical" -
Open a pull request. Your pull request should follow this example pull request (opens in a new tab).
Now, you have deployed the Safe{Core} contracts on your chain.
In the next step, you have to install the Safe{Core} Infrastructure.