code-423n4 / 2022-05-alchemix-findings

5 stars 2 forks source link

Gas Optimizations #205

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

[G-01] Imports unused

Description

https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/AlchemistV2.sol#L14 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/StakingPools.sol#L4 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/libraries/pools/Pool.sol#L4

unused imports can increase the deployment cost

Recommended Mitigation Steps

Remove imports

-----------------------------------------------------------------

https://github.com/code-423n4/2022-05-enso/blob/main/contracts/StrategyController.sol#L451-L461

[G-02] Variable can be immutable

Description

whitelist variable can be changed to immutable to save gas cost

https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/WETHGateway.sol#L20

Recommended Mitigation Steps

Change to immutable

-----------------------------------------------------------------