-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactor(StakeManager): make function names more descriptive #93
Conversation
@@ -66,7 +66,7 @@ contract StakeManager is Ownable { | |||
_; | |||
} | |||
|
|||
modifier onlyInitialized(address account) { | |||
modifier onlyAccountInitialized(address account) { |
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.
I've changed this one as onlyInitialized
is commonly used in OZ Initializable
contracts
@@ -106,7 +106,7 @@ contract StakeManager is Ownable { | |||
/** | |||
* @notice Process epoch if it has ended | |||
*/ | |||
modifier processEpoch() { | |||
modifier finalizeEpoch() { |
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.
Really wat this modifier does is finalizing the epoch if it's duration has passed.
There's an argument to be made that there's cases where it won't finalize, but I still think it's better than "process epoch" which can mean many things.
*/ | ||
function increaseMPFromMigration(uint256 _increasedMP) external onlyOldManager { | ||
totalSupplyMP += _increasedMP; | ||
function increaseTotalMP(uint256 _amount) external onlyPreviousManager { |
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.
The entire "increasedMP" notion in this contract felt a bit off to me.
In this case here, really what we're doing is adjusting the total MP of the next manager.
*/ | ||
function _getIncreasedMP(uint256 _balance, uint256 _deltaTime) private pure returns (uint256 _increasedMP) { | ||
function _getMPToMint(uint256 _balance, uint256 _deltaTime) private pure returns (uint256) { |
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.
Also here, this function really just calculates the MP that should be minted
console.log("####### epoch :", epoch); | ||
console.log("==============="); | ||
} | ||
|
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 entire function was not used anywhere.
9f59efb
to
97edf24
Compare
Some of the functions on our contracts were confusing. This commit changes them so they describe what they actually do.
97edf24
to
3c4c463
Compare
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.
Makes sense.
Some of the functions on our contracts were confusing. This commit changes them so they describe what they actually do.
Checklist
Ensure you completed all of the steps below before submitting your pull request:
forge snapshot
?pnpm gas-report
?pnpm lint
?forge test
?pnpm verify
?