Omniscia Beanstalk Audit
Life Code Style Findings
Life Code Style Findings
LIF-01C: Deprecated Representation Style
Type | Severity | Location |
---|---|---|
Code Style | Life.sol:L55 |
Description:
The linked code contains the representation of the maximum value of a uint32
in the uint32(-1)
format which has been officially deprecated and no longer compiles in recent pragma
versions.
Example:
protocol/contracts/farm/facets/SeasonFacet/Life.sol
55if (s.season.period == 0) return uint32(-1);
Recommendation:
We advise the type(uint32).max
standardised representational style to be utilised instead.
Alleviation:
The literal representation was correctly updated to type(uint32).max
standardizing the codebase.
LIF-02C: Redundant Usage of SafeMath
Type | Severity | Location |
---|---|---|
Gas Optimization | Life.sol:L56, L75, L112, L117, L126, L133, L146 |
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/SeasonFacet/Life.sol
145if (s.f.soil > maxTotalSoil) {146 uint256 amount = s.f.soil.sub(maxTotalSoil);
Recommendation:
We advise them to be performed without the usage of SafeMath
to optimise the code.
Alleviation:
The redundant SafeMath
utilizations were properly updated as advised.