Skip to content
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

Adding lock limit of 4 years #22

Closed
wants to merge 1 commit into from
Closed

Adding lock limit of 4 years #22

wants to merge 1 commit into from

Conversation

mart1n-xyz
Copy link
Collaborator

No description provided.

@@ -88,6 +88,7 @@ contract StakeManager is Ownable {
function lock(uint256 _time) external onlyVault {
Account storage account = accounts[msg.sender];
processAccount(account, currentEpoch);
require(_time < 209 weeks, "Cannot lock for more than 4 years");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably better to have this stored as a constant and use that instead.
Something like:

uint256 constant 4_YEARS = 209 weeks;

While it won't make such a huge difference, you generally want to avoid using "magic" numbers without semantic value.

Copy link
Collaborator

Choose a reason for hiding this comment

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

uint256 constant MAX_LOCK_TIME = 209 weeks;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, makes sense.

@0x-r4bbit
Copy link
Collaborator

Closing this in favour of #39

@0x-r4bbit 0x-r4bbit closed this Oct 20, 2023
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.

3 participants