{"id":13398278,"url":"https://github.com/candidelabs/candide-contracts","last_synced_at":"2025-12-25T04:57:01.575Z","repository":{"id":59311303,"uuid":"535849486","full_name":"candidelabs/candide-contracts","owner":"candidelabs","description":"Smart contracts used by Candide","archived":false,"fork":false,"pushed_at":"2024-07-08T17:28:13.000Z","size":1924,"stargazers_count":73,"open_issues_count":0,"forks_count":21,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-08-04T13:01:24.075Z","etag":null,"topics":["bls","eip-4337","paymaster","social-recovery"],"latest_commit_sha":null,"homepage":"https://candide.dev","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/candidelabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit/ackee-blockchain-candide-social-recovery-report.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-12T21:02:09.000Z","updated_at":"2024-08-04T13:01:24.076Z","dependencies_parsed_at":"2024-07-08T22:14:07.498Z","dependency_job_id":"c174987b-99aa-423a-9983-b0738dd25872","html_url":"https://github.com/candidelabs/candide-contracts","commit_stats":null,"previous_names":["candidelabs/candide-contracts","candidelabs/candidewalletcontracts"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candidelabs%2Fcandide-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candidelabs%2Fcandide-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candidelabs%2Fcandide-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candidelabs%2Fcandide-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/candidelabs","download_url":"https://codeload.github.com/candidelabs/candide-contracts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243511659,"owners_count":20302594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bls","eip-4337","paymaster","social-recovery"],"created_at":"2024-07-30T19:00:21.668Z","updated_at":"2025-12-25T04:57:01.568Z","avatar_url":"https://github.com/candidelabs.png","language":"Solidity","funding_links":[],"categories":["Open Source wallets"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eCandide Contracts\u003c/h1\u003e\n\u003c/div\u003e\n\n![atelier-meta-web](https://github.com/candidelabs/.github/assets/7014833/5090c8d1-31ad-4daf-9efd-adae4c350c35)\n\n# About\n\nCandide Wallet is a smart contract wallet for Ethereum Mainnet and EVM compatible rollups.\u003cbr/\u003e\nThis repo includes the smart contracts used by Candide Labs.\n\n# Features\n\n- \u003ca href=\"https://eips.ethereum.org/EIPS/eip-4337\"\u003eEIP-4337: Account Abstraction via Entry Point Contract\u003c/a\u003e\n- Account Recovery\n- Pay gas with ERC-20 using a Paymaster\n\n# Account Recovery\n\n_In this section, we highlight and explain the [SocialRecoveryModule.sol](./contracts/modules/social_recovery/SocialRecoveryModule.sol) contract._\n\nThe Account Recovery module is designed to work for both a single-owner account and an n-m multi-sig account. In the case of the single-owner account, the signer key is typically stored on the user's device. More specifically, owners can add recovery addresses (also known as Guardians) to change the ownership of the account, in case their signer key is lost or compromised.\n\nRecovery methods are typical Ethereum accounts. They can be:\n\n- Family \u0026 Friends' contacts\n- Hardware wallets\n- Institutions\n- Custodial services that offer cloud-based wallets\n\nNormal operations of the Account do not require the approval of added Guardians in the module.\n\nOwners of the account decide the threshold for the number of guardians needed for recovery, as well as the number of guardians. A typical single-owner account can have 3 guardians with a threshold of 2. This decreases the likelihood that a single guardian can overtake the account.\n\nOwners are encouraged to ask their guardians to provide fresh addresses. This makes them private and eliminates the possibility of malicious guardians cooperating against an owner. By design, a guardian does not need to necessarily store value in their account to maintain their duties, even during a recovery process.\n\nOnce the recovery is initiated, the owners have until the `delayPeriod` to cancel the recovery, if the initiation was done with malicious intent. Once the `delayPeriod` is over, anyone can finalize the recovery to update the ownership of that particular Safe Wallet.\n\nAccount Recovery interfaces can be built with or without a backend service:\n\n- An interface without a backend service can simply let each guardian submit their signatures separately. Once the threshold is met, anyone can call execute recovery to start the recovery period.\n\n- An interface that leverages a backend service can aggregate guardians' signatures so that only the last guardian executes the transaction and pay gas fees. This is similar to how Safe's interface works when multiple owners for a multi-sig sign transactions before submitting them.\n\n## High-Level specs of methods\n\nWe assume that the signer key belongs to its real owner. The probability of the signer key being in control of someone else should be close to zero. Under this model, we can build a simple yet highly secure non-custodial wallet. To enable that model to evolve if needed, upgrading the wallet to a new implementation requires the approval of only the owner of the account.\n\n| Method                        | Owner | Guardians | Anyone | Comment                                                                                                           |\n| ----------------------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------------------------------------- |\n| `addGuardianWithThreshold`    | X     |           |        | Owner can add a guardian with a new threshold                                                                     |\n| `revokeGuardianWithThreshold` | X     |           |        | Owner can remove a guardian from its list of guardians                                                            |\n| `confirmRecovery`             |       | X         |        | Lets a single guardian approve the execution of the recovery request                                              |\n| `multiConfirmRecovery`        |       | X         |        | Lets multiple guardians approve the execution of the recovery request                                             |\n| `cancelRecovery`              | X     |           |        | Lets an owner cancel an ongoing recovery request                                                                  |\n| `finalizeRecovery`            |       |           | X      | Finalizes an ongoing recovery request if the recovery period is over. The method is public and callable by anyone |\n\n## Audit\n\n- [For version 0.0.1 by Ackee Blockchain](./audit/ackee-blockchain-candide-social-recovery-report.pdf)\n\n# Development\n\n### Install dependencies\n\n```\nyarn install\n```\n\n### Add required .env variables\n\n```\ncp .env.example .env\n```\n\n## Run tests\n\n```\nyarn build\nyarn test\n```\n\n## Run FV\n\n```\ncertoraRun certora/conf/SocialRecoveryModule.conf\ncertoraRun certora/conf/GuardianStorage.conf\ncertoraRun certora/conf/RecoveryConfirmationSignatureValidity.conf\n```\n\nNote: You will need to install Certora CLI and a valid Certora Key for running FV. To provide a custom `solc` path, use `--solc` flag.\n\n\u003c!-- LICENSE --\u003e\n\n## License\n\nGNU General Public License v3.0\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n\n## Acknowledgments\n\n- \u003ca href='https://github.com/eth-infinitism/account-abstraction'\u003eeth-infinitism/account-abstraction\u003c/a\u003e\n- \u003ca href='https://github.com/safe-global/safe-contracts'\u003eGnosis Safe Contracts\u003c/a\u003e\n- \u003ca href='https://eips.ethereum.org/EIPS/eip-4337'\u003eEIP-4337: Account Abstraction via Entry Point Contract specification \u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandidelabs%2Fcandide-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcandidelabs%2Fcandide-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandidelabs%2Fcandide-contracts/lists"}