Skip to content

Conversation

@sarasorici
Copy link
Contributor

Description of the pull request (what is new / what has changed)

Did you test the changes locally ?

  • yes
  • no

Which category (categories) does this pull request belong to?

  • document new feature
  • update documentation that is not relevant anymore
  • add examples or more information about a component
  • fix grammar issues
  • other

@sarasorici sarasorici marked this pull request as draft September 1, 2025 08:26
@sarasorici sarasorici marked this pull request as ready for review September 4, 2025 10:24
@AdoAdoAdo AdoAdoAdo changed the base branch from main to development September 4, 2025 10:39
@AdoAdoAdo AdoAdoAdo changed the base branch from development to master September 4, 2025 10:40
@AdoAdoAdo AdoAdoAdo changed the base branch from master to main September 4, 2025 10:41
@popenta popenta changed the base branch from main to development September 4, 2025 10:45
spelling error
The proposal identifier is a hex string containing exactly 40 characters. Usually, this can be a git commit hash on which the proposal is made but can be any other identifier string.

The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame the votes can be cast.
The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame, lasting 10 days, the votes can be cast.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During this time frame, lasting 10 days, the votes can be cast. -> lasting at most 10 days,

- `vote_type` as encoded string representing the vote
- `total_stake` total staked EGLD for the sender address
- `total_voting_power` total available voting power for the sender address

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we please add an example here how the encoding looks like?
similar to line 197 from this file: https://github.com/multiversx/mx-docs/pull/1145/files#diff-07f3478f0433c88d1671159679aeaa7019d72cb78c63c302d45db6cc13fe1afeR197

I took this example: https://devnet-explorer.multiversx.com/transactions/2cd33ee164881dd273a3568ed6cb272e3d7f05b7b46fd8f4a64d28dc30e1fe48/logs

WQ==               -> hex 59                    -> 89
eWVz               -> hex 79657                 -> "yes"
BxRA1dqcrTxyQw==  -> hex 071440d5da9cad3c7243   -> 33430172142116630458947 (~33430 EGLD)
BxRA1dqcrTxyQw==  -> hex 071440d5da9cad3c7243   -> 33430172142116630458947 (~33430 EGLD)


That is why we offered an endpoint to the governance smart contact that can be called **only by a shard smart contract** and the governance contract will record the address provided, the vote type and vote value.

This is very useful whenever implementing liquid-staking-like smart contracts. The liquid-staking contract knows the balance for each user, so it will delegate the call to the governance contract providing the value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

providing the value -> providing the corresponding voting power.


After issuing the vote, a log event is generated containing the `proposal` identifier and the following encoded topics:

- `nonce` as encoded integer which uniquely identifies the proposals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here please have an example of the encoding.


That is why we offered an endpoint to the governance smart contact that can be called **only by a shard smart contract** and the governance contract will record the address provided, the vote type and vote value.

This is very useful whenever implementing liquid-staking-like smart contracts. The liquid-staking contract knows the balance for each user, so it will delegate the call to the governance contract providing the value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before the GovernanceVoteThroughDelegationTransaction we need a short explanation like this:

The user that delegated through a liquid-staking-like contract in order to vote on a proposal, sends a transaction to the liquid-staking-like contract. The smart contract then creates the GovernanceVoteThroughDelegationTransaction based on the users transaction inputs to forward the vote and the computed voting power to the governance contract.

There's a typo in Thourgh -> Through

"AA==", (number of direct nonces: 0)
"AA==", (used power: 0)
"AA==", (used stake: 0)
"A+g=", (total power: 1000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here please make last 2 values equal.


A user can create any number of proposals as long as it pays the locking fee & the gas used for the transaction. The proposal can be closed in any epoch following the provided end epoch.
After a proposal is created, the following rules will apply:
- If the proposal passes or fails normally, the fee is refunded to the issuer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the proposal fails, we currently refund the 500 from the proposal fee without the LostProposalFee so only if the proposal passes, the entire fee is refunded.


The votes will be added for each category (**Yes**, **No**, **Abstain** and **Veto**). The vote is computed as `vote = total_staked_value` for each address that cast a vote.
### Voting
- The voting starts from the provided starting epoch and lasts exactly *10 days*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lasts at most 10 days

it should have been exactly, but it was implement with 1-10 days.

- There are four vote types: **Yes**, **No**, **Abstain**, and **Veto**.
- Voting consumes gas (approx. 6 million units).
- Voting power is derived from staked and delegated EGLD.
- Delegation and liquid staking () contracts can cast votes on behalf of users.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the () ?
can cast votes on behalf of users -> can forward user votes.

can cast votes on behalf sounds like the users can't/don't have to to anything.


The quorum in this case will be a value `(2000+3000+4000+1500) * 10^18 = 10500 * 10^18`.
### Closing and cleanup
- Proposals can only be closed after the end epoch has passed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be closed also before the voting period has started, but only by the issuer.
Anyone can close them after the voting period ended.

- There are four vote types: **Yes**, **No**, **Abstain**, and **Veto**.
- Voting consumes gas (approx. 6 million units).
- Voting power is derived from staked and delegated EGLD.
- Delegation and liquid staking () contracts can cast votes on behalf of users.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parentheses can be removed

Value: 500 EGLD
GasLimit: 51000000
Data: "proposal" +
"@<identifier>" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think a better name would be commit_hash.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also specify than length is mandatory to be exactly 40 chars


The value parameter represents the mandatory proposal submission deposit of 500 EGLD.

The proposal identifier is a hex string containing exactly 40 characters. Usually, this can be a git commit hash on which the proposal is made but can be any other identifier string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something like this is a bit more accurate:

The proposal identifier is a hex string containing exactly 40 characters. This is the git commit hash on which the proposal is made.

>**Note:** When providing the starting epoch, it should be taken into consideration that the governance contract enforcing a configured maximum gap of 30 epochs between the current epoch and the proposal’s starting epoch.
After issuing the proposal, there is a log event generated having the `proposal` identifier that will contain the following encoded topics:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace identifier with commit hash bellow

```json
{
"returnData": [
"NjXJrcXeoAAA", (proposal locked amount: 1000 EGLD denominated = 1000 * 10^18)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change the example to use 500 EGLD

Value: 500 EGLD
GasLimit: 51000000
Data: "proposal" +
"@<identifier>" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also specify than length is mandatory to be exactly 40 chars

- `delta`: staked value **1500 EGLD** that vote **No**

The totals are:
- Quorum = `(2000+3000+4000+1500) = 10,500 EGLD`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the quorum: it would be nice to clarify that it is calculated as 33% of the total staked EGLD, where total means the sum of Direct stake + Staking Providers + Legacy Staking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @raduchis

The proposal identifier is a hex string containing exactly 40 characters. Usually, this can be a git commit hash on which the proposal is made but can be any other identifier string.

The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame the votes can be cast.
The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame, lasting 10 days, the votes can be cast.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename days to Unbound Period duration, which is 10 Epochs on Mainnet

Copy link

@elvisboghiu elvisboghiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following view methods are nnot documented: viewVotingPower, viewConfig.
You can find more information in governance contract.
https://github.com/multiversx/mx-chain-go/blob/master/vm/systemSmartContracts/governance.go

@popenta popenta changed the base branch from development to governance-update September 9, 2025 10:34
@popenta popenta merged commit c2d4b87 into multiversx:governance-update Sep 9, 2025
3 checks passed
@popenta
Copy link
Contributor

popenta commented Sep 9, 2025

Merged the PR to governance-update where I'll do the fixes after review and then it will be merged in development.

LE: This is the PR: #1148.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants