Swivel v3 contest - Fitraldys's results

The Capital-Efficient Protocol For Fixed-Rate Lending.

General Information

Platform: Code4rena

Start Date: 12/07/2022

Pot Size: $35,000 USDC

Total HM: 13

Participants: 78

Period: 3 days

Judge: 0xean

Total Solo HM: 6

Id: 135

League: ETH

Swivel

Findings Distribution

Researcher Performance

Rank: 74/78

Findings: 1

Award: $25.72

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

25.7152 USDC - $25.72

Labels

bug
duplicate
G (Gas Optimization)
old-submission-method
wontfix

External Links

  1. useage of uint / int smaller than 32 bytes incurs overhead

When using elements that are smaller than 32 bytes, your contract’s gas usage may be higher. This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller than that, the EVM must use more operations in order to reduce the size of the element from 32 bytes to the desired size.

resource : https://docs.soliditylang.org/en/v0.8.11/internals/layout_in_storage.html

Use a larger size then downcast where needed

POC : https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L15 https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L578 https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L600 https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L620 https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L634

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