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

Inclusive checks in LaunchEvent.sol for time-management #157

Open
code423n4 opened this issue Jan 27, 2022 · 0 comments
Open

Inclusive checks in LaunchEvent.sol for time-management #157

code423n4 opened this issue Jan 27, 2022 · 0 comments
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Handle

Dravee

Vulnerability details

These checks should be inclusive:

contracts\LaunchEvent.sol:182:                block.timestamp > phase3Start + issuerTimelock,
contracts\LaunchEvent.sol:187:                block.timestamp > phase3Start + userTimelock,
contracts\LaunchEvent.sol:250:            _issuerTimelock > _userTimelock,
contracts\LaunchEvent.sol:254:            _auctionStart > block.timestamp,
contracts\LaunchEvent.sol:291:        if (block.timestamp < auctionStart || auctionStart == 0) {
contracts\LaunchEvent.sol:293:        } else if (block.timestamp < auctionStart + PHASE_ONE_DURATION) {
contracts\LaunchEvent.sol:554:        if (timeElapsed < PHASE_ONE_NO_FEE_DURATION) {
contracts\LaunchEvent.sol:556:        } else if (timeElapsed < PHASE_ONE_DURATION) {

Also, strict inequalities add a check of non equality which costs around 3 gas, therefore inclusive checks are cheaper gas-wise. Use them when possible.

@code423n4 code423n4 added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working labels Jan 27, 2022
code423n4 added a commit that referenced this issue Jan 27, 2022
@cryptofish7 cryptofish7 added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments bug Something isn't working sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

2 participants