Skip to content

Conversation

@txhsl
Copy link
Contributor

@txhsl txhsl commented Mar 7, 2024

  • Vote for a candidate instead of a proposal;
  • Only Governance.sol and GovReward.sol have a V2, others remain compatible.

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Just a set of quick thoughts, will properly review the contract later.

}

function withdraw() external onlyGov {
TransferHelper.safeTransferETH(governance, address(this).balance);
Copy link
Member

Choose a reason for hiding this comment

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

We send reward to Governance Proxy contract, and then Governance Proxy contract will send reward to Governance implementation contract with subsequent receive() method call. So as a result the final destination of reward funds is Governance implementation contract (not a Proxy), right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, the receive() of Proxy contract will fall back to implement contract with delegate call. Please refer to https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/proxy/Proxy.sol and
https://solidity-by-example.org/delegatecall.

Comment on lines +98 to +100
(msg.value * shareRateOf[validators[i]] * scaleFactor) /
consensusSize /
1000 /
Copy link
Member

Choose a reason for hiding this comment

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

We should create at least basic documentation for reward calculations to show it to users. It should be documented that:

  • shareRateOf is X/1000, otherwise it's not clear
  • register fee amount
  • minimum vote amount
  • locking period for candidate registration fee
  • etc.

Do we need a separate issue for documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet.

@txhsl
Copy link
Contributor Author

txhsl commented Mar 23, 2024

I've tried different settings for compilation (refer to Optimizer Parameter Runs), and finally set it 2^32-1 = 4294967295, but Hardhat tests told me there is no difference in execution cost.

Well, maybe someone who knows the reason can leave a comment.

@txhsl txhsl merged commit a9d6cbc into governance Mar 25, 2024
@txhsl txhsl deleted the governance-v2-proposal branch March 25, 2024 03:21
@txhsl
Copy link
Contributor Author

txhsl commented Mar 25, 2024

Let's move further comments back to #7.

@txhsl txhsl restored the governance-v2-proposal branch March 28, 2024 02:10
@txhsl txhsl deleted the governance-v2-proposal branch March 28, 2024 02:10
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.

6 participants