VTVL contest - indijanc'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: 111/198

Findings: 2

Award: $27.95

๐ŸŒŸ Selected for report: 0

๐Ÿš€ Solo Findings: 0

I would say the contracts are well written, with good comments and the functionality is protected with a good test suite. As mentioned in the contest description the admins / founders will have certain capabilities of managing the contract which will ultimately also need to be acompanied by certain trust. The contest description also states that the projects makes an effort to make any changes to claims transparent. Hence I would advise the following:

Include admin / founder address in all claim changes and admin withdrawal events

VTVLVesting is open to have many admins, so it would make sense to include the admin address on all relevant events to increase transparency

VTVLVesting.sol L59 Consider including the address of the admin that created the claim for better transparency.

VTVLVesting.sol L69 Consider including the address of the admin that revoked the claim for better transparency.

VTVLVesting.sol L74 Consider including the address of the admin that withdrew. This is probably less important than the other two events emitting claim changes, but still may be valuable as there may be several admins associated with a vesting contract and would want to have this included in the event.

Awards

9.086 USDC - $9.09

Labels

bug
G (Gas Optimization)

External Links

The contracts are already quite well optimized, but there's still some room for improvements, especially when it comes to createClaimsBatch() as it includes a for loop with number of loops based on the input. Here's a few I see.

Skip comparison to true in hasActiveClaim() as isActive is already a bool variable

VTVLVesting.sol L111

isActive can be used for the ห™require() inside hasActiveClaim() and the additional comparison to true is unnecessary and just wastes gas.

Change i++ to ++i in for loops

VTVLVesting.sol L353

++i will consume less gas because it doesn't need a temporary variable to return current value. Would suggest to use ++i if possible in any loop.

Use custom errors instead of require() with strings

The project is compiled with Solidity v0.8.14 which allows for custom errors (introduced in v0.8.4). Consider using custom errors across all contracts as it will reduce gas cost compared to using require() with strings.

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