Skip to content

Commit

Permalink
docs: add link to gatekeeper page from contracts page
Browse files Browse the repository at this point in the history
  • Loading branch information
samajammin authored and ctrlc03 committed May 22, 2024
1 parent 69b987d commit f700da2
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,32 @@ abstract contract SignUpGatekeeper {
```

The MACI contract will need to call the `SignUpGatekeeper.register` function inside the `MACI.signUp` function.


# MACI Gatekeepers

MACI is composed of multiple smart contracts, which together with the zk-SNARK circuits, can be used to carry out on-chain voting. Start with an [overview of our smart contracts here](/docs/contracts).

MACI uses a "gatekeeper" contract, which is used to configure and enforce the eligibility criteria of voters who can participate in MACI polls. It is up to MACI's deployer how they wish configure signup eligibility and to protect agaisnt sybil attacks.

The MACI repository comes with several out-of-the-box options:

- `FreeForAllSignUpGatekeeper` - This allows anyone to sign up.
- `SignUpTokenGatekeeper` - This restricts signups only to holders of a specific ERC721 token.
- `EASGatekeeper` - This restricts signups only to users who have received an attestation of a specific schema from a trusted attester.

You can find all of our latest gatekeeper contracts here:
https://github.com/privacy-scaling-explorations/maci/tree/dev/contracts/contracts/gatekeepers

Developers are also welcome to implement a custom gatekeeper contracts as long as it conforms to the `SignUpGatekeeper` - an abstract contract to inherit from with two function signatures:

```ts
abstract contract SignUpGatekeeper {
function setMaciInstance(MACI _maci) public virtual {}
function register(address _user, bytes memory _data) public virtual {}
}
```

Whenever a user signs, up (via the `MACI.signUp` function), this triggers the MACI contract to call the `SignUpGatekeeper.register` function.

If you'd like to create a gatekeeper contract for your project, or if there's specific gatekeeper functionality you'd like to see MACI support, we'd be happy to help! Please [create a GitHub issue](https://github.com/privacy-scaling-explorations/maci/issues/new/choose).

0 comments on commit f700da2

Please sign in to comment.