JBTiered721Delegate
Inherits: JBOwnable
, JB721Delegate
, IJBTiered721Delegate
This delegate makes multiple NFT tiers with custom price floors available to a project's contributors upon payment, and allows project owners to enable NFT redemption for treasury assets based on the price floors of those NFTs.
State Variables
_firstOwnerOf
The first owner of each token ID, stored on first transfer out.
mapping(uint256 => address) internal _firstOwnerOf;
_packedPricingContext
Info that contextualizes the pricing of tiers, packed into a uint256: currency in bits 0-47 (48 bits), pricing decimals in bits 48-95 (48 bits), and prices contract in bits 96-255 (160 bits).
uint256 internal _packedPricingContext;
codeOrigin
The address of the original JBTiered721Delegate - used in initialize(...)
to check if this is the original JBTiered721Delegate, and to revert initialization if it is.
address public override codeOrigin;
store
The contract that stores and manages data for this contract's NFTs.
IJBTiered721DelegateStore public override store;
fundingCycleStore
The contract storing all funding cycle configurations.
IJBFundingCycleStore public override fundingCycleStore;
creditsOf
The amount each address has paid which did not go towards minting an NFT. These credits can be redeemed to mint NFTs.
mapping(address => uint256) public override creditsOf;
baseURI
The common base for the tokenUris.
string public override baseURI;
contractURI
Contract metadata uri.
string public override contractURI;
Functions
firstOwnerOf
The first owner of each token ID, which corresponds to the address that originally contributed to the project to receive the NFT.
function firstOwnerOf(uint256 _tokenId) external view override returns (address);
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The ID of the token to get the first owner of. |
Returns
Name | Type | Description |
---|---|---|
<none> | address | The first owner of the token. |
pricingContext
Info that contextualizes the pricing of tiers.
function pricingContext() external view override returns (uint256 currency, uint256 decimals, IJBPrices prices);
Returns
Name | Type | Description |
---|---|---|
currency | uint256 | The currency being used. |
decimals | uint256 | The amount of decimals being used. |
prices | IJBPrices | The prices contract being used to resolve currency discrepancies. |
balanceOf
The total number of tokens owned by an address across all tiers.
function balanceOf(address _owner) public view override returns (uint256 balance);
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address to check the balance of. |
Returns
Name | Type | Description |
---|---|---|
balance | uint256 | The number of tokens owned by the address across all tiers. |
tokenURI
The metadata URI of the provided token ID.
Defer to the tokenUriResolver if it is set. Otherwise, use the tokenUri corresponding with the token's tier.
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory);
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The ID of the token to get the metadata URI for. |
Returns
Name | Type | Description |
---|---|---|
<none> | string | The token URI corresponding with the token's tier, or the tokenUriResolver URI if it is set. |
redemptionWeightOf
The cumulative redemption weight the given token IDs have compared to the _totalRedemptionWeight
.
function redemptionWeightOf(uint256[] memory _tokenIds, JBRedeemParamsData calldata)
public
view
virtual
override
returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_tokenIds | uint256[] | The IDs of the tokens to get the cumulative redemption weight of. |
<none> | JBRedeemParamsData |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The redemption weight of the _tokenIds. |
totalRedemptionWeight
The cumulative redemption weight across all token IDs.
function totalRedemptionWeight(JBRedeemParamsData calldata) public view virtual override returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The cumulative redemption weight. |
supportsInterface
Indicates if this contract adheres to the specified interface.
See IERC165-supportsInterface.
function supportsInterface(bytes4 _interfaceId) public view override returns (bool);