15,000 USDC
View results
Submission Details
Severity: gas

add constant decorator to save gas

Summary

The constant decorator tells the compiler that the function's return value is never modified, so it can be stored in a constant storage slot, which also saves gas.

Vulnerability Details

Impact

Tools Used

Recommendations

@view
@constant
@external
def decimals() -> uint8:
"""
@notice Get the number of decimals for this token
@dev Implemented as a view method to reduce gas costs
@return uint8 decimal places
"""
return 18

Support

FAQs

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