diff --git a/l1-contracts/contracts/bridge/L1WethBridge.sol b/l1-contracts/contracts/bridge/L1WethBridge.sol index 1cdeadb81..ac27c084d 100644 --- a/l1-contracts/contracts/bridge/L1WethBridge.sol +++ b/l1-contracts/contracts/bridge/L1WethBridge.sol @@ -97,7 +97,7 @@ contract L1WethBridge is IL1Bridge, ReentrancyGuard, Initializable, Ownable2Step /// @dev A mapping chainId => bridgeProxyTxHash. Used to check the deploy transaction (which depends on its place in the priority queue). mapping(uint256 => bytes32) public bridgeProxyDeployOnL2TxHash; - /// @dev A mapping chainId => L2 deposit transaction hash => keccak256(account, amount) + /// @dev A mapping chainId => L2 deposit transaction hash => keccak256(account, amount) /// @dev Used for saving the number of deposited funds, to claim them in case the deposit transaction will fail /// @dev only used when it is not the base token, as then it is sent to refund recipient mapping(uint256 => mapping(bytes32 => bytes32)) internal depositHappened; @@ -545,7 +545,7 @@ contract L1WethBridge is IL1Bridge, ReentrancyGuard, Initializable, Ownable2Step bytes32 _txHash ) external override onlyBridgehub { require(depositHappened[_chainId][_txHash] == 0x00, "L1WETHBridge: tx already happened"); - depositHappened[_chainId][_txHash] = _txDataHash; + depositHappened[_chainId][_txHash] = _txDataHash; emit BridgehubDepositFinalized(_chainId, _txDataHash, _txHash); } @@ -588,7 +588,10 @@ contract L1WethBridge is IL1Bridge, ReentrancyGuard, Initializable, Ownable2Step require(proofValid, "L1WB: Invalid L2 transaction status proof"); bytes32 txDataHash = depositHappened[_chainId][_l2TxHash]; - require(((_amount > 0) && (txDataHash == keccak256(abi.encode(_depositSender, _amount)))), "L1WB: _amount is zero or deposit did not happen"); + require( + ((_amount > 0) && (txDataHash == keccak256(abi.encode(_depositSender, _amount)))), + "L1WB: _amount is zero or deposit did not happen" + ); if (!hyperbridgingEnabled[_chainId]) { require(chainBalance[_chainId] >= _amount, "L1WB: chainBalance is too low"); chainBalance[_chainId] -= _amount; diff --git a/l1-contracts/src.ts/erc20-initialize.ts b/l1-contracts/src.ts/erc20-initialize.ts index 5730a02b7..cbdd0d9de 100644 --- a/l1-contracts/src.ts/erc20-initialize.ts +++ b/l1-contracts/src.ts/erc20-initialize.ts @@ -35,10 +35,7 @@ export async function initializeErc20Bridge( // Governor should always be smart contract (except for unit tests) const l2GovernorAddress = applyL1ToL2Alias(l1GovernorAddress); - const { l2TokenFactoryAddr, l2ERC20BridgeProxyAddr } = calculateERC20Addresses( - l2GovernorAddress, - erc20Bridge - ); + const { l2TokenFactoryAddr, l2ERC20BridgeProxyAddr } = calculateERC20Addresses(l2GovernorAddress, erc20Bridge); const tx1 = await erc20Bridge.initialize(); const tx2 = await erc20Bridge.initializeV2( @@ -165,12 +162,8 @@ export async function startErc20BridgeInitOnChain( // Governor should always be smart contract (except for unit tests) const l2GovernorAddress = applyL1ToL2Alias(l1GovernorAddress); - const { l2ERC20BridgeProxyAddr } = calculateERC20Addresses( - l2GovernorAddress, - erc20Bridge - ); + const { l2ERC20BridgeProxyAddr } = calculateERC20Addresses(l2GovernorAddress, erc20Bridge); console.log(`CONTRACTS_L2_ERC20_BRIDGE_ADDR=${l2ERC20BridgeProxyAddr}`); } - } diff --git a/l1-contracts/src.ts/weth-initialize.ts b/l1-contracts/src.ts/weth-initialize.ts index 068e6a851..ef5c17cdd 100644 --- a/l1-contracts/src.ts/weth-initialize.ts +++ b/l1-contracts/src.ts/weth-initialize.ts @@ -31,12 +31,12 @@ export async function initializeWethBridge(deployer: Deployer, deployWallet: Wal const { l2WethProxyAddress: l2WethProxyAddressEthIsBase, l2WethBridgeProxyAddress: l2WethBridgeProxyAddressEthIsBase, - } = calculateWethAddresses( l2GovernorAddress, l1WethBridge.address, l1WethAddress, true); + } = calculateWethAddresses(l2GovernorAddress, l1WethBridge.address, l1WethAddress, true); const { l2WethProxyAddress: l2WethProxyAddressEthIsNotBase, l2WethBridgeProxyAddress: l2WethBridgeProxyAddressEthIsNotBase, - } = calculateWethAddresses( l2GovernorAddress, l1WethBridge.address, l1WethAddress, false); + } = calculateWethAddresses(l2GovernorAddress, l1WethBridge.address, l1WethAddress, false); const tx1 = await l1WethBridge.initialize( [L2_WETH_BRIDGE_IMPLEMENTATION_BYTECODE, L2_WETH_BRIDGE_PROXY_BYTECODE], @@ -158,12 +158,14 @@ export async function startWethBridgeInitOnChain( // Note governor can not be EOA const l2GovernorAddress = applyL1ToL2Alias(l1GovernorAddress); - + const l1WethAddress = await l1WethBridge.l1WethAddress(); - const { - l2WethProxyAddress, - l2WethBridgeProxyAddress, - } = calculateWethAddresses( l2GovernorAddress, l1WethBridge.address, l1WethAddress, ethIsBaseToken); + const { l2WethProxyAddress, l2WethBridgeProxyAddress } = calculateWethAddresses( + l2GovernorAddress, + l1WethBridge.address, + l1WethAddress, + ethIsBaseToken + ); console.log(`CONTRACTS_L2_WETH_BRIDGE_ADDR=${l2WethBridgeProxyAddress}`); console.log(`CONTRACTS_L2_WETH_TOKEN_PROXY_ADDR=${l2WethProxyAddress}`); diff --git a/l1-contracts/tsconfig.json b/l1-contracts/tsconfig.json index 72a5bef45..9a9ed4891 100644 --- a/l1-contracts/tsconfig.json +++ b/l1-contracts/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { "types": ["node", "mocha"], - "downlevelIteration": true - } + "downlevelIteration": true, + }, } diff --git a/l2-contracts/tsconfig.json b/l2-contracts/tsconfig.json index 72a5bef45..9a9ed4891 100644 --- a/l2-contracts/tsconfig.json +++ b/l2-contracts/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { "types": ["node", "mocha"], - "downlevelIteration": true - } + "downlevelIteration": true, + }, }