Skip to content

Instantly share code, notes, and snippets.

@IllIllI000
Last active October 5, 2023 21:06
Show Gist options
  • Save IllIllI000/cc63bcd6a853c0e55a23340fe8a556e1 to your computer and use it in GitHub Desktop.
Save IllIllI000/cc63bcd6a853c0e55a23340fe8a556e1 to your computer and use it in GitHub Desktop.
@CloudEllie
Copy link

Judge comments:

| [M‑01] | Direct supportsInterface() calls may cause caller to revert | 1 | L |
| [M‑02] | Contracts are vulnerable to fee-on-transfer accounting-related issues | 1 | L |
| [M‑03] | Excess funds sent via msg.value not refunded | 1 | L |
| [M‑04] | The owner is a single point of failure and a centralization risk | 34 | M |
| [M‑05] | Unsafe use of transfer()/transferFrom() with IERC20 | 1 | M |
| [M‑06] | Return values of transfer()/transferFrom() not checked | 1 | M |
| [M‑07] | Don't use payable.transfer()/payable.send() | 1 | L |
| [L‑01] | Division by zero not prevented | 1 | I |
| [L‑02] | Missing checks for address(0x0) when assigning values to address state variables | 9 | L |
| [L‑03] | Solidity version 0.8.20 may not work on other chains due to PUSH0 | 23 | I |
| [L‑04] | Unsafe downcast | 19 | L |
| [L‑05] | Loss of precision | 6 | L |
| [L‑06] | Array lengths not checked | 1 | R |
| [L‑07] | Owner can renounce while system is paused | 3 | L |
| [L‑08] | Missing checks for address(0x0) when assigning values to address state variables | 4 | L |
| [L‑09] | require() should be used instead of assert() | 3 | L |
| [L‑10] | External calls in an un-bounded for-loop may result in a DOS | 6 | L |
| [N‑01] | Use OpenZeppelin's MerkleProof rather than rolling your own | 1 | I |
| [N‑02] | Events are missing sender information | 5 | NC |
| [N‑03] | Variables need not be initialized to zero | 67 | R |
| [N‑04] | Consider using named mappings | 18 | NC |
| [N‑05] | Non-external/public variable and function names should begin with an underscore | 88 | R |
| [N‑06] | Use abi.encodeCall() instead of abi.encodeSignature()/abi.encodeSelector() | 2 | L |
| [N‑07] | Constants in comparisons should appear on the left side | 44 | NC |
| [N‑08] | Variable names don't follow the Solidity style guide | 5 | NC |
| [N‑09] | Contracts containing only utility functions should be made into libraries | 1 | R |
| [N‑10] | Custom error has no error details | 58 | NC |
| [N‑11] | Events may be emitted out of order due to reentrancy | 4 | NC |
| [N‑12] | Imports could be organized more systematically | 4 | NC |
| [N‑13] | Long functions should be refactored into multiple, smaller, functions | 2 | I |
| [N‑14] | Mixed usage of int/uint with int256/uint256 | 1 | NC |
| [N‑15] | Unsafe conversion from unsigned to signed values | 1 | I |
| [N‑16] | Adding a return statement when the function defines a named return variable, is redundant | 1 | R |
| [N‑17] | public functions not called by the contract should be declared external instead | 11 | R |
| [N‑18] | 2**<n> - 1 should be re-written as type(uint<n>).max | 1 | R |
| [N‑19] | constants should be defined rather than using magic numbers | 46 | R |
| [N‑20] | Event is not properly indexed | 17 | I |
| [N‑21] | require()/revert() statements should have descriptive reason strings | 1 | NC |
| [N‑22] | Non-assembly method available | 1 | NC |
| [N‑23] | Missing event and or timelock for critical parameter change | 2 |
| [N‑24] | Events that mark critical parameter changes should contain both the old and the new value | 3 | NC |
| [N‑25] | Use a more recent version of solidity | 1 |
| [N‑26] | Constant redefined elsewhere | 4 | R |
| [N‑27] | Lines are too long | 12 | NC |
| [N‑28] | Variable names that consist of all capital letters should be reserved for constant/immutable variables | 3 | R |
| [N‑29] | Non-library/interface files should use fixed compiler versions, not floating ones | 1 | NC |
| [N‑30] | Typos | 1 | NC |
| [N‑31] | Constructor visibility is ignored | 1 |
| [N‑32] | File is missing NatSpec | 5 | NC |
| [N‑33] | NatSpec @param is missing | 76 | NC |
| [N‑34] | NatSpec @return argument is missing | 29 | NC |
| [N‑35] | Function ordering does not follow the Solidity style guide | 43 | NC |
| [N‑36] | Contract does not follow the Solidity style guide's suggested layout ordering | 21 | NC |
| [N‑37] | Control structures do not follow the Solidity Style Guide | 9 | NC |
| [N‑38] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 3 | I |
| [N‑39] | Consider using delete rather than assigning zero/false to clear values | 5 | I |
| [N‑40] | Contracts should have full test coverage | 1 | I |
| [N‑41] | Large or complicated code bases should implement invariant tests | 1 | I |
| [G‑01] | Reduce gas usage by moving to Solidity 0.8.19 or later | 23 | - | I |
| [G‑02] | State variables only set in the constructor should be declared immutable | 2 | 4194 | L |
| [G‑03] | Structs can be packed into fewer storage slots | 2 | - | L |
| [G‑04] | Using storage instead of memory for structs/arrays saves gas | 19 | 79800 | L |
| [G‑05] | <x> += <y> costs more gas than <x> = <x> + <y> for state variables | 2 | 226 | NC |
| [G‑06] | internal functions only called once can be inlined to save gas | 9 | 180 | I |
| [G‑07] | Add unchecked {} for subtractions where the operands cannot underflow because of a previous require() or if-statement | 1 | 85 | NC |
| [G‑08] | <array>.length should not be looked up in every loop of a for-loop | 41 | 123 | NC |
| [G‑09] | ++i/i++ should be unchecked{++i}/unchecked{i++} when it is not possible for them to overflow, as is the case when used in for- and while-loops | 60 | 3600 | NC |
| [G‑10] | Optimize names to save gas | 20 | 440 | I |
| [G‑11] | Using bools for storage incurs overhead | 3 | 51300 | I |
| [G‑12] | Use a more recent version of solidity | 23 | - | I |
| [G‑13] | ++i costs less gas than i++, especially when it's used in for-loops (--i/i-- too) | 2 | 10 | NC |
| [G‑14] | Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 20 | - | I |
| [G‑15] | Using private rather than public for constants, saves gas | 2 | - | I |
| [G‑16] | I |nverting the condition of an if-else-statement wastes gas | 1 | - | I |
| [G‑17] | Division by two should use bit shifting | 2 | 40 | NC |
| [G‑18] | Stack variable used as a cheaper cache for a state variable is only used once | 2 | 6 | NC |
| [G‑19] | Empty blocks should be removed or emit something | 1 | - | NC |
| [G‑20] | Superfluous event fields | 4 | - | NC |
| [G‑21] | Functions guaranteed to revert when called by normal users can be marked payable | 44 | 924 | I |
| [G‑22] | Constructors can be marked payable | 15 | 315 | I |
| [G‑23] | Not using the named return variables anywhere in the function is confusing | 24 | - | Already awarded |

@thebrittfactor
Copy link

Per sponsor via discord:

  1. presumes EOA as owner, which is not the case, not valid for us.
  2. confirmed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment