TokenGateKeeper
Restricts participation to a crowdfund based on whether an address has a minimum balance of a token (ERC20 or ERC721).
Code
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
| Name | Type | Description | 
|---|---|---|
| participant | address | The address of the participant. | 
| id | bytes12 | The ID of the gate to eligibility against. | 
| bytes | 
Returns
| Name | Type | Description | 
|---|---|---|
| bool | true 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
| Name | Type | Description | 
|---|---|---|
| token | Token | The token address (e.g. ERC20 or ERC721). | 
| minimumBalance | uint256 | The minimum balance allowed for participation. | 
Returns
| Name | Type | Description | 
|---|---|---|
| id | bytes12 | The ID of the new gate. |