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

Improve readability of constants #84

Open
code423n4 opened this issue Dec 2, 2021 · 2 comments
Open

Improve readability of constants #84

code423n4 opened this issue Dec 2, 2021 · 2 comments
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue

Comments

@code423n4
Copy link
Contributor

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/PegExchanger.sol#L17-L17

uint256 public constant MIN_EXPIRY_WINDOW = 6400 * 365;

https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L229-L229

expirationBlock = block.number + 6400 * 3; // approx. 3 days in blocks

The value of 6400 is not easy to read.

Consider using a constant uint256 public constant BLOCKS_PER_DAY = 6400, which is easier to read.

@code423n4 code423n4 added 0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working labels Dec 2, 2021
code423n4 added a commit that referenced this issue Dec 2, 2021
@elee1766 elee1766 added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Dec 6, 2021
@elee1766
Copy link
Collaborator

elee1766 commented Dec 6, 2021

opinionated, not issue

@pauliax
Copy link
Collaborator

pauliax commented Dec 10, 2021

A non-critical recommendation that may improve the readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 (Non-critical) Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation bug Something isn't working sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Projects
None yet
Development

No branches or pull requests

3 participants