JBTiered721GovernanceDelegate
Inherits: Votes
, JBTiered721Delegate
A tiered 721 delegate where each NFT can be used for onchain governance.
Functions
constructor
constructor(
IJBDirectory _directory,
IJBOperatorStore _operatorStore,
bytes4 _payMetadataDelegateId,
bytes4 _redeemMetadataDelegateId
) JBTiered721Delegate(_directory, _operatorStore, _payMetadataDelegateId, _redeemMetadataDelegateId);
Parameters
Name | Type | Description |
---|---|---|
_directory | IJBDirectory | A directory of terminals and controllers for projects. |
_operatorStore | IJBOperatorStore | The operatorStore that will be used to check operator permissions. |
_payMetadataDelegateId | bytes4 | The 4bytes ID of this delegate, used for pay metadata parsing |
_redeemMetadataDelegateId | bytes4 | The 4bytes ID of this delegate, used for redeem metadata parsing |
_getVotingUnits
The total voting units the provided address has from its NFTs across all tiers. NFTs have a tier-specific number of voting units.
function _getVotingUnits(address _account) internal view virtual override returns (uint256 units);
Parameters
Name | Type | Description |
---|---|---|
_account | address | The account to get voting units for. |
Returns
Name | Type | Description |
---|---|---|
units | uint256 | The voting units for the account. |
_afterTokenTransferAccounting
Handles voting unit accounting within a tier.
function _afterTokenTransferAccounting(address _from, address _to, uint256 _tokenId, JB721Tier memory _tier)
internal
virtual
override;
Parameters
Name | Type | Description |
---|---|---|
_from | address | The account to transfer voting units from. |
_to | address | The account to transfer voting units to. |
_tokenId | uint256 | The token ID for which voting units are being transferred. |
_tier | JB721Tier | The tier that the token ID is part of. |