Skip to main content

IExecutorWithTimelock

IAaveGovernanceV2

Functions

create

function create(
contract IExecutorWithTimelock executor,
address[] targets,
uint256[] values,
string[] signatures,
bytes[] calldatas,
bool[] withDelegatecalls,
bytes32 ipfsHash
) external returns (uint256)

Creates a Proposal (needs Proposition Power of creator > Threshold)

Parameters

NameTypeDescription
executorcontract IExecutorWithTimelockThe ExecutorWithTimelock contract that will execute the proposal
targetsaddress[]list of contracts called by proposal's associated transactions
valuesuint256[]list of value in wei for each propoposal's associated transaction
signaturesstring[]list of function signatures (can be empty) to be used when created the callData
calldatasbytes[]list of calldatas: if associated signature empty, calldata ready, else calldata is arguments
withDelegatecallsbool[]if true, transaction delegatecalls the taget, else calls the target
ipfsHashbytes32IPFS hash of the proposal

cancel

function cancel(
uint256 proposalId
) external

Cancels a Proposal, either at anytime by guardian or when proposal is Pending/Active and threshold no longer reached

Parameters

NameTypeDescription
proposalIduint256id of the proposal

queue

function queue(
uint256 proposalId
) external

Queue the proposal (If Proposal Succeeded)

Parameters

NameTypeDescription
proposalIduint256id of the proposal to queue

execute

function execute(
uint256 proposalId
) external

Execute the proposal (If Proposal Queued)

Parameters

NameTypeDescription
proposalIduint256id of the proposal to execute

submitVote

function submitVote(
uint256 proposalId,
bool support
) external

Function allowing msg.sender to vote for/against a proposal

Parameters

NameTypeDescription
proposalIduint256id of the proposal
supportboolboolean, true = vote for, false = vote against

submitVoteBySignature

function submitVoteBySignature(
uint256 proposalId,
bool support,
uint8 v,
bytes32 r,
bytes32 s
) external

Function to register the vote of user that has voted offchain via signature

Parameters

NameTypeDescription
proposalIduint256id of the proposal
supportboolboolean, true = vote for, false = vote against
vuint8v part of the voter signature
rbytes32r part of the voter signature
sbytes32s part of the voter signature

setGovernanceStrategy

function setGovernanceStrategy(
address governanceStrategy
) external

Set new GovernanceStrategy Note: owner should be a timelocked executor, so needs to make a proposal

Parameters

NameTypeDescription
governanceStrategyaddressnew Address of the GovernanceStrategy contract

setVotingDelay

function setVotingDelay(
uint256 votingDelay
) external

Set new Voting Delay (delay before a newly created proposal can be voted on) Note: owner should be a timelocked executor, so needs to make a proposal

Parameters

NameTypeDescription
votingDelayuint256new voting delay in seconds

authorizeExecutors

function authorizeExecutors(
address[] executors
) external

Add new addresses to the list of authorized executors

Parameters

NameTypeDescription
executorsaddress[]list of new addresses to be authorized executors

unauthorizeExecutors

function unauthorizeExecutors(
address[] executors
) external

Remove addresses to the list of authorized executors

Parameters

NameTypeDescription
executorsaddress[]list of addresses to be removed as authorized executors

__abdicate

function __abdicate() external

Let the guardian abdicate from its priviledged rights

getGovernanceStrategy

function getGovernanceStrategy() external returns (address)

Getter of the current GovernanceStrategy address

Return Values

NameTypeDescription
[0]addressThe address of the current GovernanceStrategy contracts

getVotingDelay

function getVotingDelay() external returns (uint256)

Getter of the current Voting Delay (delay before a created proposal can be voted on) Different from the voting duration

Return Values

NameTypeDescription
[0]uint256The voting delay in seconds

isExecutorAuthorized

function isExecutorAuthorized(
address executor
) external returns (bool)

Returns whether an address is an authorized executor

Parameters

NameTypeDescription
executoraddressaddress to evaluate as authorized executor

Return Values

NameTypeDescription
[0]booltrue if authorized

getGuardian

function getGuardian() external returns (address)

Getter the address of the guardian, that can mainly cancel proposals

Return Values

NameTypeDescription
[0]addressThe address of the guardian

getProposalsCount

function getProposalsCount() external returns (uint256)

Getter of the proposal count (the current number of proposals ever created)

Return Values

NameTypeDescription
[0]uint256the proposal count

getProposalById

function getProposalById(
uint256 proposalId
) external returns (struct IAaveGovernanceV2.ProposalWithoutVotes)

Getter of a proposal by id

Parameters

NameTypeDescription
proposalIduint256id of the proposal to get

Return Values

NameTypeDescription
[0]struct IAaveGovernanceV2.ProposalWithoutVotesthe proposal as ProposalWithoutVotes memory object

getVoteOnProposal

function getVoteOnProposal(
uint256 proposalId,
address voter
) external returns (struct IAaveGovernanceV2.Vote)

Getter of the Vote of a voter about a proposal Note: Vote is a struct: ({bool support, uint248 votingPower})

Parameters

NameTypeDescription
proposalIduint256id of the proposal
voteraddressaddress of the voter

Return Values

NameTypeDescription
[0]struct IAaveGovernanceV2.VoteThe associated Vote memory object

getProposalState

function getProposalState(
uint256 proposalId
) external returns (enum IAaveGovernanceV2.ProposalState)

Get the current state of a proposal

Parameters

NameTypeDescription
proposalIduint256id of the proposal

Return Values

NameTypeDescription
[0]enum IAaveGovernanceV2.ProposalStateThe current state if the proposal

Events

ProposalCreated

event ProposalCreated(
uint256 id,
address creator,
contract IExecutorWithTimelock executor,
address[] targets,
uint256[] values,
string[] signatures,
bytes[] calldatas,
bool[] withDelegatecalls,
uint256 startBlock,
uint256 endBlock,
address strategy,
bytes32 ipfsHash
)

emitted when a new proposal is created

Parameters

NameTypeDescription
iduint256Id of the proposal
creatoraddressaddress of the creator
executorcontract IExecutorWithTimelockThe ExecutorWithTimelock contract that will execute the proposal
targetsaddress[]list of contracts called by proposal's associated transactions
valuesuint256[]list of value in wei for each propoposal's associated transaction
signaturesstring[]list of function signatures (can be empty) to be used when created the callData
calldatasbytes[]list of calldatas: if associated signature empty, calldata ready, else calldata is arguments
withDelegatecallsbool[]boolean, true = transaction delegatecalls the taget, else calls the target
startBlockuint256block number when vote starts
endBlockuint256block number when vote ends
strategyaddressaddress of the governanceStrategy contract
ipfsHashbytes32IPFS hash of the proposal

ProposalCanceled

event ProposalCanceled(
uint256 id
)

emitted when a proposal is canceled

Parameters

NameTypeDescription
iduint256Id of the proposal

ProposalQueued

event ProposalQueued(
uint256 id,
uint256 executionTime,
address initiatorQueueing
)

emitted when a proposal is queued

Parameters

NameTypeDescription
iduint256Id of the proposal
executionTimeuint256time when proposal underlying transactions can be executed
initiatorQueueingaddressaddress of the initiator of the queuing transaction

ProposalExecuted

event ProposalExecuted(
uint256 id,
address initiatorExecution
)

emitted when a proposal is executed

Parameters

NameTypeDescription
iduint256Id of the proposal
initiatorExecutionaddressaddress of the initiator of the execution transaction

VoteEmitted

event VoteEmitted(
uint256 id,
address voter,
bool support,
uint256 votingPower
)

emitted when a vote is registered

Parameters

NameTypeDescription
iduint256Id of the proposal
voteraddressaddress of the voter
supportboolboolean, true = vote for, false = vote against
votingPoweruint256Power of the voter/vote

GovernanceStrategyChanged

event GovernanceStrategyChanged(
address newStrategy,
address initiatorChange
)

Parameters

NameTypeDescription
newStrategyaddress
initiatorChangeaddress

VotingDelayChanged

event VotingDelayChanged(
uint256 newVotingDelay,
address initiatorChange
)

Parameters

NameTypeDescription
newVotingDelayuint256
initiatorChangeaddress

ExecutorAuthorized

event ExecutorAuthorized(
address executor
)

Parameters

NameTypeDescription
executoraddress

ExecutorUnauthorized

event ExecutorUnauthorized(
address executor
)

Parameters

NameTypeDescription
executoraddress