Technical ReferenceContract Functions

GovernanceRegistry

Overview

GovernanceRegistry registers voting escrows, their weights and rebase distributors, pool network data, and the addresses used by Spectra's governance contracts.

Escrows and governance contracts

function voter() external view returns (address)
function veAggregator() external view returns (address)
function votingEscrows() external view returns (address[] memory)
function isValidVotingEscrow(address _votingEscrowAddress) external view returns (bool)
function getVeWeight(address _votingEscrowAddress) external view returns (uint256)
function getVeWeightAt(address _votingEscrowAddress, uint256 _timestamp) external view returns (uint256)
function getVeDistributor(address _votingEscrowAddress) external view returns (address)

Use voter and veAggregator to identify the configured Voter and Voting Escrow Aggregator. votingEscrows lists registered escrow addresses; an NFT position is identified by an escrow address and a token ID within that escrow.

getVeWeight and getVeWeightAt return the weight used to scale an escrow's voting power, with 1e18 representing a multiplier of one. getVeDistributor returns the RewardsDistributor configured for that escrow. getVeWeight and getVeDistributor require a currently registered escrow. getVeWeightAt requires a weight recorded at or before the requested timestamp. Registration, weights, and contract addresses are configured through restricted administrative methods.

GovernanceRegistry Methods

votingRewardsFactory

Returns the address of VotingRewardsFactory.

function votingRewardsFactory() external view returns (address)

poolsData

Returns the pool data.

function poolsData(uint160 _poolId) external view returns (address, uint256, bool)
Return ParameterTypeDescription
_pooladdressThe pool address.
_chainIduint256The chainId of the network on which the pool is deployed.
_isRegisteredboolTrue if the pool is registered, false otherwise.

getPoolId

Returns the pool ID for the given pool.

poolId = uint160(poolAddress) \oplus uint160(chainId)

function getPoolId(address _pool, uint256 _chainId) external view returns (uint160)

isPoolRegistered

Returns whether the given pool is registered for deployment of voting rewards.

function isPoolRegistered(uint160 _poolId) external view returns (bool)
function isPoolRegistered(address _pool, uint256 _chainId) external view returns (bool)

On this page