There are variables that do not change so they can be marked as immutable to greatly improve the gas costs. Examples of such variables are:
contract ATokenYieldSource aToken, lendingPoolAddressesProviderRegistry.
contract IdleYieldSource idleToken, underlyingAsset.
contract YearnV2YieldSource vault, token.
contract ControlledToken controller.
Handle
pauliax
Vulnerability details
Impact
There are variables that do not change so they can be marked as immutable to greatly improve the gas costs. Examples of such variables are: contract ATokenYieldSource aToken, lendingPoolAddressesProviderRegistry. contract IdleYieldSource idleToken, underlyingAsset. contract YearnV2YieldSource vault, token. contract ControlledToken controller.
Recommended Mitigation Steps
Mark such variables with the 'immutable' keyword.