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
Name | Type | Description |
---|---|---|
_validEventId | uint256 | Zupass event UUID converted to bigint |
_validSigner1 | uint256 | Zupass event signer[0] converted to bigint |
_validSigner2 | uint256 | Zupass event signer[1] converted to bigint |
_verifier | address | The ZupassGroth16Verifier contract address |
setMaciInstance
function setMaciInstance(address _maci) public
Adds an uninitialised MACI instance to allow for token signups
Parameters
Name | Type | Description |
---|---|---|
_maci | address | The 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
Name | Type | Description |
---|---|---|
_user | address | The user's Ethereum address. |
_data | bytes | The ABI-encoded proof and public signals. |