QA Report #377
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
valid
[L-01] The function changeOrder doesn't follow the check-effects-interaction pattern
Impact
Wherever possible, the contract should follow the check-effects-interaction pattern.
On the
changeOrder
function, the state is modifiedtasks[_taskID].cost = _newCost
after an external call is madeautoWithdraw(_withdrawDifference)
.https://github.com/code-423n4/2022-08-rigor/blob/main/contracts/Project.sol
If the external call throws, the state should be reverted. Also, since the value for
tasks[_taskID].cost
is already cached on the_taskCost
variable, updating the state before the external call shouldn't impact the bussiness logic.Recommended Mitigation Steps
Even if the function is already using the nonReetrant modifier, I would still recommend updating the state before making external calls.
[L-02] Lack of zero address check for critical input parameters
Critical inputs of type address should not be able to unintentionally receive the value zero.
Not checking agaist input address zero can cause misuse of tokens and force redeployments.
https://github.com/code-423n4/2022-08-rigor/blob/main/contracts/Project.sol
[NC-01] Avoid typo
There's a typo on the following comment.
https://github.com/code-423n4/2022-08-rigor/blob/main/contracts/libraries/SignatureDecoder.sol
[NC-02] Missing return for natspec
The function
signatureSplit
should contain a description of the returnedrsv
data. Consider adding the@return
tag to ensure natspec best practices.https://github.com/code-423n4/2022-08-rigor/blob/main/contracts/libraries/SignatureDecoder.sol
[NC-03] Public functions not consumed by the contract should be declared external
https://github.com/code-423n4/2022-08-rigor/blob/main/contracts/Community.sol
[NC-04] Use time units for calculations involving time
Instead of using the number of seconds, solidity allows the usage of time units such as days and weeks to improve redability.
https://github.com/code-423n4/2022-08-rigor/blob/main/contracts/Community.sol
The text was updated successfully, but these errors were encountered: