Governance

Governance will be used to create proposal, vote, queue and execute the proposal.

Methods

propose (string,address[],uint[],string[],bytes[],string,bool)

This method is used to create a proposal. To create a proposal, the user needs to stake 500,000 Astra tokens by approving the governance contract. Details such as the type of proposal (fundamental or non-fundamental) should be selected. Fundamental and non-fundamental proposals have different acceptance mechanisms. All the arrays mentioned in parameters should have the same length and each of them is related by the array's index.

  • Parameters

  • string chain : The chain for which is the proposal is intended for, to be passed in the way it is described here - https://docs.axelar.dev/resources/mainnet

  • address[] targets: List of contract address whose function will be called.

  • uint[] value: Amount of Ether if any function requires Ether value to call.

  • string[] signatures: Function name which we need to call along with parameter type.

  • bytes[] calldatas: Function parameter converted into bytes format.

  • string description: Description of the proposal.

  • bool _fundametalChanges: Check if the proposal has fundamental changes or not.

castVote(uint,bool)

Cast a vote on a proposal. The account's voting weight is determined by the staking score of that user. Final votes are calculated by staking score multiplied by the multiplier for that user account.

  • Parameters

  • uint proposalId: ID of a proposal in which to cast a vote is called.

  • bool support: Boolean value true for support and false for against.

state(uint)

Gets the proposal state for the specified proposal. The return value, ProposalState is an enumerated type defined in the Governor Bravo contract.

  • Parameters

  • uint proposalId: ID of a proposal to check the status.

  • Return Value

  • ProposalState: Enumerated type ProposalState. The types are Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, and Executed.

checkfastvote(uint)

Gets the fastvote state for the specified proposal. The return value is a boolean value.

  • Parameters

  • uint proposalId: ID of a proposal to check the fastvote status.

  • Return Value

  • bool: true is proposal is eligible for fast vote.

getReceipt(uint,address)

Gets a proposal ballot receipt of the indicated voter.

  • Parameters

  • uint proposalId: ID of a proposal to check the voting receipt.

  • address voter:

  • Return Value

  • Receipt: Reverts on error. If successful, return a Receipt struct for the ballot of the voter address.

quorumVotes()

The number of votes in support of a proposal required for a quorum to be reached and for a vote to succeed.

  • Return Value

  • uint: Return the quorum votes.

votingDelay()

The delay before voting on a proposal may take place, once proposed.

  • Return Value

  • uint: Return the vote delay value.

votingPeriod()

The duration of voting on a proposal, in blocks.

  • Return Value

  • uint: Return the vote period value.

proposalMaxOperations()

The maximum number of actions that can be included in a proposal.

  • Return Value

  • uint: Return the value of max proposal.

queue(uint)

After a proposal has succeeded, it is moved into the Timelock waiting period using this function. The waiting period (e.g. 2 days) begins when this function is called.

The queue function can be called by any Ethereum address.

  • Parameters

  • uint proposalId: ID of a proposal that has succeeded.

execute(uint)

After the Timelock waiting period has elapsed, a proposal can be executed using this function, which applies the proposal changes to the target contracts. This will invoke each of the actions described in the proposal.

The execute function can be called by any Ethereum address. The address will also need to pay the fee for cross-chain calls if the proposal is intended for a different chain in the native currency, ETH.

Note: this function is payable, so the Timelock contract can invoke payable functions that were selected in the proposal.

  • Parameters

  • uint proposalId: ID of a succeeded proposal to execute.

Last updated