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

QA Report #296

Open
code423n4 opened this issue May 14, 2022 · 1 comment
Open

QA Report #296

code423n4 opened this issue May 14, 2022 · 1 comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Low severity issues

Incorrect revert message

In contracts/src/Cally.sol#L169 the revert message is false - "Reserve strike too small". If reverts, it is too large. Additionally, a sharp inequality is used - someone may want just to present a price and skip the dutch auction - then equality would be useful.

Non-critical issues

Use !value instead of value == false

To increase readability, negate bool values instead of ensuring they are false. This is a best practice.

Cally.sol#L217

Cally.sol#L220

Cally.sol#L328

Economic calculations unnecessarily use approximations

In Cally.getDutchAuctionStrike(...) there are fixed-point calculations. At first progress is approximated, then used in calculations. It would be more precise to inline the calculation in the strike calculation.

Instead of:

        uint256 progress = (1e18 * delta) / AUCTION_DURATION;
        uint256 auctionStrike = (progress * progress * startingStrike) / (1e18 * 1e18);

write:

        uint256 auctionStrike = (delta * delta * startingStrike) / (AUCTION_DURATION * AUCTION_DURATION);
@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels May 14, 2022
code423n4 added a commit that referenced this issue May 14, 2022
@HardlyDifficult
Copy link
Collaborator

Merging with #299

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

2 participants