Swivel v3 contest - benbaessler'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: 25/78

Findings: 2

Award: $130.39

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

QA Report

[1] Multiple address mappings can be combined into a single mapping of an address to a struct, where appropriate

Swivel.sol#L21 Swivel.sol#L23

[2] Add zero-address checks in constructors and setter functions

Consider adding something like require(newAddr != address(0));.

Swivel.sol#L68 Swivel.sol#L428

[3] Avoid using ecrecover

Best practice is using OpenZeppelin's ECDSA.recover instead as it solves some minor problem that exist within ecrecover.

Sig.sol#L30 Sig.sol#L41

[4] Natspec is incomplete

Add @notice

Sig.sol#L20 Sig.sol#L38 Sig.sol#L48

Add @return

Creator.sol#L30 VaultTracker.sol#L113

[5] Contracts have missing License Identifiers

Add license to SPDX-License-Identifier.

[6] Use a more recent version of Solidity

Use a Solidity version of at least 0.8.13 to get the ability to use using for with a list of free functions.

LibCompound.sol#L2

#0 - robrobbins

2022-08-31T00:27:57Z

license and compiler issues addressed via other tickets

Awards

25.8265 USDC - $25.83

Labels

bug
duplicate
G (Gas Optimization)
wontfix

External Links

Gas Optimization Report

[1] State variables only set in the constructor should be declared immutable

Swivel.sol#L33

[2] Using private rather than public for constants, saves gas If needed, the value can be read from the verified contract source code.

Swivel.sol#L25 Swivel.sol#L26 Swivel.sol#L27 Swivel.sol#L35

[3] Usage of uints / ints smaller than 32 bytes (256 bits) 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. https://docs.soliditylang.org/en/v0.8.11/internals/layout_in_storage.html Use a larger size then downcast where needed.

Swivel.sol#L35 Swivel.sol#L37 Swivel.sol#L15 Hash.sol#L16 Marketplace.sol#L12 Marketplace.sol#L21 Marketplace.sol#L22 ZcToken.sol#L17

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