Technical ReferenceContract Functions

Voting Escrow Aggregator

Read weighted voting power across registered veSPECTRA escrows.

Overview

SpectraVotingEscrowAggregator reads NFT voting power from the escrows registered in GovernanceRegistry. It applies each escrow's configured weight and can sum the voting power of all NFTs owned by a wallet.

Unlike VotingEscrow, where balanceOf(address) counts NFTs, the aggregator's balanceOf(address) returns weighted voting power.

NFT and escrow voting power

function getVotingPowerOfNFT(address _ve, uint256 _tokenId) external view returns (uint256)
function getVotingPowerOfNFTAt(address _ve, uint256 _tokenId, uint256 _t) external view returns (uint256)
function getTotalVotingPowerOfVE(address _ve) external view returns (uint256)
function getTotalVotingPowerOfVEAt(address _ve, uint256 _t) external view returns (uint256)

_ve identifies a registered escrow and _tokenId identifies one of its NFTs. Timestamped reads use a Unix timestamp in seconds and the escrow weight recorded at that timestamp. Queries for an unregistered escrow revert.

For each escrow, weighted voting power is its NFT or total voting power multiplied by getVeWeightAt(_ve, timestamp) and divided by 1e18.

Wallet and aggregate voting power

function getTotalVotingPowerOfUser(address _user) external view returns (uint256)
function balanceOf(address _user) external view returns (uint256)
function getTotalVotingPower() external view returns (uint256)
function getTotalVotingPowerAt(uint256 _t) external view returns (uint256)
function totalSupply() external view returns (uint256)

balanceOf is an alias for getTotalVotingPowerOfUser: both enumerate the wallet's currently owned NFTs across registered escrows. totalSupply is an alias for getTotalVotingPower. These views report voting power; they do not create locks, cast votes, or claim rewards.

On this page