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

[DFDComptroller] - Optimize timestamp retrieval #9

Open
cleanunicorn opened this issue Dec 17, 2020 · 0 comments
Open

[DFDComptroller] - Optimize timestamp retrieval #9

cleanunicorn opened this issue Dec 17, 2020 · 0 comments

Comments

@cleanunicorn
Copy link
Member

Description

There are a few instances where time is retrieved in the contract and could be improved.

https://github.com/monoceros-alpha/audit-defi-dollar-2020-12/blob/b333071efe533483eb99f8165e2cb2699647379c/code/contracts/stream/DFDComptroller.sol#L133-L135

https://github.com/monoceros-alpha/audit-defi-dollar-2020-12/blob/b333071efe533483eb99f8165e2cb2699647379c/code/contracts/stream/DFDComptroller.sol#L69

https://github.com/monoceros-alpha/audit-defi-dollar-2020-12/blob/b333071efe533483eb99f8165e2cb2699647379c/code/contracts/stream/DFDComptroller.sol#L125

Recommendation

The _timestamp method can be removed completely and block.timestamp can be used instead directly.

The now usage is deprecated in Solidity 0.7.0 and block.timestamp is required. This will make your code more future-proof.

[optional] References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant