-
Notifications
You must be signed in to change notification settings - Fork 0
Governance V2 #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Governance V2 #146
Conversation
AnnaShaleva
left a comment
There was a problem hiding this 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.
contracts/solidity/GovRewardV2.sol
Outdated
| } | ||
|
|
||
| function withdraw() external onlyGov { | ||
| TransferHelper.safeTransferETH(governance, address(this).balance); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
| (msg.value * shareRateOf[validators[i]] * scaleFactor) / | ||
| consensusSize / | ||
| 1000 / |
There was a problem hiding this comment.
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:
shareRateOfis 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet.
Co-authored-by: Anna Shaleva <[email protected]>
|
I've tried different settings for compilation (refer to Optimizer Parameter Runs), and finally set it Well, maybe someone who knows the reason can leave a comment. |
|
Let's move further comments back to #7. |
Governance.solandGovReward.solhave a V2, others remain compatible.