QA Report #270
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
Summary
Low Risk Issues
Non-critical Issues
Total: instances over issues
Low Risk Issues
Missing modifier specified in comment
The function does not check the status of the task. You can set an inactive status and unapprove a subcontractor for a task that is already inactive or even completed.
fix:
SignatureDecoder.recoverKey and ecrecover does not check for zero address
The solidity ecrecover function is called directly to verify the given signatures. However, the ecrecover EVM opcode allows malleable (non-unique) signatures and thus is susceptible to replay attacks. A replay attack may not be possible here, but ensuring the signatures are not malleable is considered a best practice.
fix:
Incomplite action type control.
resolveHandler calls executeTaskPay if the action type is neither ActionType.TaskAdd nor ActionType.TaskChange. But apart from ActionType.TaskPay there is a possibility that the action type can be set to ActionType.None.
At least it is more readable. But it can be used(theoretically) to call executeTaskPay, which will release subcontractor payment.
fix:
Non-critical Issues
Use struct in mapping instead of casting struct to uint256
Optional fix, looks more informative, but slightly increases deployment gas due to enum import in the contract.
fix:
Remove tautological code.
fix:
++_community.publishNonce;
Use built-in constants instead of a number
fix:
Misleading comment
Comment probably copied from a nearby function and is misleading about the function's purpose.
redundant cast uint256 to uint256.
Missing initializer modifier on constructor
OpenZeppelin recommends that the initializer modifier be applied to constructors:
The guidelines are now to make it impossible for anyone to run initialize on an implementation contract, by adding an empty constructor with the initializer modifier. So the implementation contract gets initialized automatically upon deployment.
fix: add constructor() initializer {}
The text was updated successfully, but these errors were encountered: