Skip to main content
Version: v2.0_alpha

EASGatekeeper

A gatekeeper contract which allows users to sign up to MACI only if they've received an attestation of a specific schema from a trusted attester

eas

contract IEAS eas

schema

bytes32 schema

attester

address attester

maci

address maci

the reference to the MACI contract

registeredAttestations

mapping(bytes32 => bool) registeredAttestations

AttestationRevoked

error AttestationRevoked()

custom errors

AlreadyRegistered

error AlreadyRegistered()

AttesterNotTrusted

error AttesterNotTrusted()

NotYourAttestation

error NotYourAttestation()

InvalidSchema

error InvalidSchema()

OnlyMACI

error OnlyMACI()

ZeroAddress

error ZeroAddress()

constructor

constructor(address _eas, address _attester, bytes32 _schema) public payable

Deploy an instance of EASGatekeeper

Parameters

NameTypeDescription
_easaddressThe EAS contract
_attesteraddressThe trusted attester
_schemabytes32The schema UID

setMaciInstance

function setMaciInstance(address _maci) public

Adds an uninitialised MACI instance to allow for token signups

Parameters

NameTypeDescription
_maciaddressThe MACI contract interface to be stored

register

function register(address _user, bytes _data) public

Register an user based on their attestation

Throw if the attestation is not valid or just complete silently

Parameters

NameTypeDescription
_useraddressThe user's Ethereum address.
_databytesThe ABI-encoded schemaId as a uint256.