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
Name | Type | Description |
---|---|---|
_passportDecoder | address | The GitcoinPassportDecoder contract |
_thresholdScore | uint256 | The threshold score to be considered human |
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) public
Register an user based on their attestation
Throw if the attestation is not valid or just complete silently
Parameters
Name | Type | Description |
---|---|---|
_user | address | The user's Ethereum address. |
bytes |