Skip to main content

JBTiered721GovernanceDelegate

Git Source

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

NameTypeDescription
_directoryIJBDirectoryA directory of terminals and controllers for projects.
_operatorStoreIJBOperatorStoreThe operatorStore that will be used to check operator permissions.
_payMetadataDelegateIdbytes4The 4bytes ID of this delegate, used for pay metadata parsing
_redeemMetadataDelegateIdbytes4The 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

NameTypeDescription
_accountaddressThe account to get voting units for.

Returns

NameTypeDescription
unitsuint256The 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

NameTypeDescription
_fromaddressThe account to transfer voting units from.
_toaddressThe account to transfer voting units to.
_tokenIduint256The token ID for which voting units are being transferred.
_tierJB721TierThe tier that the token ID is part of.