Open code423n4 opened 2 years ago
Low-impact Missing zero address checks is duplicate of #35 abi.encodePacked() is a valid suggestion upgradeable contract gap would add additional complexity, we did not explicitly design these contracts to be inherited from.
Non-critical
Multiple address mappings is not valid, the address keys for each mapping refer to different values.
Large multiples of ten this is a style choice (severity 0) that we will consider
Use a more recent version of solidity - duplicate of #103
Non-exploitable reentrancies - I do not think this is worth considering. We also already use nonReentrant
for this purpose.
I will maintain the severity of this issue due to the valid abi.encodePacked suggestion.
Low-impact Issues
Missing checks for
address(0x0)
when assigning values toaddress
state variablesabi.encodePacked()
should not be used with dynamic types when passing the result to a hash function such askeccak256()
Use
abi.encode()
instead which will pad items to 32 bytes, which will prevent hash collisions (e.g.abi.encodePacked(0x123,0x456)
=>0x123456
=>abi.encodePacked(0x1,0x23456)
, butabi.encode(0x123,0x456)
=>0x0...1230...456
). If there is only one argument toabi.encodePacked()
it can often be cast tobytes()
orbytes32()
instead.Upgradeable contract is missing a
__gap[50]
storage variable to allow for new storage variables in later versionsSee this link for a description of this storage variable. While some contracts may not currently be sub-classed, adding the variable now protects against forgetting to add it in the future.
Non-critical Issues
Multiple
address
mappings can be combined into a singlemapping
of anaddress
to astruct
, where appropriateLarge multiples of ten should use scientific notation (e.g.
1e6
) rather than decimal literals (e.g.1000000
), for readabilityUse a more recent version of solidity
Use a solidity version of at least 0.8.12 to get
string.concat()
to be used instead ofabi.encodePacked(<str>,<str>)
Non-exploitable reentrancies
Follow the best-practice of the Checks-Effects-Interactions pattern Reentrancy in Collateral.deposit(uint256) (contracts/core/Collateral.sol#52-93): External calls:
Reentrancy in PrePOMarketFactory.createMarket(string,string,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256) (contracts/core/PrePOMarketFactory.sol#42-82): External calls: