-
Notifications
You must be signed in to change notification settings - Fork 0
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 #70
Comments
ComparisonsComparison that should be inclusive in NestedRecords.sol (Disputed)At the moment of storing, the comparison should be inclusive. If not, we are exceeding the VariablesMissing Address(0) checks (Confirmed)Check if a value is in an array before a push (Duplicated)Variables that should be grouped together in a struct (Acknowledged)I prefer to keep it simple. ArithmeticsPossible division by 0 (Disputed)_totalWeights = 0 should not happen, and if it’s the case a panic error is fine. Revert StringsMixinOperatorResolver: Inconsistent Revert string (Confirmed)MixinOperatorResolver : Misleading + Inconsistent Revert string (Duplicated)OwnableProxyDelegation: Inconsistent Revert string 1 & 2 (Confirmed)ZeroExOperator: Inconsistent Revert string 1 & 2 (Confirmed)CommentsNestedFactory: Missing comment 1 & 3 (Confirmed)NestedFactory: Missing comment 2 (Disputed)The second return param comment is here. NestedRecords: Missing comment 1 & 2 (Confirmed)NestedRecords: Misleading comment on « @return » (Confirmed)MixinOperatorResolver: Missing comments 1 & 2 (Confirmed) |
My personal judgements:
|
Adding in the reduced severity finding #59: |
Now, here is the methodology I used for calculating a score for each QA report. I first assigned each submission to be either non-critical (1 point), very-low-critical (5 points) or low-critical (10 points), depending on how severe/useful the issue is. The score of a QA report is the sum of these points, divided by the maximum number of points achieved by a QA report. This maximum number was 26 points, achieved by #66. The number of points achieved by this report is 25 points. |
QA Report
Table of Contents:
Foreword
@audit
tagsComparisons
Comparison that should be inclusive in NestedRecords.sol
As length isn't 0 indexed, I believe, as an example to illustrate, that if
maxHoldingsCount == 1
, thenrecords[_nftId].tokens.length == 1
should be a passing condition. Therefore, I suggest changing<
with<=
Variables
Missing Address(0) checks
Check if a value is in an array before a push
In
NestedRecords.sol
'sstore
function, it's possible to push an existingaddress _token
several times in the same arrayThe previous lines of codes don't prevent this.
The
store
function has the modifieronlyFactory
and the only impact seem to be a possible maximization ofrecords[_nftId].tokens.length
(so that it reachesmaxHoldingsCount
).Variables that should be grouped together in a struct
For maps that use the same key value: having separate fields is error prone (like in case of deletion or future new fields).
By regrouping, it's then possible to delete all related fields with a simple
delete newStruct[previousSameKeyForAllPreviousMaps]
.File: FeeSplitter.sol
2 maps can be grouped together, as they use the same
_account
key:I'd suggest these 2 related data get grouped in a struct, let's name it
AccountInfo
:And it would be used in this manner (where
address
is_account
):Arithmetics
Possible division by 0
There are no checks that the denominator is
!= 0
here:Revert Strings
File: NestedFactory.sol
Inconsistent Revert string
All other revert strings in
NestedAsset.sol
begin withNA:
. Only this one doesn't. It's possible to gain consistency and still have an < 32 bytes size string with the following:"NA: URI query - inexistent token"
File: MixinOperatorResolver.sol
Inconsistent Revert string (1)
Here,
"OH: INVALID_OUTPUT_TOKEN"
should be replaced with"MOR: INVALID_OUTPUT_TOKEN"
Misleading + Inconsistent Revert string (2)
Here,
"OH: INVALID_OUTPUT_TOKEN"
should be replaced with"MOR: INVALID_INPUT_TOKEN"
File: OwnableProxyDelegation.sol
Inconsistent Revert string (1)
Is most contracts, the capital letters from the contract's name are used as a prefix in the revert strings (
OwnableFactoryHandler
hasOFH
,MixinOperatorResolver
hasMOR
). Here,OFP
doesn't really reflectOwnableProxyDelegation
. It should beOPD
.Inconsistent Revert string (2)
Same as above:
OFP
should beOPD
.File: ZeroExOperator.sol
Inconsistent Revert string (1)
As said before, the capital letters from the contract's name are used as a prefix in the revert strings. Here, the revert string's size is > 32 bytes and isn't using the same style as 4 lines above it.
ZeroExOperator::performSwap
should beZEO
.Inconsistent Revert string (2)
Same as above:
ZeroExOperator::performSwap
should beZEO
.Comments
File: NestedFactory.sol
Missing comment "@return" (1)
Missing comment "@return" (2)
Missing comment "@param" (1)
File: NestedRecords.sol
Missing comment "@return" (1)
Missing comment "@return" (2)
Misleading comment on "@return"
Here, the comment
@return The holdings
, which is the unique@return
comment, suggests a returnedmapping(address => uint256) holdings
as seen onstruct NftRecord
. However, the function is actually returning auint256[]
and anaddress[]
. Therefore, two@return
are required and the previous one should be deleted.Code:
File: MixinOperatorResolver.sol
Missing 2 comments "@param" & changeable "@return" comment/variable
I suggest changing the returned uint256[] to uint256[2]
File: ExchangeHelpers.sol
Missing comment "@return"
The text was updated successfully, but these errors were encountered: