Skip to main content

TokenGateKeeper

Restricts participation to a crowdfund based on whether an address has a minimum balance of a token (ERC20 or ERC721).

Code

TokenGateKeeper.sol

Functions

isAllowed

Check if a participant is eligible to participate in a crowdfund.

function isAllowed(address participant, bytes12 id, bytes memory) external view returns (bool);

Parameters

NameTypeDescription
participantaddressThe address of the participant.
idbytes12The ID of the gate to eligibility against.
bytes

Returns

NameTypeDescription
booltrue if the participant is allowed to participate, false otherwise.

createGate

Creates a gate that requires a minimum balance of a token.

function createGate(Token token, uint256 minimumBalance) external returns (bytes12 id);

Parameters

NameTypeDescription
tokenTokenThe token address (e.g. ERC20 or ERC721).
minimumBalanceuint256The minimum balance allowed for participation.

Returns

NameTypeDescription
idbytes12The ID of the new gate.