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 #353

Open
code423n4 opened this issue Sep 1, 2022 · 0 comments
Open

QA Report #353

code423n4 opened this issue Sep 1, 2022 · 0 comments
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

code423n4 commented Sep 1, 2022

no need for these curly brackets { }

Finding

File:   /src/modules/PRICE.sol

  {
            (, int256 ohmEthPriceInt, , uint256 updatedAt, ) = _ohmEthPriceFeed.latestRoundData();
             …
            reserveEthPrice = uint256(reserveEthPriceInt);
        }

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/PRICE.sol#L160-L174

It is better to emit the oldDebt

Finding

File:         /main/src/modules/TRSRY.sol

emit DebtSet(token_, debtor_, amount_);

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/TRSRY.sol#L134

Check for address(0)

Finding

File:           /main/src/modules/TRSRY.sol

 function setDebt(
        ERC20 token_,
        address debtor_,
        uint256 amount_
    ) external permissioned {
        uint256 oldDebt = reserveDebt[token_][debtor_];

        reserveDebt[token_][debtor_] = amount_;

        if (oldDebt < amount_) totalDebt[token_] += amount_ - oldDebt;
        else totalDebt[token_] -= oldDebt - amount_;

        emit DebtSet(token_, debtor_, amount_);
    }

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/TRSRY.sol#L122-L135
https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/TreasuryCustodian.sol#L42-L48

Not the better pattern

It is better to make it as the other line above it. Like this one
_range.cushion.low.price = (movingAverage_ * (FACTOR_SCALE - cushionSpread)) / FACTOR_SCALE;

Finding

File:      /main/src/modules/RANGE.sol

        _range.cushion.high.price =
            (movingAverage_ * (FACTOR_SCALE + cushionSpread)) /
            FACTOR_SCALE;

https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/RANGE.sol#L168-L170

unnecessary invoking

These two invokes don’t do anything they are keep every thing the same
But if you trying to set the capacity to zero this is no how you do it

Finding

File:  /main/src/policies/Operator.sol

        _updateCapacity(true, 0);
        _updateCapacity(false, 0);

https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Operator.sol#L202-L203

@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 Sep 1, 2022
code423n4 added a commit that referenced this issue Sep 1, 2022
code423n4 added a commit that referenced this issue Sep 1, 2022
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

1 participant