Assessment reports>1inch Farming>Informational findings>ERC20 decimals() method may be unimplemented
Category: Business Logic

ERC20 decimals() method may be unimplemented

Informational Severity
Informational Impact
N/A Likelihood

Description

FarmingPool provides a public method to get the number of decimals of the stakingToken which calls the decimals method of the underlying IERC20 token. However, the EIP-20 standard declares that the decimals method is optional and that other contracts and interfaces should not rely on it being present.

Impact

The function could revert or return incorrect data. This may pose a composability risk for other contracts that try to interact with the farming pool.

Recommendations

Add documentation stipulating that the decimals method is required, or that the implementation may be unreliable.

Remediation

The issue has been acknowledged by 1inch, and they will add natspec documentation when it will be implemented.

Zellic © 2024Back to top ↑