Variable InfinityExchange.MATCH_EXECUTOR (contracts/core/InfinityExchange.sol#59) is too similar to InfinityExchange.updateMatchExecutor(address)._matchExecutor (contracts/core/InfinityExchange.sol#1255)
Variable InfinityExchange.MATCH_EXECUTOR (contracts/core/InfinityExchange.sol#59) is too similar to InfinityExchange.constructor(address,address)._matchExecutor (contracts/core/InfinityExchange.sol#104)
Variable InfinityExchange._matchOneToOneOrders(OrderTypes.MakerOrder,OrderTypes.MakerOrder,uint256,uint256,uint16,uint32,address).makerOrder1 (contracts/core/InfinityExchange.sol#575) is too similar to InfinityExchange._matchOneToOneOrders(OrderTypes.MakerOrder,OrderTypes.MakerOrder,uint256,uint256,uint16,uint32,address).makerOrder2 (contracts/core/InfinityExchange.sol#576)
Variable InfinityExchange._matchOneToOneOrders(OrderTypes.MakerOrder,OrderTypes.MakerOrder,uint256,uint256,uint16,uint32,address).makerOrder1 (contracts/core/InfinityExchange.sol#575) is too similar to InfinityExchange.takeOrders(OrderTypes.MakerOrder[],OrderTypes.OrderItem[][]).makerOrders (contracts/core/InfinityExchange.sol#336)
Variable InfinityExchange._matchOneToOneOrders(OrderTypes.MakerOrder,OrderTypes.MakerOrder,uint256,uint256,uint16,uint32,address).makerOrder1 (contracts/core/InfinityExchange.sol#575) is too similar to InfinityExchange.takeMultipleOneOrders(OrderTypes.MakerOrder[]).makerOrders (contracts/core/InfinityExchange.sol#300)
Variable InfinityExchange._matchOneToOneOrders(OrderTypes.MakerOrder,OrderTypes.MakerOrder,uint256,uint256,uint16,uint32,address).makerOrder2 (contracts/core/InfinityExchange.sol#576) is too similar to InfinityExchange.takeMultipleOneOrders(OrderTypes.MakerOrder[]).makerOrders (contracts/core/InfinityExchange.sol#300)
Variable InfinityExchange._matchOneToOneOrders(OrderTypes.MakerOrder,OrderTypes.MakerOrder,uint256,uint256,uint16,uint32,address).makerOrder2 (contracts/core/InfinityExchange.sol#576) is too similar to InfinityExchange.takeOrders(OrderTypes.MakerOrder[],OrderTypes.OrderItem[][]).makerOrders (contracts/core/InfinityExchange.sol#336)
Variable InfinityExchange.matchOneToOneOrders(OrderTypes.MakerOrder[],OrderTypes.MakerOrder[]).makerOrders1 (contracts/core/InfinityExchange.sol#133) is too similar to InfinityExchange.matchOneToOneOrders(OrderTypes.MakerOrder[],OrderTypes.MakerOrder[]).makerOrders2 (contracts/core/InfinityExchange.sol#134)
Variable InfinityOrderBookComplication.doTokenIdsIntersect(OrderTypes.OrderItem,OrderTypes.OrderItem).item1TokensLength (contracts/core/InfinityOrderBookComplication.sol#283) is too similar to InfinityOrderBookComplication.doTokenIdsIntersect(OrderTypes.OrderItem,OrderTypes.OrderItem).item2TokensLength (contracts/core/InfinityOrderBookComplication.sol#284)
Variable IComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder1 (contracts/interfaces/IComplication.sol#24) is too similar to IComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder2 (contracts/interfaces/IComplication.sol#24)
Variable InfinityOrderBookComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder1 (contracts/core/InfinityOrderBookComplication.sol#26) is too similar to InfinityOrderBookComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder2 (contracts/core/InfinityOrderBookComplication.sol#26)
Variable IComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder1 (contracts/interfaces/IComplication.sol#24) is too similar to InfinityOrderBookComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder2 (contracts/core/InfinityOrderBookComplication.sol#26)
Variable InfinityOrderBookComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder1Price (contracts/core/InfinityOrderBookComplication.sol#43) is too similar to InfinityOrderBookComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder2Price (contracts/core/InfinityOrderBookComplication.sol#44)
Variable InfinityOrderBookComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder1 (contracts/core/InfinityOrderBookComplication.sol#26) is too similar to IComplication.canExecMatchOneToOne(OrderTypes.MakerOrder,OrderTypes.MakerOrder).makerOrder2 (contracts/interfaces/IComplication.sol#24)
Variable InfinityOrderBookComplication.doItemsIntersect(OrderTypes.OrderItem[],OrderTypes.OrderItem[]).order1NftsLength (contracts/core/InfinityOrderBookComplication.sol#237) is too similar to InfinityOrderBookComplication.doItemsIntersect(OrderTypes.OrderItem[],OrderTypes.OrderItem[]).order2NftsLength (contracts/core/InfinityOrderBookComplication.sol#238)
Variable InfinityStaker.INFINITY_TREASURY (contracts/staking/InfinityStaker.sol#27) is too similar to InfinityStaker.updateInfinityTreasury(address)._infinityTreasury (contracts/staking/InfinityStaker.sol#375)
Variable InfinityStaker.INFINITY_TREASURY (contracts/staking/InfinityStaker.sol#27) is too similar to InfinityStaker.constructor(address,address)._infinityTreasury (contracts/staking/InfinityStaker.sol#49)
Function ERC20Permit.DOMAIN_SEPARATOR() (node_modules/@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol#73-75) is not in mixedCase
Variable ERC20Permit._PERMIT_TYPEHASH (node_modules/@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol#28-29) is not in mixedCase
Function IERC20Permit.DOMAIN_SEPARATOR() (node_modules/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol#59) is not in mixedCase
Parameter ERC721.safeTransferFrom(address,address,uint256,bytes)._data (node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#179) is not in mixedCase
Variable EIP712._CACHED_DOMAIN_SEPARATOR (node_modules/@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol#31) is not in mixedCase
Variable EIP712._CACHED_CHAIN_ID (node_modules/@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol#32) is not in mixedCase
Variable EIP712._CACHED_THIS (node_modules/@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol#33) is not in mixedCase
Variable EIP712._HASHED_NAME (node_modules/@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol#35) is not in mixedCase
Variable EIP712._HASHED_VERSION (node_modules/@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol#36) is not in mixedCase
Variable EIP712._TYPE_HASH (node_modules/@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol#37) is not in mixedCase
Parameter InfinityExchange.addCurrency(address)._currency (contracts/core/InfinityExchange.sol#1235) is not in mixedCase
Parameter InfinityExchange.addComplication(address)._complication (contracts/core/InfinityExchange.sol#1240) is not in mixedCase
Parameter InfinityExchange.removeCurrency(address)._currency (contracts/core/InfinityExchange.sol#1245) is not in mixedCase
Parameter InfinityExchange.removeComplication(address)._complication (contracts/core/InfinityExchange.sol#1250) is not in mixedCase
Parameter InfinityExchange.updateMatchExecutor(address)._matchExecutor (contracts/core/InfinityExchange.sol#1255) is not in mixedCase
Parameter InfinityExchange.updateWethTranferGas(uint32)._wethTransferGasUnits (contracts/core/InfinityExchange.sol#1260) is not in mixedCase
Parameter InfinityExchange.setProtocolFee(uint16)._protocolFeeBps (contracts/core/InfinityExchange.sol#1266) is not in mixedCase
Variable InfinityExchange.WETH (contracts/core/InfinityExchange.sol#55) is not in mixedCase
Variable InfinityExchange.DOMAIN_SEPARATOR (contracts/core/InfinityExchange.sol#57) is not in mixedCase
Variable InfinityExchange.MATCH_EXECUTOR (contracts/core/InfinityExchange.sol#59) is not in mixedCase
Variable InfinityExchange.WETH_TRANSFER_GAS_UNITS (contracts/core/InfinityExchange.sol#61) is not in mixedCase
Variable InfinityExchange.PROTOCOL_FEE_BPS (contracts/core/InfinityExchange.sol#63) is not in mixedCase
Parameter InfinityStaker.updateInfinityTreasury(address)._infinityTreasury (contracts/staking/InfinityStaker.sol#375) is not in mixedCase
Variable InfinityStaker.INFINITY_TOKEN (contracts/staking/InfinityStaker.sol#25) is not in mixedCase
Variable InfinityStaker.INFINITY_TREASURY (contracts/staking/InfinityStaker.sol#27) is not in mixedCase
Variable InfinityStaker.BRONZE_STAKE_THRESHOLD (contracts/staking/InfinityStaker.sol#33) is not in mixedCase
Variable InfinityStaker.SILVER_STAKE_THRESHOLD (contracts/staking/InfinityStaker.sol#34) is not in mixedCase
Variable InfinityStaker.GOLD_STAKE_THRESHOLD (contracts/staking/InfinityStaker.sol#35) is not in mixedCase
Variable InfinityStaker.PLATINUM_STAKE_THRESHOLD (contracts/staking/InfinityStaker.sol#36) is not in mixedCase
Variable InfinityStaker.THREE_MONTH_PENALTY (contracts/staking/InfinityStaker.sol#40) is not in mixedCase
Variable InfinityStaker.SIX_MONTH_PENALTY (contracts/staking/InfinityStaker.sol#41) is not in mixedCase
Variable InfinityStaker.TWELVE_MONTH_PENALTY (contracts/staking/InfinityStaker.sol#42) is not in mixedCase
Variable TimelockConfig._config (contracts/token/TimelockConfig.sol#28) is not in mixedCase
Variable TimelockConfig._configSet (contracts/token/TimelockConfig.sol#29) is not in mixedCase
Variable TimelockConfig._pending (contracts/token/TimelockConfig.sol#31) is not in mixedCase
Variable TimelockConfig._pendingSet (contracts/token/TimelockConfig.sol#32) is not in mixedCase
Pragma version0.8.14 (contracts/MockERC20.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/MockERC721.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/core/InfinityExchange.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/core/InfinityOrderBookComplication.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/interfaces/IComplication.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/interfaces/IStaker.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/libs/OrderTypes.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/libs/SignatureChecker.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/staking/InfinityStaker.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/token/InfinityToken.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
Pragma version0.8.14 (contracts/token/TimelockConfig.sol#2) necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.7
InfinityExchange.addCurrency(address) (contracts/core/InfinityExchange.sol#1235-1237) ignores return value by _currencies.add(_currency) (contracts/core/InfinityExchange.sol#1236)
InfinityExchange.addComplication(address) (contracts/core/InfinityExchange.sol#1240-1242) ignores return value by _complications.add(_complication) (contracts/core/InfinityExchange.sol#1241)
InfinityExchange.removeCurrency(address) (contracts/core/InfinityExchange.sol#1245-1247) ignores return value by _currencies.remove(_currency) (contracts/core/InfinityExchange.sol#1246)
InfinityExchange.removeComplication(address) (contracts/core/InfinityExchange.sol#1250-1252) ignores return value by _complications.remove(_complication) (contracts/core/InfinityExchange.sol#1251)
TimelockConfig.confirmChange(bytes32) (contracts/token/TimelockConfig.sol#50-62) ignores return value by _configSet.add(configId) (contracts/token/TimelockConfig.sol#55)
TimelockConfig.confirmChange(bytes32) (contracts/token/TimelockConfig.sol#50-62) ignores return value by _pendingSet.remove(configId) (contracts/token/TimelockConfig.sol#58)
TimelockConfig._setRawConfig(bytes32,uint256) (contracts/token/TimelockConfig.sol#66-72) ignores return value by _configSet.add(configId) (contracts/token/TimelockConfig.sol#67)
Recommendation
Ensure that all the return values of the function calls are used.
InfinityOrderBookComplication._getCurrentPrice(OrderTypes.MakerOrder) (contracts/core/InfinityOrderBookComplication.sol#330-342) performs a multiplication on the result of a division:
-priceDiff = (priceDiff * portionBps) / PRECISION (contracts/core/InfinityOrderBookComplication.sol#340)
-portionBps = ((elapsedTime * PRECISION) / duration) (contracts/core/InfinityOrderBookComplication.sol#339)
InfinityToken.advanceEpoch() (contracts/token/InfinityToken.sol#60-82) performs a multiplication on the result of a division:
-epochsPassedSinceLastAdvance = (block.timestamp - previousEpochTimestamp) / getEpochDuration() (contracts/token/InfinityToken.sol#65)
-supplyToMint = getInflation() * epochsPassedSinceLastAdvance (contracts/token/InfinityToken.sol#76)
-epochsPassedSinceLastAdvance = epochsPassedSinceLastAdvance (contracts/token/InfinityToken.sol#67-69)
Too many digits
Information : Too many digits
Instances include :
Recommendation
Use the scientific notation
Variable names too similar
Information : Variable names too similar
Instances include :
Recommendation
Prevent variables from having similar names.
Conformance to Solidity naming conventions
Information : Conformance to Solidity naming conventions Naming convention
Instances include :
Recommendation
Follow the Solidity naming convention.
Low-level calls
Information : Low-level calls
Instances include :
Recommendation
Avoid low-level calls. Check the call success. If the call is meant for a contract, check for code existence.
Incorrect versions of Solidity
solc-0.8.14 is not recommended for deployment
Information : Incorrect versions of Solidity
Instances include :
Recommendation
Consider deploying with 0.6.12/0.7.6/0.8.7
Block timestamp
Information : Block timestamp
Instances include :
Recommendation
Avoid relying on
block.timestamp
.Reentrancy vulnerabilities
Information : reentrancy-events check-effects-interactions pattern
Instances include :
Recommendation
Apply the check-effects-interactions pattern.
Calls inside a loop
Information : Calls inside a loop
Instances include :
Recommendation
Favor pull over push strategy for external calls.
Missing zero address validation
Missing zero address validation
Instances include :
Recommendation
Check that the address is not zero.
Missing events arithmetic
Information : Missing events arithmetic
Instances include :
Recommendation
Emit an event for critical parameter changes.
Unused return
Information : Unused return
Instances include :
Recommendation
Ensure that all the return values of the function calls are used.
Tautology or contradiction
Information : Tautology or contradiction
Instances include :
Recommendation
Fix the incorrect comparison by changing the value type or the comparison.
Divide before multiply
Information : Divide before multiply
Instances include :
Recommendation
Consider ordering multiplication before division.