# GovernanceRegistry



## Overview [#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 [#escrows-and-governance-contracts]

```solidity
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](/docs/technical-reference/contract-functions/voter) and [Voting Escrow Aggregator](/docs/technical-reference/contract-functions/votingescrowaggregator). `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](/docs/technical-reference/contract-functions/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 [#governanceregistry-methods]

### votingRewardsFactory [#votingrewardsfactory]

Returns the address of `VotingRewardsFactory`.

```solidity
function votingRewardsFactory() external view returns (address)
```

### poolsData [#poolsdata]

Returns the pool data.

```solidity
function poolsData(uint160 _poolId) external view returns (address, uint256, bool)
```

| Return Parameter | Type    | Description                                               |
| ---------------- | ------- | --------------------------------------------------------- |
| `_pool`          | address | The pool address.                                         |
| `_chainId`       | uint256 | The chainId of the network on which the pool is deployed. |
| `_isRegistered`  | bool    | True if the pool is registered, false otherwise.          |

### getPoolId [#getpoolid]

Returns the pool ID for the given pool.

<Callout type="info">
  `poolId = uint160(poolAddress)` `\oplus` `uint160(chainId)`
</Callout>

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

### isPoolRegistered [#ispoolregistered]

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

```solidity
function isPoolRegistered(uint160 _poolId) external view returns (bool)
```

```solidity
function isPoolRegistered(address _pool, uint256 _chainId) external view returns (bool)
```
