VTVL contest - Tadashi'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: 164/198

Findings: 1

Award: $9.09

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

9.086 USDC - $9.09

Labels

bug
G (Gas Optimization)

External Links

Variables with default value do not need to be initialized

Summary: state variable numTokensReservedForVesting of VTVLVesting contract and variable vestAmt in function _baseVestedAmount do not need to be initialized.

Details: Perform these changes:

  • in L27 of VTVLVesting.sol:

    -uint112 public numTokensReservedForVesting = 0;
    +uint112 public numTokensReservedForVesting;
  • in L148 of VTVLVesting.sol:

    -uint112 vestAmt = 0;
    +uint112 vestAmt;

⛽ Profiling:

By performing these changes the average gas used (computed using thnpx hardhat test) can be decreased:

  • revokeClaim(): 40827 → 40819
  • withdraw(): 72938 → 72930
  • Deployment of VTVLVesting: 3740739 → 3737632

Post-increments that can be replaced by pre-increments

Summary: Pre-incrementing a variable is cheaper than post-incrementing it. For more information, see G012 of c4-common-issues.

Details: Consider the following change to L353 of VTVLVesting.sol:

-for (uint256 i = 0; i < length; i++) {
+for (uint256 i = 0; i < length; ++i) {

⛽ Profiling:

By performing these changes the average gas used (computed using thnpx hardhat test) can be decreased:

  • revokeClaim(): 40827 → 40819
  • createClaim(): 167760 → 167759
  • createClaimsBatch(): 284486 → 284476
  • Deployment of VTVLVesting: 3740739 → 3740295
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