This package contains a social recovery module compatible with the Safe smart account. It was developed by Candide Labs, and subsequently formally verified by Safe. For additional documentation, full source code, and formal verification specification, see the Candide Labs contracts repository.
The Safe team maintains a snapshot of the code that was evaluated at safe-fndn/candide-contracts.
Development of this module is done by the Candide Labs teams, and this package only re-exports the contracts and contains scripts to deterministically deploy. As such, please engage with the developers directly in the candidelabs/candide-contracts repository, as we do not accept external contributions to the contracts here.
pnpm installA collection of the different deployments and their addresses can be found in the Safe module deployments repository.
To add support for a new network follow the steps of the Deploy section and create a PR in the Safe module deployments repository.
⚠️ Make sure to use the correct commit when deploying the contracts. Any change (even comments) within the contract files will result in different addresses. The tagged versions used by the Safe team can be found in the releases.
This will deploy the contracts deterministically and verify the contracts on etherscan and sourcify.
Preparation:
- Set
MNEMONICin.env - Set
INFURA_KEYin.env
pnpm run deploy-all $NETWORKThis will perform the following steps
pnpm run build
npx hardhat --network $NETWORK deploy
npx hardhat --network $NETWORK local-verify
npx hardhat --network $NETWORK etherscan-verify
npx hardhat --network $NETWORK sourcifyThe project uses Solidity compiler version 0.8.20 with 1 million optimizer runs using the IR optimizer.
It is possible to use the NODE_URL env var to connect to any EVM-based network via an RPC endpoint. This connection can then be used with the custom network.
E.g. to deploy the Safe contract suite on that network, you would run:
pnpm run deploy-all customThe resulting addresses should be on all networks the same.
By default this module uses a recovery period of 14 days. However, instances of this modules with other recovery periods can be deployed:
DEPLOYMENT_RECOVERY_PERIOD=... pnpm run deploy-all $NETWORKNote: The address is expected to be different for modules deployed this way.
All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
All smart contracts are released under GPL-3.0.