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

Diamond Hands - correctly calculating 2 years lock period #2

Open
StErMi opened this issue Oct 12, 2021 · 0 comments
Open

Diamond Hands - correctly calculating 2 years lock period #2

StErMi opened this issue Oct 12, 2021 · 0 comments

Comments

@StErMi
Copy link

StErMi commented Oct 12, 2021

Hi there, I know it's a challenge and it's a proof of concept but we are also trying to learn and teach correct solidity concepts.

From the current Solidity documentation I see

Take care if you perform calendar calculations using these units, because not every year equals 365 days and not even every day has 24 hours because of leap seconds. 
Due to the fact that leap seconds cannot be predicted, an exact calendar library has to be updated by an external oracle.

and

The suffix years has been removed in version 0.5.0 due to the reasons above.

Would that be fine to calculate 2 years as uint256 constant lockPeriod = 2 * 365 days; ?

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

No branches or pull requests

1 participant