-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QA Report #61
Comments
It's better to emit after all processing is done (Confirmed)Quality assurance confirmed |
3. OwnableProxyDelegation.initialize() is front-runnable in the solution (disputed) |
5. Funds can be locked (disputed)They are not supposed to be called outside of a delegateCall context |
1. Known vulnerabilities exist in currently used @openzeppelin/contracts version (duplicate)Duplicate in QA report #73 |
4. public functions not called by the contract should be declared external instead (duplicate)Duplicate in QA report #76 |
6. A magic number should be documented and explained. Use a constant instead (Duplicated)Duplicated of #76 at 5. constants should be defined rather than using magic numbers |
3. Adding a return statement when the function defines a named return variable, is redundant (confirmed)Confirmed Missed occurrences found in QA report #64
|
2. Missing address(0) checks (Confirmed)Quality assurance confirmed. Missing occurrences:
|
L-1: Known vulnerabilities exist in currently used @openzeppelin/contracts versionValid, upgrading is suggested. L-2: Missing address(0) checksNon-critical. L-3: OwnableProxyDelegation.initialize() is front-runnable in the solutionValid and surfaced in previous audit. L-4: Use a constant instead of duplicating the same stringNon-critical. Prefer not making changes. L-5: Funds can be lockedInvalid. L-6: A magic number should be documented and explained. Use a constant insteadValid, best practices, make changes when you see fit. N-1: It's better to emit after all processing is doneThe emit is done earlier to save gas, no? N-2: TyposValid. N-3: Adding a return statement when the function defines a named return variable, is redundantNon-critical. Prefer not making changes. N-4: public functions not called by the contract should be declared external insteadValid, but no need to make changes. |
Overview
Table of Contents
@openzeppelin/contracts
versionOwnableProxyDelegation.initialize()
is front-runnable in the solutionconstant
instead of duplicating the same stringconstant
insteadreturn
statement when the function defines a named return variable, is redundantpublic
functions not called by the contract should be declaredexternal
insteadLow Risk Issues
1. Known vulnerabilities exist in currently used
@openzeppelin/contracts
versionAs some known vulnerabilities exist in the current
@openzeppelin/contracts
version, consider updatingpackage.json
with at least@openzeppelin/[email protected]
here:https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/package.json#L65
While vulnerabilities are known, the current scope isn't affected (this might not hold true for the whole solution)
2. Missing address(0) checks
Consider adding an
address(0)
check for immutable variables:3.
OwnableProxyDelegation.initialize()
is front-runnable in the solutionI suggest adding some access control or atomically initializing the contract:
https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/abstracts/OwnableProxyDelegation.sol#L24-L32
4. Use a
constant
instead of duplicating the same string5. Funds can be locked
There isn't a withdraw mechanism and several payable methods are implemented:
6. A magic number should be documented and explained. Use a
constant
insteadSimilar issue in the past: here
I suggest using
constant
variables as this would make the code more maintainable and readable while costing nothing gas-wise (constants are replaced by their value at compile-time).Non-Critical Issues
1. It's better to emit after all processing is done
2. Typos
3. Adding a
return
statement when the function defines a named return variable, is redundantWhile not consuming more gas with the Optimizer enabled: using both named returns and a return statement isn't necessary. Removing one of those can improve code clarity.
Affected code:
4.
public
functions not called by the contract should be declaredexternal
insteadThe text was updated successfully, but these errors were encountered: