Open code423n4 opened 2 years ago
>= 0
uint
Explanation: The user should receive the message when totalStaked = 0
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
totalStaked >= 0
totalStaked > 0
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
adress
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
Storate
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
less
lower
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L112
* @notice Untake tokens
Change Untake to Unstake
Untake
Unstake
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**18
1e18
10**4 occurs in both lines referenced below:
10**4
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
1e4
QA Report: Low risk
Inappropriate use of
>= 0
check ofuint
variableExplanation: The user should receive the message when
totalStaked = 0
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L193
Change
totalStaked >= 0
tototalStaked > 0
QA Report: non-critical
Typos
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L58
Change
adress
toaddress
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L77
Change
Storate
toStorage
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L30
Change
less
tolower
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L112
Change
Untake
toUnstake
Scientific notation is preferable to using exponentiation
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/staking/InfinityStaker.sol#L237
Suggestion: Change
10**18
to1e18
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
Suggestion: Change
10**4
to1e4
in both cases