re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[EIW-01C] Variable Mutability Specifiers (Immutable) #81

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

EIW-01C: Variable Mutability Specifiers (Immutable)

Type Severity Location
Gas Optimization ExactInputWrapper.sol:L13, L14

Description:

The linked variables are assigned to only once during the contract's constructor.

Example:

ISwapRouter public swapRouter;
IWETH public WETH;

constructor(address _router, address _weth) {
    swapRouter = ISwapRouter(_router);
    WETH = IWETH(_weth);
}

Recommendation:

We advise them to be set as immutable greatly optimizing their read-access gas cost.

chasebrownn commented 5 months ago

Resolved