Reserve contest - Budaghyan'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: 70/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
edited-by-warden
G-07

External Links

G-01: SIMILAR MAPPINGS CAN BE COMBINED INTO SINGLE MAPPING WITH STRUCT

This saves gas because this fields are accessed together in functions, if the mappings are combined the keccak256 hash will be calculated only once

-BasketHandler

G-02: var1 = var1 ± var2 is more gas efficient than var1±= var2

-BasketHandler -Furnace -StRSR -StRSR -StRSR -StRSR -StRSR -StRSR -StRSR -StRSR -StRSR

G-03: Declare Variables outside the loops

Declare the variable outside the loop once and reuse it inside the loop this way gas is not wasted to declare variable multiple times

-RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -BackingManager -BackingManager -BackingManager -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -Distributor -Distributor -Distributor -Distributor -RToken -RToken

G-04: Where overflow is impossible var1++ should be wraped in unchecked{} block

It saves gas because it compiler is not checking for overflows/underflows. This is more gas efficient but it makes code harder to read.

-RecollateralizationLib -RecollateralizationLib -RecollateralizationLib -RewardableLib -RewardableLib -RewardableLib -AssetRegistry -AssetRegistry -AssetRegistry -AssetRegistry -BackingManager -BackingManager -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -BasketHandler -Distributor -Distributor -Distributor -RToken -RToken -RToken -RToken -RToken -RToken -RToken -RToken -RToken -RToken -RToken -RToken

G-05: Put less gas consuming requires first

In this case if a transaction is reverted on first require less gas will be used.

-AssetRegistry -AssetRegistry

G-06: Private functions which are used only once can be inlined

Calling private functions costs additional gas this way it will be saved. This might also make it a little bit harder to read the code.

-RecollateralizationLib -RecollateralizationLib -BackingManager -BackingManager

G-07: Use bytes32 instead of string for strings smaller than 32 bytes

EVM workes with bytes32 more efficently than with strings and bytes.

-Deployer

G-08: Use calldata in cases where parameter variable is not modified

Accessing parameters from calldata are more gas efficient

-Deployer -Deployer -Deployer -Deployer -Distributor -Distributor -Main

#0 - c4-judge

2023-01-24T23:31: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