L-1. Large number of elements may cause out-of-gas error
Description
Loops that do not have a fixed number of iterations, for example, loops that depend on storage values, have to be used carefully: Due to the block gas limit, transactions can only consume a certain amount of gas. Either explicitly or just due to normal operation, the number of iterations in a loop can grow beyond the block gas limit, which can cause the complete contract to be stalled at a certain point.
According to Order of Layout, inside each contract, library or interface, use the following order:
1) Type declarations
2) State variables
3) Events
4) Modifiers
5) Functions
Place events after state variables, modifier - before constructor.
#
NC-2. Floating pragma
Description
Contracts should be deployed with the same compiler version. It helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.
Instances
All 20 contracts.
Recommendation
According to SWC-103, pragma version should be locked.
#
NC-3. Missing NatSpec
Description
NatSpec is missing for 53 functions in 8 contracts.
QA Report for Art Gobblers contest
Overview
During the audit, 1 low and 5 non-critical issues were found.
Low Risk Findings (1)
L-1. Large number of elements may cause out-of-gas error
Description
Loops that do not have a fixed number of iterations, for example, loops that depend on storage values, have to be used carefully: Due to the block gas limit, transactions can only consume a certain amount of gas. Either explicitly or just due to normal operation, the number of iterations in a loop can grow beyond the block gas limit, which can cause the complete contract to be stalled at a certain point.
Instances
Recommendation
Restrict the maximum number of elements.
Non-Critical Risk Findings (5)
NC-1. Order of Layout
Description
According to Order of Layout, inside each contract, library or interface, use the following order: 1) Type declarations 2) State variables 3) Events 4) Modifiers 5) Functions
Instances
Events before state variables:
Modifier after constructor:
Recommendation
Place events after state variables, modifier - before constructor.
#
NC-2. Floating pragma
Description
Contracts should be deployed with the same compiler version. It helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.
Instances
All 20 contracts.
Recommendation
According to SWC-103, pragma version should be locked.
#
NC-3. Missing NatSpec
Description
NatSpec is missing for 53 functions in 8 contracts.
Instances
Recommendation
Add NatSpec for all functions.
#
NC-4. Public functions can be external
Description
If functions are not called by the contract where they are defined, they can be declared external.
Instances
Recommendation
Make public functions external, where possible.
#
NC-5. Scientific notation may be used
Description
For readability, it is better to use scientific notation.
Instances
Recommendation
Replace
10000
with10e4
.