This section is for developers and technical users. For a non-technical overview, see the Protocol Governance section of Aavenomics.
The LEND (and AAVE) token can be used in the protocol's decision-making process, ensuring that the protocol evolves and grows in a decentralised manner.
On a technical level, the main components of the Aave Genesis Governance are:
The AaveProtoGovernance
contract, which handles most of the logic for voting.
The AssetVotingWeightProvider
contract, which whitelists and sets voting weight for assets.
The AavePropositionPower
contract, which controls permissions for protocol governance such as registering a new proposal.
The GovernanceParamsProvider
contract, which stores the global protocol governance parameters such as the threshold of proposition power needed to register a new proposal.
Genesis Governance proposals have distinct phases:
Creation: A proposal is created by a user with enough proposition power. In the early stages, this will be the Genesis team. The proposal includes code that will be executed on passing of the proposal.
Voting: The proposal enters the 'Voting' phase, with a duration of _votingBlocksDuration
.
Votes are made by sending vote transactions to the AaveProtoGovernance
contract using submitVoteByVoter()
.
Validating: At the end of the _votingBlocksDuration
, if the voting _threshold
has been reached,
the proposal is moved to the 'Validating' phase with a duration of _validatingBlocksDuration
.
If the _threshold
has not been reached, then the proposal will remain in the 'Voting' phase until the _threshold
is reached.
During the 'Validating' phase, anyone can challenge (and cancel invalid) votes by calling the challengeVoters()
method. Votes are considered invalid if their vote token balance is currently lower than the vote token balance at the time of voting.
This process, going from 'Validating' and back to 'Voting' can happen a maximum number of _maxMovesToVotingAllowed
, after which it is considered 'Expired' if it has not passed.
Execution: At the end of _validatingBlocksDuration
, the proposal is resolved and the status is changed to 'Executed'.
If the votes _threshold
has been reached then the execute()
method of the proposal's _proposalExecutor
is called, implementing/executing the governance proposal code.
If the votes _threshold
has not been reached, then no proposal code is executed.
All contract source code can be found in the Github repository.
Contract | Address and ABI |
​AaveProtoGovernance​ | |
​AavePropositionPower​ | |
​GovernanceParamsProvider​ |
Contract | Address and ABI |
​AaveProtoGovernance​ | |
​AavePropositionPower​ | |
​GovernanceParamsProvider​ |
Contract | Address and ABI |
​AaveProtoGovernance​ | |
​AavePropositionPower​ | |
​GovernanceParamsProvider​ |
For an example of a Governance proposal payload, see the Genesis Proposal Payload and Genesis Migration repository.
The Governance contracts have been audited by Consensys Diligence.
To perform AAVE voting and governance in your integration, the following steps should be followed:
You can fetch the list of proposal IDs a few ways :
Off-chain: use the emitted event from AaveProtoGovernance
contract: ProposalCreated()
​
On-chain: use try...catch
pattern to iterate through proposal IDs, starting at index 0
Via our GraphQL: query our subgraph to receive a list of proposals and their IDs
Once you have a list of the proposals, you can query for more proposal data:
On-chain: use getProposalBasicData()
Via our GraphQL: query our subgraph to receive the proposal's details
Once you have the proposal ID, a vote can be made by simply submitting a transaction using submitVoteByVoter()
.
You can change the user's vote by calling submitVoteByVoter()
again with the new vote, or cancel the vote with cancelVoteByVoter()
and re-submitting.
There is also the possibility of submitting a vote by relayer if desired.
Similar to what was mentioned above, you can retrieve associated proposal data such as current vote status and thresholds by calling getProposalBasicData()
or by querying our subgraph.
Other useful methods includes getLimitBlockOfProposal()
, getLeadingChoice()
, getVoterData()
, and getVotesData()
.
Contract: AaveProtoGovernance
function submitVoteByVoter(uint256 _proposalId, uint256 _vote, IERC20 _asset)
Submits a vote by the caller.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
| uint | A value indicating their vote (Abstain: 0, Yes: 1, No: 2). |
| address | The address of the asset used for voting. |
The vote is only allowed if the _asset
is whitelisted in the AssetVotingWeightProvider
contract.
If the voter has already voted, their previous vote will be overridden.
Contract: AaveProtoGovernance
function cancelVoteByVoter(uint256 _proposalId)
Cancels a vote by the caller.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
Contract: AaveProtoGovernance
function challengeVoters(uint256 _proposalId, address[] calldata _voters)
During the 'Validating' phase, anyone can call this method to challenge and cancel invalid votes. This is to prevent double-voting attacks.
A vote is considered invalid when the voter's current balance of the voting asset is less than the balance of the.same asset at the time of casting their vote.
E.g. Alice has a balance of 100 LEND, votes on Proposal 1, and sends 50 LEND to an exchange before the end of the 'Validating' phase. Her vote would become invalid as her current balance is less than her balance at the time of making the vote.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
| address[] | An array of voter addresses to challenge. |
Contract: AaveProtoGovernance
function getLimitBlockOfProposal(uint256 _proposalId)
Gets the maximum block number that a proposal is potentially 'Resolvable'. If the current block number is greater than this value, then the proposal is 'Invalid'.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
Return Parameter | Type | Description |
| uint | The block number limit. |
Contract: AaveProtoGovernance
function getLeadingChoice(uint256 _proposalId)
Gets the current leading choice in votes, i.e. the current majority of votes.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
Return Parameter | Type | Description |
| uint | The numeric reference of the leading choice (Abstain: 0, Yes: 1, No: 2). |
Contract: AaveProtoGovernance
function getProposalBasicData(uint256 _proposalId)
Gets the basic data of a proposal.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
Return Parameter | Type | Description |
| uint | The current total number of votes. |
| uint | The threshold of votes required for a proposal to pass. |
| uint | The number of times the proposal can move back to 'Voting' state. |
| uint | Current amount of times the proposal has been in the 'Voting' state. |
| uint | The minimum number of blocks the proposal needs to be in 'Voting' before being changed to 'Validating'. |
| uint | The minimum number of blocks the proposal needs to be in 'Validating' before being changed to 'Executed'. |
| uint | Block number where the current status started. |
| uint | Block number where the proposal was created. |
| uint | Status of the proposal. |
| address | The smart contract address with the |
| bytes32 | Hashed type of the proposal, e.g. |
Contract: AaveProtoGovernance
function getVoterData(uint256 _proposalId, address _voterAddress)
Gets the voting data of a particular voter for a proposal ID.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
| address | The address of the voter. |
Return Parameter | Type | Description |
| uint | The vote that was made (Abstain: 0, Yes: 1, No: 2). |
| uint | The weight of the voting asset used, referenced from |
| uint | The balance of the |
| uint | The nonce of the voter address to protect against vote replay attacks. It is increased by 1 on both voting and cancelling of a vote. If the user overrides a previous vote, the nonce is increased twice. |
| address | Address of the asset used to vote. |
Contract: AaveProtoGovernance
function getVotesData(uint256 _proposalId)
Gets the voting data, i.e. the cumulative votes of each choice, for a given proposal ID.
Parameter | Type | Description |
| uint | The ID of the governance proposal. |
Return Parameter | Type | Description |
| uint[3] | The cumulative number of votes for each vote type. E.g. |
Contract: AaveProtoGovernance
function getGovParamsProvider()
Returns the address of the GovernanceParamsProvider
contract.
​
​
​
​