Skip to main content
Version: v2.0_alpha

ZupassGatekeeper

This contract allows to gatekeep MACI signups by requiring new voters to own a certain Zupass event ticket

validEventId

uint256 validEventId

the Zupass event UUID converted to bigint

validSigner1

uint256 validSigner1

the Zupass event signer converted to bigint

validSigner2

uint256 validSigner2

verifier

contract ZupassGroth16Verifier verifier

the ZupassGroth16Verifier contract address

maci

address maci

the reference to the MACI contract

registeredTickets

mapping(uint256 => bool) registeredTickets

a mapping of ticket IDs to whether they have been used

AlreadyRegistered

error AlreadyRegistered()

custom errors

InvalidProof

error InvalidProof()

InvalidEventId

error InvalidEventId()

InvalidSigners

error InvalidSigners()

InvalidWatermark

error InvalidWatermark()

OnlyMACI

error OnlyMACI()

ZeroAddress

error ZeroAddress()

constructor

constructor(uint256 _validEventId, uint256 _validSigner1, uint256 _validSigner2, address _verifier) public payable

Creates a new ZupassGatekeeper

Parameters

NameTypeDescription
_validEventIduint256Zupass event UUID converted to bigint
_validSigner1uint256Zupass event signer[0] converted to bigint
_validSigner2uint256Zupass event signer[1] converted to bigint
_verifieraddressThe ZupassGroth16Verifier contract address

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

Registers the user only if they have the Zupass event ticket

Parameters

NameTypeDescription
_useraddressThe user's Ethereum address.
_databytesThe ABI-encoded proof and public signals.