QA Report #2
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
Missing Slippage Protection
Missing slipage protection may lead to losing assets while swapping them. Without slipage protection the swapper is allowed to give much less worth of target tokens than it should in a fair swap.
to Missing slippage protection at:
Code instance:
Unsafe Cast
use openzeppilin's safeCast in:
Code instances:
Two arrays length mismatch
The functions below fail to perform input validation on arrays to verify the lengths match.
A mismatch could lead to an exception or undefined behavior.
Consider making this a medium risk please.
Div by 0
Division by 0 can lead to accidentally revert,
(An example of a similar issue - code-423n4/2021-10-defiprotocol-findings#84)
Code instances:
Not verified owner
Code instance:
Named return issue
Users can mistakenly think that the return value is the named return, but it is actually the actualreturn statement that comes after. To know that the user needs to read the code and is confusing.
Furthermore, removing either the actual return or the named return will save gas.
Code instances:
Two Steps Verification before Transferring Ownership
The following contracts have a function that allows them an admin to change it to a different address. If the admin accidentally uses an invalid address for which they do not have the private key, then the system gets locked.
It is important to have two steps admin change where the first is announcing a pending new admin and the new address should then claim its ownership.
A similar issue was reported in a previous contest and was assigned a severity of medium: code-423n4/2021-06-realitycards-findings#105
Code instances:
Assert instead require to validate user inputs
Code instance:
Never used parameters
Those are functions and parameters pairs that the function doesn't use the parameter. In case those functions are external/public this is even worst since the user is required to put value that never used and can misslead him and waste its time.
Code instances:
Check transfer receiver is not 0 to avoid burned money
Transferring tokens to the zero address is usually prohibited to accidentally avoid "burning" tokens by sending them to an unrecoverable zero address.
Code instances:
Missing commenting
Code instance:
Add a timelock
To give more trust to users: functions that set key/critical variables should be put behind a timelock.
Code instances:
Missing fee parameter validation
Some fee parameters of functions are not checked for invalid values. Validate the parameters:
Code instances:
Require with empty message
The following requires are with empty messages.
This is very important to add a message for any require. So the user has enough information to know the reason of failure.
Code instances:
Require with not comprehensive message
The following requires has a non comprehensive messages.
This is very important to add a comprehensive message for any require. Such that the user has enough
information to know the reason of failure:
Code instances:
Not verified input
external / public functions parameters should be validated to make sure the address is not 0.
Otherwise if not given the right input it can mistakenly lead to loss of user funds.
Code instances:
Solidity compiler versions mismatch
The project is compiled with different versions of solidity, which is not recommended because it can lead to undefined behaviors.
Code instance:
Use safe math for solidity version <8
You should use safe math for solidity version <8 since there is no default over/under flow check it suchversions of solidity.
Code instances:
The text was updated successfully, but these errors were encountered: