var img = document.createElement('img'); img.src = "https://nethermind.matomo.cloud//piwik.php?idsite=6&rec=1&url=https://www.surge.wtf" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

Safe Contracts and Infrastructure

Safe is a multisig wallet infrastructure that provides secure, timelocked governance for Surge's protocol upgrades, ensuring Stage 2 security compliance with a 45-day delay for any changes while maintaining decentralization.

To see how more details on Safe, refer to the Safe Infrastructure documentation.

Safe Contracts Deployment

tip

You can skip this if you are using Surge default setup and you don't need to customize the chain id.

note

Adding custom chain id to Safe deployments is still a work in progress.

Safe Infrastructure Deployment

1. Clone Repository

Clone the Safe Infrastructure repository and navigate into the directory:

git clone https://github.com/NethermindEth/safe-infrastructure.git
cd safe-infrastructure

2. Configure Environment

Create your environment configuration file (.env) by copying the provided sample:

cp .env.sample .env

Make sure to update the RPC_NODE_URL to your RPC endpoint, and set the NEXT_PUBLIC_DEFAULT_MAINNET_CHAIN_ID to your chain id.

tip

If you need Wallet Connect feature, you also need to set the NEXT_PUBLIC_WC_PROJECT_ID.

3. Run Safe Infrastructure Setup Script

./scripts/run_locally.sh

The script will prompt you for setting up Django admin credentials, please follow the prompts to set up the credentials.

4. Add ChainInfo

Access http://localhost:8000/cfg/admin/chains/chain/add/ and add the following information:

And save the chain info.

5. Configure Transaction Service

By default, tx service will auto setup MasterCopies and Proxy Factories for Surge. Or you can add the addresses manually in http://localhost:8000/txs/admin/:

6. Configure Wallet Connect feature

Access http://localhost:8000/cfg/admin/chains/feature/add, select your chain and add the following information:

  • Key: NATIVE_WALLETCONNECT
  • Description: Wallet Connect feature
note

Double confirm if you have set the NEXT_PUBLIC_WC_PROJECT_ID in the .env file, and make sure the feature is enabled in the chain info.

Verification

After http://localhost:8000/ is accessible, ensure everything is running correctly by: