code-423n4 / 2022-06-infinity-findings

4 stars 0 forks source link

QA Report #323

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

QA Report: Low risk

Inappropriate use of >= 0 check of uint variable

Explanation: The user should receive the message when totalStaked = 0

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L193

    require(totalStaked >= 0, 'nothing staked to rage quit');

Change totalStaked >= 0 to totalStaked > 0

QA Report: non-critical

Typos

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L58

  /// @dev This is the adress that is used to send auto sniped orders for execution on chain

Change adress to address

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L77

  /// @dev Storate variable that keeps track of valid currencies (tokens)

Change Storate to Storage

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L30

          either by staking the specified number of tokens for no duration or a less number of tokens but with higher durations.

Change less to lower

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L112

   * @notice Untake tokens

Change Untake to Unstake

Scientific notation is preferable to using exponentiation

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L237

            (userstakedAmounts[user][Duration.TWELVE_MONTHS].amount * 4)) / (10**18);

Suggestion: Change 10**18 to 1e18

10**4 occurs in both lines referenced below:

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L1161

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityOrderBookComplication.sol#L338

    uint256 PRECISION = 10**4; // precision for division; similar to bps

Suggestion: Change 10**4 to 1e4 in both cases