Reserve contest - Awesome's results

A permissionless platform to launch and govern asset-backed stable currencies.

General Information

Platform: Code4rena

Start Date: 06/01/2023

Pot Size: $210,500 USDC

Total HM: 27

Participants: 73

Period: 14 days

Judge: 0xean

Total Solo HM: 18

Id: 203

League: ETH

Reserve

Findings Distribution

Researcher Performance

Rank: 62/73

Findings: 1

Award: $72.44

Gas:
grade-b

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

Awards

72.4433 USDC - $72.44

Labels

bug
G (Gas Optimization)
grade-b
G-01

External Links

1. Splitting require() Statements That Use && Saves Gas - (Saves ~3 Gas per &&)

Instead of using the && operator in a single require statement to check multiple conditions, using various require statements with 1 condition per require statement will save ~3 GAS per &&.

Affected line of code:

2. Regular addition/subtraction assignment saves gas

Using standard addition or subtraction assignment (x = x + y or x = x - y) rather than the shorthand versions (x += y or x -= y) saves gas. This can save approximately 22 gas per occurrence.

Affected line of code:

3. Uncheck arithmetics operations that canโ€™t underflow/overflow

Solidity version 0.8+ has an implicit overflow and underflow check on unsigned integers.

When an overflow or an underflow isnโ€™t possible, some gas can be saved using an unchecked block.

For example, the code at RToken.sol#L270-L276 can be refactored to as:

File: /contracts/p1/RToken.sol
    for (uint256 i = 0; i < erc20s.length;) {
        IERC20Upgradeable(erc20s[i]).safeTransferFrom(
            issuer,
            address(backingManager),
            deposits[i]
        );

        unchecked {
            ++i;
        }
    }

This is affected in multiple files:

#0 - c4-judge

2023-01-24T22:58:50Z

0xean marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax ยฉ 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter