QA Report #120
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
Low
1. Outdated compiler
The pragma version used are:
The minimum required version must be 0.8.15; otherwise, contracts will be affected by the following important bug fixes:
0.8.13:
abi.encodeCall
in place of fixed bytes arguments.0.8.14:
calldatasize()
in all cases.0.8.15
bytes
arrays.Apart from these, there are several minor bug fixes and improvements.
2. Lack of checks
The following methods have a lack checks if the received argument is an address, it's good practice in order to reduce human error to check that the address specified in the constructor or initialize is different than
address(0)
.Affected source code:
In the following lines, ether is burned if
address(0)
is used asrefundAddress
:3. Upgradable contracts without GAP can lead a upgrade disaster
Some contract does not implement a good upgradeable logic.
Proxied contracts MUST include an empty reserved space in storage, usually named
__gap
, in all the inherited contracts.For example, if it is an interface, you have to use the
interface
keyword, otherwise it is a contract that requires your GAP to be correctly updated, so if a new variable is created it could lead in storage collisions that will produce a contract dissaster, including loss of funds.Reference:
Affected source code:
4. Ether could be blocked
The user's ether could be locked and unrecoverable.
Because to transfer ether the
.transfer
method (which is capped at 2300 gas) is used instead of.call
which is limited to the gas provided by the user. If a contract that has afallback
method more expensive than 2300 gas, creates an offer, it will be impossible for this contract cancel the offer or receive funds back to that address.Reference:
Affected source code:
5. Unsafe ERC20 calls
The following code doesn't check the result of the ERC20 calls. ERC20 standard specify that the token can return false if these calls fails, so it's mandatory to check the result of these ERC20 methods.
Reference:
Affected source code for
approve
:Non-Critical
6. Packages with vulnerabilities
The project contains packages that urgently need to be updated because they contain important vulnerabilities.
55 vulnerabilities (15 moderate, 37 high, 3 critical)
npm audit report:
7. Use
encode
instead ofencodePacked
for hashigUse of
abi.encodePacked
is safe, but unnecessary and not recommended.abi.encodePacked
can result in hash collisions when used with two dynamic arguments (string/bytes).There is also discussion of removing
abi.encodePacked
from future versions of Solidity (ethereum/solidity#11593), so usingabi.encode
now will ensure compatibility in the future.Affected source code:
The text was updated successfully, but these errors were encountered: