Omniscia Beanstalk Audit

FieldFacet Code Style Findings

FieldFacet Code Style Findings

FFT-01C: Redundant Usage of SafeMath

Description:

The linked SafeMath operations are guaranteed to be performed safely by their surrounding if clauses and general logical constraints.

Example:

protocol/contracts/farm/facets/FieldFacet/FieldFacet.sol
69require(end > start, "Field: Pod range invalid.");
70uint256 amount = plot(sender, id);
71require(amount > 0, "Field: Plot not owned by user.");
72require(amount >= end, "Field: Pod range too long.");
73amount = end.sub(start);

Recommendation:

We advise them to be performed without the usage of SafeMath to optimise the code.

Alleviation:

The redundant usage of SafeMath has been omitted from the codebase as advised.