Skip to main content
Version: v2.0_alpha

GitcoinPassportGatekeeper

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

passportDecoder

contract IGitcoinPassportDecoder passportDecoder

the gitcoin passport decoder instance

maci

address maci

the reference to the MACI contract

thresholdScore

uint256 thresholdScore

the threshold score to be considered human

FACTOR

uint256 FACTOR

to get the score we need to divide by this factor

registeredUsers

mapping(address => bool) registeredUsers

AlreadyRegistered

error AlreadyRegistered()

custom errors

OnlyMACI

error OnlyMACI()

ZeroAddress

error ZeroAddress()

ScoreTooLow

error ScoreTooLow()

constructor

constructor(address _passportDecoder, uint256 _thresholdScore) public payable

Deploy an instance of GitcoinPassportGatekeeper

Parameters

NameTypeDescription
_passportDecoderaddressThe GitcoinPassportDecoder contract
_thresholdScoreuint256The threshold score to be considered human

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) 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.
bytes