Example Module
NFTXEligibility
This is a contract is intended to be inherited and overridden when creating an eligibility module. The functions outlined will be called throughout the NFTX vault journey and this abstract contract provides a number of helper functions.
Public Methods
The following are a collection of understood functions that should be defined in your implementation.
name
Defines the constant name of the eligibility module.
Try to keep the naming convention of the eligibility module short, but desciptive as this will be displayed to end users looking to implement it.
finalized
If the eligibility has been finalized then it can no longer be updated, meaning the processing logic can no longer be modified and it is safe to use.
targetAsset
Allows the module to define an asset that is targetted. This can be subsequently used for internal calls to reference the token address being queried.
This is not a required field, and can just return address(0)
if no subsequent use is needed.
__NFTXEligibility_init_bytes
Called when initialising the eligibility module, allowing configuring data to be passed and initial module contract setup to be performed.
If no further configuration is required, then we can just omit providing the bytes with an attribute name and ignore any calculation.
checkIsEligible
Checks if a tokenId is eligible to be received by the vault.
checkEligible
Checks if an array of tokenIds are eligible to be received by the vault.
checkAllEligible
Checks if all tokenIds in an array are eligible to be received by the vault.
checkAllIneligible
Checks if all provided NFTs are NOT eligible. This is needed for mint requesting where all NFTs provided must be ineligible.
beforeMintHook
Called before tokenIds are minted into the NFTX vault.
This function is not currently implemented in the NFTX Vault.
afterMintHook
Called after tokenIds have been minted into the NFTX vault.
This function is not currently implemented in the NFTX Vault.
beforeRedeemHook
Called before tokenIds are redeemed from the NFTX vault.
This function is not currently implemented in the NFTX Vault.
afterRedeemHook
Called after tokenIds are redeemed from the NFTX vault.
_checkIfEligible
Contains logic to determine if a tokenId is eligible to be handled by the NFTX vault.
This is the minimum required logic to be processed in order to create a functioning eligibility module.
Last updated