Vyper Vested Claims

First Flight #34
Beginner FriendlyDeFi
100 EXP
View results
Submission Details
Severity: low
Invalid

[I-2] Avoid using magic numbers to enhance clarity and readability

Summary

Magic numbers are used in the code to store constants, making the code less readable. It is recommended to use constants instead.

Here are the magic numbers used in the code:

proof: DynArray[bytes32, 20] # why 20 is selected? max length?
# 31 and 69 are explained in the contract description
# but it could be more explicit as for 100 as the precision
instant_release: uint256 = (total_amount * 31) // 100
linear_vesting: uint256 = (total_amount * 69) // 100

Recommendations

Create proper constants with clear names can enhance readability:

PRECISION: uint256 = 100
TGE_RELEASE_PERCENT: uint256 = 31 # Token Generation Event
LINEAR_VESTING_PERCENT: uint256 = 69
MAX_PROOF_LENGTH: uint256 = 20
Updates

Appeal created

bube Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.