JB721TiersHook
Inherits: JBOwnable, ERC2771Context, JB721Hook, IJB721TiersHook
A Juicebox project can use this hook to sell tiered ERC-721 NFTs with different prices and metadata. When the project is paid, the hook may mint NFTs to the payer, depending on the hook's setup, the amount paid, and information specified by the payer. The project's owner can enable NFT cash outs through this hook, allowing holders to burn their NFTs to reclaim funds from the project (in proportion to the NFT's price).
State Variables
RULESETS
The contract storing and managing project rulesets.
IJBRulesets public immutable override RULESETS;
STORE
The contract that stores and manages data for this contract's NFTs.
IJB721TiersHookStore public immutable override STORE;
baseURI
The base URI for the NFT tokenUris
.
string public override baseURI;
contractURI
This contract's metadata URI.
string public override contractURI;
payCreditsOf
If an address pays more than the price of the NFT they received, the extra amount is stored as credits which can be cashed out to mint NFTs.
mapping(address addr => uint256) public override payCreditsOf;
_firstOwnerOf
The first owner of each token ID, stored on first transfer out.
mapping(uint256 tokenId => address) internal _firstOwnerOf;
_packedPricingContext
Packed context for the pricing of this contract's tiers.
*Packed into a uint256:
- currency in bits 0-31 (32 bits),
- pricing decimals in bits 32-39 (8 bits), and
- prices contract in bits 40-199 (160 bits).*
uint256 internal _packedPricingContext;
Functions
constructor
constructor(
IJBDirectory directory,
IJBPermissions permissions,
IJBRulesets rulesets,
IJB721TiersHookStore store,
address trustedForwarder
)
JBOwnable(permissions, directory.PROJECTS(), msg.sender, uint88(0))
JB721Hook(directory)
ERC2771Context(trustedForwarder);