Omniscia Beanstalk Audit

InitDiamond Code Style Findings

InitDiamond Code Style Findings

IDD-01C: Deprecated Representation Style

TypeSeverityLocation
Code StyleInitDiamond.sol:L51, L52, L53

Description:

The linked code contains the representation of the maximum value of a uint256 in the uint256(-1) format which has been officially deprecated and no longer compiles in recent pragma versions.

Example:

protocol/contracts/farm/init/InitDiamond.sol
51IBean(s.c.bean).approve(UNISWAP_ROUTER, uint256(-1));
52IUniswapV2Pair(s.c.pair).approve(UNISWAP_ROUTER, uint256(-1));
53IWETH(s.c.weth).approve(UNISWAP_ROUTER, uint256(-1));

Recommendation:

We advise the type(uint256).max standardised representational style to be utilised instead.

Alleviation:

All linked literal representations were correctly updated to type(uint256).max standardizing the codebase.