Home

Awesome

<h1 align=center><code>c4-common-issues</code></h1>

This repository aims to provide a list of issues found regularly in Code4Rena contests.

Introduction

Code4Rena runs community-driven contests for smart contract audits in which wardens search for issues and judges allocate awards to wardens based on performance.

A problem currently in the community is how to handle commonly found issues as they increase the judge's workload.

This repo aims to identify common issues and provide background information.

The goal is, that wardens include the issue's identifier in a contest submission.

This would help judges mark the issues as duplicates and hopefully decrease their workload.

Gas Optimization Issues

IdentifierTitle
G001Don't Initialize Variables with Default Value
G002Cache Array Length Outside of Loop
G003Use != 0 instead of > 0 for Unsigned Integer Comparison
G004Remove Unused Variables
G005Make Variable constant/immutable
G006Use immutable for OpenZeppelin AccessControl's Roles Declarations
G007Long Revert Strings
G008Use Shift Right/Left instead of Division/Multiplication if possible
G009Make Function external instead of public
G010Make Function payable
G011Unnecessary checked arithmetic in for loop
G012Use Prefix Increment instead of Postfix Increment if possible

Non-Critical Issues

IdentifierTitle
NC001Functions Mutating Storage Should Emit Events

Low Risk Issues

IdentifierTitle
L001Unsafe ERC20 Operation(s)
L002FeeOnTransfer Tokens not Supported
L003Unspecific Compiler Version Pragma
L004Use Two-Step Transfer Pattern for Access Controls
L005Do not use Deprecated Library Functions
L006Check that Contract Exists before using solmate's SafeTransferLib

Contribution

Any kind of contribution is highly welcome!

License

This work is licensed under a Creative Commons Attribution 4.0 International License.