VTVL contest - WilliamAmbrozic's results

Building no-code token management tools to empower web3 founders and investors, starting with token vesting.

General Information

Platform: Code4rena

Start Date: 20/09/2022

Pot Size: $30,000 USDC

Total HM: 12

Participants: 198

Period: 3 days

Judge: 0xean

Total Solo HM: 2

Id: 164

League: ETH

VTVL

Findings Distribution

Researcher Performance

Rank: 181/198

Findings: 1

Award: $9.09

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

9.0866 USDC - $9.09

Labels

bug
G (Gas Optimization)

External Links

Gas Optimizations

22/09/2022 14:57 VTVL

Savings

The following changes pass the given tests saving approximately 47 BPS (optimizer off).

From

MethodsMinMaxAvg
TestERC20Token--1193264
VTVLVesting374072837407403740739

To

MethodsMinMaxAvg
TestERC20Token--1193264
VTVLVesting372322937232413723240

Tools Used: Manual Analysis, the given test suite.

VTVLVesting.sol

There is no need to initialize variables with default values

Reference

Inline variables to save SLOAD

Example:

function vestedAmount(address _recipient, uint40 _referenceTs) public view returns (uint112) { Claim storage _claim = claims[_recipient]; return _baseVestedAmount(_claim, _referenceTs); }

changed to

function vestedAmount(address _recipient, uint40 _referenceTs) public view returns (uint112) { return _baseVestedAmount(claims[_recipient], _referenceTs); }

hasNoClaim modifier is used once (can be inlined)

++i is cheaper than i++

Suggestion: change for (uint256 i = 0; i < length; i++) to for (uint256 i; i < length; ++i)

Cache variables to save an SLOAD

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