From d13b8c598d3e9a48ee492c93130bf576e752a590 Mon Sep 17 00:00:00 2001 From: chrismaree Date: Wed, 16 Mar 2022 09:39:57 +0200 Subject: [PATCH 1/2] fix[N10] Make better use of immutable Signed-off-by: chrismaree --- contracts/HubPool.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/HubPool.sol b/contracts/HubPool.sol index c970e0fd2..167c92d55 100644 --- a/contracts/HubPool.sol +++ b/contracts/HubPool.sol @@ -109,13 +109,13 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable { mapping(uint256 => CrossChainContract) public crossChainContracts; // WETH contract for Ethereum. - WETH9 public weth; + WETH9 public immutable weth; // Helper factory to deploy new LP tokens for enabled L1 tokens - LpTokenFactoryInterface public lpTokenFactory; + LpTokenFactoryInterface public immutable lpTokenFactory; // Finder contract for this network. - FinderInterface public finder; + FinderInterface public immutable finder; // When root bundles are disputed a price request is enqueued with the DVM to resolve the resolution. bytes32 public identifier = "IS_ACROSS_V2_BUNDLE_VALID"; From cccb9556345edcc5d8fc3022ab64a5b368c8d810 Mon Sep 17 00:00:00 2001 From: chrismaree Date: Fri, 18 Mar 2022 07:27:17 +0200 Subject: [PATCH 2/2] nit Signed-off-by: chrismaree --- contracts/Optimism_SpokePool.sol | 2 +- contracts/SpokePool.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/Optimism_SpokePool.sol b/contracts/Optimism_SpokePool.sol index a38297964..41723cd2a 100644 --- a/contracts/Optimism_SpokePool.sol +++ b/contracts/Optimism_SpokePool.sol @@ -18,7 +18,7 @@ contract Optimism_SpokePool is CrossDomainEnabled, SpokePool { uint32 public l1Gas = 5_000_000; // ETH is an ERC20 on OVM. - address public l2Eth = address(Lib_PredeployAddresses.OVM_ETH); + address public immutable l2Eth = address(Lib_PredeployAddresses.OVM_ETH); // Stores alternative token bridges to use for L2 tokens that don't go over the standard bridge. This is needed // to support non-standard ERC20 tokens on Optimism, such as DIA and SNX which both use custom bridges. diff --git a/contracts/SpokePool.sol b/contracts/SpokePool.sol index 19a40dd8a..2c7a4b592 100644 --- a/contracts/SpokePool.sol +++ b/contracts/SpokePool.sol @@ -39,7 +39,7 @@ abstract contract SpokePool is SpokePoolInterface, Testable, Lockable, MultiCall // Address of WETH contract for this network. If an origin token matches this, then the caller can optionally // instruct this contract to wrap ETH when depositing. - WETH9 public weth; + WETH9 public immutable weth; // Any deposit quote times greater than or less than this value to the current contract time is blocked. Forces // caller to use an approximately "current" realized fee. Defaults to 10 minutes.