Undocumented code
Description
The methods in the contracts FarmingPool
, IFarmingPool
, ERC20Farmable
, Farm
, IFarm
, UserAccounting
, FarmAccounting
, IERC20Farmable
lack documentation in general. There are few or no code comments available.
Impact
This is a source of developer confusion and a general coding hazard. Lack of documentation, or unclear documentation, is a major pathway to future bugs. It is best practice to document all code. Documentation also helps third-party developers integrate with the platform, and helps any potential auditors more quickly and thoroughly assess the code. Since there are plans to eventually merge the contracts into OpenZeppelin, a widespread community library, the code should be as mature as possible.
Recommendations
Document the functions in the affected contracts so that the purpose, preconditions, and semantics are clearly explained. Return values and function arguments should be detailed to help prevent mistakes when calling the functions.
Remediation
The issue has been acknowledged by 1inch, and they will add additional documentation.