-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: upload the files #29
base: main
Are you sure you want to change the base?
Conversation
Error texts are too long and not good for smart contracts. These texts are better:
|
* Only callable by the ADMIN_ROLE. | ||
* @param nodeId The ID of the node to be deactivated. | ||
*/ | ||
function deactiveNode(uint64 nodeId) |
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 need a function to let the ADMIN activate a node. Otherwise, a node could be deactivated and its staked amount will be locked
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.
Let's allow the admin to decative a node via staking contract
* Only callable by the DAO_ROLE. | ||
* @param role The role to be added. | ||
*/ | ||
function addNodeRole(bytes32 role) public onlyRole(DAO_ROLE) { |
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 do not use byte32 role
anywhere.
Is it safe to remove it?
Muon node can define the roles and just save the ids in the contract.
Need to discuss more: |
contracts/MuonNodeManager.sol
Outdated
uint8 nodesIndex = 0; | ||
lastIndex = 0; | ||
|
||
for (uint256 i = startIndex; i > 0; i--) { |
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.
It does not check editLog[0]
.
This works:
for (uint256 i = startIndex+1; i > 0; i--) {
EditLog memory log = editLogs[i-1];
contracts/MuonNodeStaking.sol
Outdated
*/ | ||
modifier whenFunctionNotPaused(string memory functionName) { | ||
require( | ||
!functionPauseStates[functionName].isPaused, |
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.
This is calling by all of the user functions. If we define constants and use uint8 as the mapping key, it wil be more gas efficient.
uint8 public constant FUNCTION_GET_REWARD = 1;
// ... other functions
... getReward() functionNotPaused(FUNCTION_GET_REWARD)
Staking & NodeManager