diff --git a/.github/actions/install_dependencies/action.yaml b/.github/actions/install_dependencies/action.yaml index ff623490..f8a46f81 100644 --- a/.github/actions/install_dependencies/action.yaml +++ b/.github/actions/install_dependencies/action.yaml @@ -12,6 +12,8 @@ runs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 + with: + version: v1.4.4 - name: Install Bun uses: oven-sh/setup-bun@v2 diff --git a/contracts/script/configure/AllowRouterToTransfer.s.sol b/contracts/script/configure/AllowRouterToTransfer.s.sol index 9a31f284..6244fb1b 100644 --- a/contracts/script/configure/AllowRouterToTransfer.s.sol +++ b/contracts/script/configure/AllowRouterToTransfer.s.sol @@ -36,17 +36,15 @@ contract AllowRouterToTransfer is Script { T1StandardERC20(ERC20s[i]).allowance(L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR, permit2) < type(uint160).max / 2 ) { - IL1ERC20Gateway(L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR).allowRouterToTransfer( - ERC20s[i], type(uint160).max, uint48(block.timestamp + 10_000_000) - ); + IL1ERC20Gateway(L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR) + .allowRouterToTransfer(ERC20s[i], type(uint160).max, uint48(block.timestamp + 10_000_000)); } } // Check allowance for WETH if (T1StandardERC20(wethAddress).allowance(L1_WETH_GATEWAY_PROXY_ADDR, permit2) < type(uint160).max / 2) { - IL1ERC20Gateway(L1_WETH_GATEWAY_PROXY_ADDR).allowRouterToTransfer( - wethAddress, type(uint160).max, uint48(block.timestamp + 10_000_000) - ); + IL1ERC20Gateway(L1_WETH_GATEWAY_PROXY_ADDR) + .allowRouterToTransfer(wethAddress, type(uint160).max, uint48(block.timestamp + 10_000_000)); } vm.stopBroadcast(); diff --git a/contracts/script/configure/SetMM.s.sol b/contracts/script/configure/SetMM.s.sol index a1f8ff42..420ab128 100644 --- a/contracts/script/configure/SetMM.s.sol +++ b/contracts/script/configure/SetMM.s.sol @@ -24,12 +24,15 @@ contract SetMM is Script { // Check if the market maker is set to this address if (IL1GatewayRouter(L1_GATEWAY_ROUTER_PROXY_ADDR).marketMaker() != newMarketMaker) { - T1Owner(payable(L1_T1_OWNER_ADDR)).execute( - L1_GATEWAY_ROUTER_PROXY_ADDR, - 0, - abi.encodeWithSelector(IL1GatewayRouter(L1_GATEWAY_ROUTER_PROXY_ADDR).setMM.selector, newMarketMaker), - SECURITY_COUNCIL_NO_DELAY_ROLE - ); + T1Owner(payable(L1_T1_OWNER_ADDR)) + .execute( + L1_GATEWAY_ROUTER_PROXY_ADDR, + 0, + abi.encodeWithSelector( + IL1GatewayRouter(L1_GATEWAY_ROUTER_PROXY_ADDR).setMM.selector, newMarketMaker + ), + SECURITY_COUNCIL_NO_DELAY_ROLE + ); } console.log("[%s] is the new market maker", IL1GatewayRouter(L1_GATEWAY_ROUTER_PROXY_ADDR).marketMaker()); diff --git a/contracts/script/deploy/DeployArbT1Messenger.s.sol b/contracts/script/deploy/DeployArbT1Messenger.s.sol index 35089f67..e2a92e33 100644 --- a/contracts/script/deploy/DeployArbT1Messenger.s.sol +++ b/contracts/script/deploy/DeployArbT1Messenger.s.sol @@ -12,7 +12,9 @@ import { Script } from "forge-std/Script.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; contract DeployArbT1MessengerProxy is Script, DeploymentUtils { uint256 private deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); diff --git a/contracts/script/deploy/DeployBaseT1Messenger.s.sol b/contracts/script/deploy/DeployBaseT1Messenger.s.sol index a9e9c6e7..75e82fa6 100644 --- a/contracts/script/deploy/DeployBaseT1Messenger.s.sol +++ b/contracts/script/deploy/DeployBaseT1Messenger.s.sol @@ -12,7 +12,9 @@ import { Script } from "forge-std/Script.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; contract DeployBaseT1MessengerProxy is Script, DeploymentUtils { uint256 private deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); diff --git a/contracts/script/deploy/InitializeL1BridgeContracts.s.sol b/contracts/script/deploy/InitializeL1BridgeContracts.s.sol index 52b67497..ba7817ce 100644 --- a/contracts/script/deploy/InitializeL1BridgeContracts.s.sol +++ b/contracts/script/deploy/InitializeL1BridgeContracts.s.sol @@ -5,7 +5,9 @@ pragma solidity ^0.8.25; import { Script } from "forge-std/Script.sol"; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L1ETHGateway } from "../../src/L1/gateways/L1ETHGateway.sol"; import { L1GatewayRouter } from "../../src/L1/gateways/L1GatewayRouter.sol"; @@ -49,7 +51,8 @@ contract InitializeL1BridgeContracts is Script { vm.envAddress("L1_STANDARD_ERC20_GATEWAY_IMPLEMENTATION_ADDR"); address private L1_WETH_GATEWAY_PROXY_ADDR = vm.envAddress("L1_WETH_GATEWAY_PROXY_ADDR"); address private L1_WETH_GATEWAY_IMPLEMENTATION_ADDR = vm.envAddress("L1_WETH_GATEWAY_IMPLEMENTATION_ADDR"); - address private L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = vm.envAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR"); + address private L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = + vm.envAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR"); address private L2_T1_MESSENGER_PROXY_ADDR = vm.envAddress("L2_T1_MESSENGER_PROXY_ADDR"); address private L2_ETH_GATEWAY_PROXY_ADDR = vm.envAddress("L2_ETH_GATEWAY_PROXY_ADDR"); @@ -78,12 +81,13 @@ contract InitializeL1BridgeContracts is Script { T1Chain(L1_T1_CHAIN_PROXY_ADDR).addProver(L1_POSTMAN_SIGNER_ADDRESS); // initialize L2GasPriceOracle - L2GasPriceOracle(L2_GAS_PRICE_ORACLE_PROXY_ADDR).initialize( - 21_000, // _txGas - 53_000, // _txGasContractCreation - 4, // _zeroGas - 16 // _nonZeroGas - ); + L2GasPriceOracle(L2_GAS_PRICE_ORACLE_PROXY_ADDR) + .initialize( + 21_000, // _txGas + 53_000, // _txGasContractCreation + 4, // _zeroGas + 16 // _nonZeroGas + ); L2GasPriceOracle(L2_GAS_PRICE_ORACLE_PROXY_ADDR).updateWhitelist(L1_WHITELIST_ADDR); // initialize L1MessageQueueWithGasPriceOracle @@ -91,9 +95,8 @@ contract InitializeL1BridgeContracts is Script { ITransparentUpgradeableProxy(L1_MESSAGE_QUEUE_PROXY_ADDR), L1_MESSAGE_QUEUE_IMPLEMENTATION_ADDR ); - L1MessageQueueWithGasPriceOracle(L1_MESSAGE_QUEUE_PROXY_ADDR).initialize( - L2_GAS_PRICE_ORACLE_PROXY_ADDR, MAX_L1_MESSAGE_GAS_LIMIT - ); + L1MessageQueueWithGasPriceOracle(L1_MESSAGE_QUEUE_PROXY_ADDR) + .initialize(L2_GAS_PRICE_ORACLE_PROXY_ADDR, MAX_L1_MESSAGE_GAS_LIMIT); L1MessageQueueWithGasPriceOracle(L1_MESSAGE_QUEUE_PROXY_ADDR).initializeV2(); @@ -105,9 +108,8 @@ contract InitializeL1BridgeContracts is Script { L1T1Messenger(payable(L1_T1_MESSENGER_PROXY_ADDR)).initialize(L1_FEE_VAULT_ADDR); // initialize L1GatewayRouter - L1GatewayRouter(L1_GATEWAY_ROUTER_PROXY_ADDR).initialize( - L1_ETH_GATEWAY_PROXY_ADDR, L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR, L1_PERMIT2 - ); + L1GatewayRouter(L1_GATEWAY_ROUTER_PROXY_ADDR) + .initialize(L1_ETH_GATEWAY_PROXY_ADDR, L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR, L1_PERMIT2); // initialize L1ETHGateway proxyAdmin.upgrade(ITransparentUpgradeableProxy(L1_ETH_GATEWAY_PROXY_ADDR), L1_ETH_GATEWAY_IMPLEMENTATION_ADDR); diff --git a/contracts/script/deploy/InitializeL1T1Owner.s.sol b/contracts/script/deploy/InitializeL1T1Owner.s.sol index fcbc877a..165e2544 100644 --- a/contracts/script/deploy/InitializeL1T1Owner.s.sol +++ b/contracts/script/deploy/InitializeL1T1Owner.s.sol @@ -49,7 +49,8 @@ contract InitializeL1T1Owner is Script { address private L1_ETH_GATEWAY_PROXY_ADDR = vm.envAddress("L1_ETH_GATEWAY_PROXY_ADDR"); address private L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR = vm.envAddress("L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR"); address private L1_WETH_GATEWAY_PROXY_ADDR = vm.envAddress("L1_WETH_GATEWAY_PROXY_ADDR"); - address private L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = vm.envAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR"); + address private L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = + vm.envAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR"); address private L1_WHITELIST_ADDR = vm.envAddress("L1_WHITELIST_ADDR"); T1Owner private owner; diff --git a/contracts/script/deploy/InitializeL2BridgeContracts.s.sol b/contracts/script/deploy/InitializeL2BridgeContracts.s.sol index 8a61e0c6..88d9ce40 100644 --- a/contracts/script/deploy/InitializeL2BridgeContracts.s.sol +++ b/contracts/script/deploy/InitializeL2BridgeContracts.s.sol @@ -5,7 +5,9 @@ pragma solidity ^0.8.25; import { Script } from "forge-std/Script.sol"; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L2T1Messenger } from "../../src/L2/L2T1Messenger.sol"; import { L2ETHGateway } from "../../src/L2/gateways/L2ETHGateway.sol"; @@ -68,9 +70,8 @@ contract InitializeL2BridgeContracts is Script { L2T1Messenger(payable(L2_T1_MESSENGER_PROXY_ADDR)).initialize(L1_T1_MESSENGER_PROXY_ADDR, network); // initialize L2GatewayRouter - L2GatewayRouter(L2_GATEWAY_ROUTER_PROXY_ADDR).initialize( - L2_ETH_GATEWAY_PROXY_ADDR, L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR - ); + L2GatewayRouter(L2_GATEWAY_ROUTER_PROXY_ADDR) + .initialize(L2_ETH_GATEWAY_PROXY_ADDR, L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR); // initialize L2ETHGateway proxyAdmin.upgrade(ITransparentUpgradeableProxy(L2_ETH_GATEWAY_PROXY_ADDR), L2_ETH_GATEWAY_IMPLEMENTATION_ADDR); @@ -102,9 +103,8 @@ contract InitializeL2BridgeContracts is Script { } // initialize T1StandardERC20Factory - T1StandardERC20Factory(L2_T1_STANDARD_ERC20_FACTORY_ADDR).transferOwnership( - L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR - ); + T1StandardERC20Factory(L2_T1_STANDARD_ERC20_FACTORY_ADDR) + .transferOwnership(L2_STANDARD_ERC20_GATEWAY_PROXY_ADDR); vm.stopBroadcast(); } diff --git a/contracts/script/deploy/xYield/DeployMintableERC20.s.sol b/contracts/script/deploy/xYield/DeployMintableERC20.s.sol index 229276f3..fcfc4474 100644 --- a/contracts/script/deploy/xYield/DeployMintableERC20.s.sol +++ b/contracts/script/deploy/xYield/DeployMintableERC20.s.sol @@ -8,10 +8,10 @@ contract DeployMintableERC20 is DeploymentUtils { MintableERC20 private token; function deploy() external { - selectMainnetOrSepoliaFork("base"); + selectMainnetOrSepoliaFork("arbitrum"); startBroadcastWithDeployerKeyIfItExists(); - token = new MintableERC20(address(0x6c8E1d54297aAe7C34f1F5cF73559e621a394eFb), "xyUSDC", "xyUSDC"); + token = new MintableERC20(address(0x8764BD4c58cc71bEe12C36deA228fd22a1B2723C), "xyUSDC", "xyUSDC"); vm.stopBroadcast(); } diff --git a/contracts/script/test/7683/T1ERC7683ArbToBase.s.sol b/contracts/script/test/7683/T1ERC7683ArbToBase.s.sol index 8fbe4510..9a92c9c6 100644 --- a/contracts/script/test/7683/T1ERC7683ArbToBase.s.sol +++ b/contracts/script/test/7683/T1ERC7683ArbToBase.s.sol @@ -101,10 +101,11 @@ contract SolverFillScript is Script { bytes memory originData = hex""; // Approve output tokens - ERC20(vm.envAddress("BASE_SEPOLIA_USDT_ADDR")).approve( - address(l2_7683), - AMOUNT_IN // match amount from order - ); + ERC20(vm.envAddress("BASE_SEPOLIA_USDT_ADDR")) + .approve( + address(l2_7683), + AMOUNT_IN // match amount from order + ); // NOTE - Use values from a won Sealed Bid Auction uint256 bidAmountOut = 0; diff --git a/contracts/script/test/7683/T1ERC7683BaseToArb.s.sol b/contracts/script/test/7683/T1ERC7683BaseToArb.s.sol index 318dc052..8670be46 100644 --- a/contracts/script/test/7683/T1ERC7683BaseToArb.s.sol +++ b/contracts/script/test/7683/T1ERC7683BaseToArb.s.sol @@ -101,10 +101,11 @@ contract SolverFillScript is Script { bytes memory originData = hex""; // Approve output tokens - ERC20(vm.envAddress("ARBITRUM_SEPOLIA_USDT_ADDR")).approve( - address(l2_7683), - AMOUNT_IN // match amount from order - ); + ERC20(vm.envAddress("ARBITRUM_SEPOLIA_USDT_ADDR")) + .approve( + address(l2_7683), + AMOUNT_IN // match amount from order + ); // NOTE - Use values from a won Sealed Bid Auction uint256 bidAmountOut = 0; diff --git a/contracts/script/test/7683/T1ERC7683L1ToL2.s.sol b/contracts/script/test/7683/T1ERC7683L1ToL2.s.sol index d4259c41..8629a414 100644 --- a/contracts/script/test/7683/T1ERC7683L1ToL2.s.sol +++ b/contracts/script/test/7683/T1ERC7683L1ToL2.s.sol @@ -97,10 +97,11 @@ contract SolverFillScript is Script { bytes memory originData = hex""; // Approve output tokens - ERC20(vm.envAddress("L2_USDT_ADDR")).approve( - address(l2_7683), - HUNDRED_USDT // match amount from order - ); + ERC20(vm.envAddress("L2_USDT_ADDR")) + .approve( + address(l2_7683), + HUNDRED_USDT // match amount from order + ); bytes memory fillerData = abi.encode(TypeCasts.addressToBytes32(solver)); l2_7683.fill(orderId, originData, fillerData); diff --git a/contracts/script/test/7683/T1ERC7683L2ToL1.s.sol b/contracts/script/test/7683/T1ERC7683L2ToL1.s.sol index 1b8ed2b1..47694802 100644 --- a/contracts/script/test/7683/T1ERC7683L2ToL1.s.sol +++ b/contracts/script/test/7683/T1ERC7683L2ToL1.s.sol @@ -97,10 +97,11 @@ contract SolverFillScript is Script { bytes memory originData = hex""; // Approve output tokens - ERC20(vm.envAddress("L1_USDT_ADDR")).approve( - address(l1_7683), - HUNDRED_USDT // match amount from order - ); + ERC20(vm.envAddress("L1_USDT_ADDR")) + .approve( + address(l1_7683), + HUNDRED_USDT // match amount from order + ); // Fill the order bytes memory fillerData = abi.encode(TypeCasts.addressToBytes32(solver)); diff --git a/contracts/script/test/SwapERC20.s.sol b/contracts/script/test/SwapERC20.s.sol index 515cf485..775289db 100644 --- a/contracts/script/test/SwapERC20.s.sol +++ b/contracts/script/test/SwapERC20.s.sol @@ -43,10 +43,7 @@ contract SwapERC20 is Script, PermitSignature { }); IL1GatewayRouter.Witness memory witness = IL1GatewayRouter.Witness({ - direction: 0, - priceAfterSlippage: 0, - outputTokenAddress: L1_USDT_ADDR, - outputTokenAmount: outputTokenAmount + direction: 0, priceAfterSlippage: 0, outputTokenAddress: L1_USDT_ADDR, outputTokenAmount: outputTokenAmount }); bytes32 witnessEncoded = keccak256(abi.encode(T1Constants.WITNESS_TYPEHASH, witness)); @@ -74,9 +71,8 @@ contract SwapERC20 is Script, PermitSignature { // Check if the ERC20 gateway has approved the permit2 to transfer USDT if (T1StandardERC20(L1_USDT_ADDR).allowance(L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR, permit2) < outputTokenAmount) { - IL1ERC20Gateway(L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR).allowRouterToTransfer( - L1_USDT_ADDR, type(uint160).max, uint48(block.timestamp + 10_000_000) - ); + IL1ERC20Gateway(L1_STANDARD_ERC20_GATEWAY_PROXY_ADDR) + .allowRouterToTransfer(L1_USDT_ADDR, type(uint160).max, uint48(block.timestamp + 10_000_000)); } // Check if the ERC20 gateway has enough USDT to swap diff --git a/contracts/script/upgrade/UpgradeArbT17683.s.sol b/contracts/script/upgrade/UpgradeArbT17683.s.sol index a183ec84..92e73bfe 100644 --- a/contracts/script/upgrade/UpgradeArbT17683.s.sol +++ b/contracts/script/upgrade/UpgradeArbT17683.s.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { DeploymentUtils } from "../lib/DeploymentUtils.sol"; import { T1ERC7683 } from "../../src/7683/T1ERC7683.sol"; import { T1Constants } from "../../src/libraries/constants/T1Constants.sol"; diff --git a/contracts/script/upgrade/UpgradeBaseT17683.s.sol b/contracts/script/upgrade/UpgradeBaseT17683.s.sol index a3dd6020..2faa6561 100644 --- a/contracts/script/upgrade/UpgradeBaseT17683.s.sol +++ b/contracts/script/upgrade/UpgradeBaseT17683.s.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { DeploymentUtils } from "../lib/DeploymentUtils.sol"; diff --git a/contracts/script/upgrade/UpgradeT1Chain.s.sol b/contracts/script/upgrade/UpgradeT1Chain.s.sol index 6dc47c4b..a0a44c84 100644 --- a/contracts/script/upgrade/UpgradeT1Chain.s.sol +++ b/contracts/script/upgrade/UpgradeT1Chain.s.sol @@ -8,7 +8,9 @@ import { console } from "forge-std/console.sol"; import { DeploymentUtils } from "../lib/DeploymentUtils.sol"; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { T1Chain } from "../../src/L1/rollup/T1Chain.sol"; import { T1Owner } from "../../src/misc/T1Owner.sol"; @@ -42,7 +44,8 @@ contract UpgradeT1Chain is Script, DeploymentUtils { address private L1_T1_OWNER_ADDR = vm.envAddress("L1_T1_OWNER_ADDR"); address private L1_T1_CHAIN_PROXY_ADDR = vm.envAddress("L1_T1_CHAIN_PROXY_ADDR"); address private L1_MESSAGE_QUEUE_PROXY_ADDR = vm.envAddress("L1_MESSAGE_QUEUE_PROXY_ADDR"); - address private L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = vm.envAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR"); + address private L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR = + vm.envAddress("L1_MULTIPLE_VERSION_ROLLUP_VERIFIER_ADDR"); // Chain configuration uint64 private CHAIN_ID_L2 = uint64(vm.envUint("CHAIN_ID_L2")); @@ -71,16 +74,17 @@ contract UpgradeT1Chain is Script, DeploymentUtils { vm.toString(address(t1ChainImplementation)) ); - try T1Owner(payable(L1_T1_OWNER_ADDR)).execute( - L1_PROXY_ADMIN_ADDR, - 0, - abi.encodeWithSelector( - proxyAdmin.upgrade.selector, - ITransparentUpgradeableProxy(L1_T1_CHAIN_PROXY_ADDR), - address(t1ChainImplementation) - ), - SECURITY_COUNCIL_NO_DELAY_ROLE - ) { + try T1Owner(payable(L1_T1_OWNER_ADDR)) + .execute( + L1_PROXY_ADMIN_ADDR, + 0, + abi.encodeWithSelector( + proxyAdmin.upgrade.selector, + ITransparentUpgradeableProxy(L1_T1_CHAIN_PROXY_ADDR), + address(t1ChainImplementation) + ), + SECURITY_COUNCIL_NO_DELAY_ROLE + ) { console.log("T1Chain upgrade successful"); // Verify the upgrade was successful diff --git a/contracts/script/upgrade/UpgradeT1XChainReaderLogic.sol b/contracts/script/upgrade/UpgradeT1XChainReaderLogic.sol index 70b70a06..c68eb389 100644 --- a/contracts/script/upgrade/UpgradeT1XChainReaderLogic.sol +++ b/contracts/script/upgrade/UpgradeT1XChainReaderLogic.sol @@ -8,7 +8,9 @@ import { console } from "forge-std/console.sol"; import { DeploymentUtils } from "../lib/DeploymentUtils.sol"; import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { T1XChainReader } from "../../src/libraries/xChain/T1XChainReader.sol"; import { T1Owner } from "../../src/misc/T1Owner.sol"; @@ -63,14 +65,15 @@ abstract contract UpgradeT1XChainReaderLogic is Script, DeploymentUtils { vm.toString(newImplementation) ); - try T1Owner(payable(t1OwnerAddr)).execute( - proxyAdminAddr, - 0, - abi.encodeWithSelector( - proxyAdmin.upgrade.selector, ITransparentUpgradeableProxy(xChainReaderProxyAddr), newImplementation - ), - SECURITY_COUNCIL_NO_DELAY_ROLE - ) { + try T1Owner(payable(t1OwnerAddr)) + .execute( + proxyAdminAddr, + 0, + abi.encodeWithSelector( + proxyAdmin.upgrade.selector, ITransparentUpgradeableProxy(xChainReaderProxyAddr), newImplementation + ), + SECURITY_COUNCIL_NO_DELAY_ROLE + ) { console.log("T1XChainReader upgrade successful"); _verifyUpgrade(proxyAdminAddr, xChainReaderProxyAddr, newImplementation); } catch Error(string memory reason) { diff --git a/contracts/src/7683/T1ERC7683.sol b/contracts/src/7683/T1ERC7683.sol index d45e8700..e8414866 100644 --- a/contracts/src/7683/T1ERC7683.sol +++ b/contracts/src/7683/T1ERC7683.sol @@ -216,9 +216,10 @@ contract T1ERC7683 is IT1ERC7683, T1Permit2, AccessControlUpgradeable, EIP712 { view returns (ResolvedCrossChainOrder memory, bytes32, uint256) { - return _resolvedOrder( - _order.orderDataType, _order.user, _order.openDeadline, _order.fillDeadline, _order.orderData - ); + return + _resolvedOrder( + _order.orderDataType, _order.user, _order.openDeadline, _order.fillDeadline, _order.orderData + ); } /// @notice Resolves a OnchainCrossChainOrder. diff --git a/contracts/src/7683/T1Permit2.sol b/contracts/src/7683/T1Permit2.sol index cd45d8ba..56995ed1 100644 --- a/contracts/src/7683/T1Permit2.sol +++ b/contracts/src/7683/T1Permit2.sol @@ -110,15 +110,12 @@ abstract contract T1Permit2 { amount: _resolvedOrder.minReceived[i].amount }); transferDetails[i] = ISignatureTransfer.SignatureTransferDetails({ - to: _receiver, - requestedAmount: _resolvedOrder.minReceived[i].amount + to: _receiver, requestedAmount: _resolvedOrder.minReceived[i].amount }); } ISignatureTransfer.PermitBatchTransferFrom memory permit = ISignatureTransfer.PermitBatchTransferFrom({ - permitted: permitted, - nonce: _nonce, - deadline: _resolvedOrder.openDeadline + permitted: permitted, nonce: _nonce, deadline: _resolvedOrder.openDeadline }); PERMIT2.permitWitnessTransferFrom( diff --git a/contracts/src/L1/IL1T1Messenger.sol b/contracts/src/L1/IL1T1Messenger.sol index fdd5eca6..feac0b4f 100644 --- a/contracts/src/L1/IL1T1Messenger.sol +++ b/contracts/src/L1/IL1T1Messenger.sol @@ -10,7 +10,6 @@ interface IL1T1Messenger is IT1Messenger { * Events * * */ - /// @notice Emitted when the maximum number of times each message can be replayed is updated. /// @param oldMaxReplayTimes The old maximum number of times each message can be replayed. /// @param newMaxReplayTimes The new maximum number of times each message can be replayed. @@ -77,12 +76,5 @@ interface IL1T1Messenger is IT1Messenger { /// @param value The msg.value passed to the message call. /// @param messageNonce The nonce for the message to drop. /// @param message The content of the message. - function dropMessage( - address from, - address to, - uint256 value, - uint256 messageNonce, - bytes memory message - ) - external; + function dropMessage(address from, address to, uint256 value, uint256 messageNonce, bytes memory message) external; } diff --git a/contracts/src/L1/L1T1Messenger.sol b/contracts/src/L1/L1T1Messenger.sol index e59cc299..90c6ca9b 100644 --- a/contracts/src/L1/L1T1Messenger.sol +++ b/contracts/src/L1/L1T1Messenger.sol @@ -40,7 +40,6 @@ contract L1T1Messenger is T1MessengerBase, IL1T1Messenger { * Constants * * */ - /// @notice The address of Rollup contract. address public immutable rollup; @@ -170,7 +169,8 @@ contract L1T1Messenger is T1MessengerBase, IL1T1Messenger { external override whenNotPaused - // notInExecution + // notInExecution + { bytes32 _xDomainCalldataHash = keccak256(_encodeXDomainCalldata(_from, _to, _value, _nonce, _message)); require(!isL2MessageExecuted[_xDomainCalldataHash], "Message was already successfully executed"); @@ -218,7 +218,8 @@ contract L1T1Messenger is T1MessengerBase, IL1T1Messenger { payable override whenNotPaused - // notInExecution + // notInExecution + { // We will use a different `queueIndex` for the replaced message. However, the original `queueIndex` or `nonce` // is encoded in the `_message`. We will check the `xDomainCalldata` on layer 2 to avoid duplicated execution. @@ -285,7 +286,8 @@ contract L1T1Messenger is T1MessengerBase, IL1T1Messenger { external override whenNotPaused - // notInExecution + // notInExecution + { // The criteria for dropping a message: // 1. The message is a L1 message. diff --git a/contracts/src/L1/gateways/IL1ERC20Gateway.sol b/contracts/src/L1/gateways/IL1ERC20Gateway.sol index d660dd3a..9391e491 100644 --- a/contracts/src/L1/gateways/IL1ERC20Gateway.sol +++ b/contracts/src/L1/gateways/IL1ERC20Gateway.sol @@ -8,7 +8,6 @@ interface IL1ERC20Gateway { * Events * * */ - /// @notice Emitted when ERC20 token is withdrawn from L2 to L1 and transfer to recipient. /// @param l1Token The address of the token in L1. /// @param l2Token The address of the token in L2. diff --git a/contracts/src/L1/gateways/IL1ETHGateway.sol b/contracts/src/L1/gateways/IL1ETHGateway.sol index 6042fac6..dd7235ee 100644 --- a/contracts/src/L1/gateways/IL1ETHGateway.sol +++ b/contracts/src/L1/gateways/IL1ETHGateway.sol @@ -8,7 +8,6 @@ interface IL1ETHGateway { * Events * * */ - /// @notice Emitted when ETH is withdrawn from L2 to L1 and transfer to recipient. /// @param from The address of sender in L2. /// @param to The address of recipient in L1. diff --git a/contracts/src/L1/gateways/IL1GatewayRouter.sol b/contracts/src/L1/gateways/IL1GatewayRouter.sol index 0abbbeb0..2aaf6c27 100644 --- a/contracts/src/L1/gateways/IL1GatewayRouter.sol +++ b/contracts/src/L1/gateways/IL1GatewayRouter.sol @@ -13,7 +13,6 @@ interface IL1GatewayRouter is IL1ETHGateway, IL1ERC20Gateway { * Events * * */ - /// @notice Emitted when the address of ETH Gateway is updated. /// @param oldETHGateway The address of the old ETH Gateway. /// @param newEthGateway The address of the new ETH Gateway. diff --git a/contracts/src/L1/gateways/L1ETHGateway.sol b/contracts/src/L1/gateways/L1ETHGateway.sol index 3db01ef1..5847840a 100644 --- a/contracts/src/L1/gateways/L1ETHGateway.sol +++ b/contracts/src/L1/gateways/L1ETHGateway.sol @@ -23,7 +23,6 @@ contract L1ETHGateway is T1GatewayBase, IL1ETHGateway, IMessageDropCallback { * Constructor * * */ - /// @notice Constructor for `L1ETHGateway` implementation contract. /// /// @param _counterpart The address of `L2ETHGateway` contract in L2. diff --git a/contracts/src/L1/gateways/L1GatewayRouter.sol b/contracts/src/L1/gateways/L1GatewayRouter.sol index 9aa678be..3da2f5d5 100644 --- a/contracts/src/L1/gateways/L1GatewayRouter.sol +++ b/contracts/src/L1/gateways/L1GatewayRouter.sol @@ -4,8 +4,9 @@ pragma solidity ^0.8.25; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; -import { IERC20MetadataUpgradeable } from - "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; +import { + IERC20MetadataUpgradeable +} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; import { SafeERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import { IAllowanceTransfer } from "@uniswap/permit2/src/interfaces/IAllowanceTransfer.sol"; import { ISignatureTransfer } from "@uniswap/permit2/src/interfaces/ISignatureTransfer.sol"; @@ -163,22 +164,26 @@ contract L1GatewayRouter is OwnableUpgradeable, IL1GatewayRouter { bytes32 witness = keccak256(abi.encode(T1Constants.WITNESS_TYPEHASH, params.witness)); // Use Permit2 to validate and transfer input tokens from `owner` to the input gateway - ISignatureTransfer(permit2).permitWitnessTransferFrom( - params.permit, - ISignatureTransfer.SignatureTransferDetails({ - to: getERC20Gateway(params.permit.permitted.token), - requestedAmount: params.permit.permitted.amount - }), - params.owner, - witness, - T1Constants.WITNESS_TYPE_STRING, - params.sig - ); + ISignatureTransfer(permit2) + .permitWitnessTransferFrom( + params.permit, + ISignatureTransfer.SignatureTransferDetails({ + to: getERC20Gateway(params.permit.permitted.token), requestedAmount: params.permit.permitted.amount + }), + params.owner, + witness, + T1Constants.WITNESS_TYPE_STRING, + params.sig + ); // Use AllowanceTransfer to transfer the output tokens from the output gateway to the `owner` address - IAllowanceTransfer(permit2).transferFrom( - outputGateway, params.owner, uint160(params.witness.outputTokenAmount), params.witness.outputTokenAddress - ); + IAllowanceTransfer(permit2) + .transferFrom( + outputGateway, + params.owner, + uint160(params.witness.outputTokenAmount), + params.witness.outputTokenAddress + ); emit Swap( params.owner, diff --git a/contracts/src/L1/gateways/L1StandardERC20Gateway.sol b/contracts/src/L1/gateways/L1StandardERC20Gateway.sol index a8048c8f..81f1fd09 100644 --- a/contracts/src/L1/gateways/L1StandardERC20Gateway.sol +++ b/contracts/src/L1/gateways/L1StandardERC20Gateway.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.25; import { ClonesUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol"; -import { IERC20MetadataUpgradeable } from - "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; +import { + IERC20MetadataUpgradeable +} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; import { IL2ERC20Gateway } from "../../L2/gateways/IL2ERC20Gateway.sol"; import { IL1T1Messenger } from "../IL1T1Messenger.sol"; @@ -27,7 +28,6 @@ contract L1StandardERC20Gateway is L1ERC20Gateway { * Constants * * */ - /// @notice The address of T1StandardERC20 implementation in L2. address public immutable l2TokenImplementation; diff --git a/contracts/src/L1/gateways/L1WETHGateway.sol b/contracts/src/L1/gateways/L1WETHGateway.sol index 5c31f19c..0bdcbf9a 100644 --- a/contracts/src/L1/gateways/L1WETHGateway.sol +++ b/contracts/src/L1/gateways/L1WETHGateway.sol @@ -24,7 +24,6 @@ contract L1WETHGateway is L1ERC20Gateway { * Constants * * */ - /// @notice The address of L2 WETH address. address public immutable l2WETH; diff --git a/contracts/src/L1/rollup/IL1MessageQueue.sol b/contracts/src/L1/rollup/IL1MessageQueue.sol index d66c381f..257e18b9 100644 --- a/contracts/src/L1/rollup/IL1MessageQueue.sol +++ b/contracts/src/L1/rollup/IL1MessageQueue.sol @@ -8,7 +8,6 @@ interface IL1MessageQueue { * Events * * */ - /// @notice Emitted when a new L1 => L2 transaction is appended to the queue. /// @param sender The address of account who initiates the transaction. /// @param target The address of account who will receive the transaction. diff --git a/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol b/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol index fff766dd..9fde202f 100644 --- a/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol +++ b/contracts/src/L1/rollup/IL1MessageQueueWithGasPriceOracle.sol @@ -10,7 +10,6 @@ interface IL1MessageQueueWithGasPriceOracle is IL1MessageQueue { * Events * * */ - /// @notice Emitted when owner updates whitelist checker contract. /// @param _oldWhitelistChecker The address of old whitelist checker contract. /// @param _newWhitelistChecker The address of new whitelist checker contract. diff --git a/contracts/src/L1/rollup/IT1Chain.sol b/contracts/src/L1/rollup/IT1Chain.sol index e55b41ea..b67a22d9 100644 --- a/contracts/src/L1/rollup/IT1Chain.sol +++ b/contracts/src/L1/rollup/IT1Chain.sol @@ -10,7 +10,6 @@ interface IT1Chain { * Events * * */ - /// @notice Emitted when a new batch is committed. /// @param batchIndex The index of the batch. /// @param batchHash The hash of the batch. diff --git a/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol b/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol index 488173ec..dc1b8070 100644 --- a/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol +++ b/contracts/src/L1/rollup/L1MessageQueueWithGasPriceOracle.sol @@ -15,7 +15,6 @@ contract L1MessageQueueWithGasPriceOracle is L1MessageQueue, IL1MessageQueueWith * Constants * * */ - /// @notice The intrinsic gas for transaction. uint256 private constant INTRINSIC_GAS_TX = 21_000; diff --git a/contracts/src/L1/rollup/L2GasPriceOracle.sol b/contracts/src/L1/rollup/L2GasPriceOracle.sol index de1fbc1b..f707fd94 100644 --- a/contracts/src/L1/rollup/L2GasPriceOracle.sol +++ b/contracts/src/L1/rollup/L2GasPriceOracle.sol @@ -16,7 +16,6 @@ contract L2GasPriceOracle is OwnableUpgradeable, IL2GasPriceOracle { * Events * * */ - /// @notice Emitted when owner updates whitelist contract. /// @param _oldWhitelist The address of old whitelist contract. /// @param _newWhitelist The address of new whitelist contract. @@ -189,10 +188,7 @@ contract L2GasPriceOracle is OwnableUpgradeable, IL2GasPriceOracle { require(_txGasContractCreation > _txGas, "txGasContractCreation is less than txGas"); intrinsicParams = IntrinsicParams({ - txGas: _txGas, - txGasContractCreation: _txGasContractCreation, - zeroGas: _zeroGas, - nonZeroGas: _nonZeroGas + txGas: _txGas, txGasContractCreation: _txGasContractCreation, zeroGas: _zeroGas, nonZeroGas: _nonZeroGas }); emit IntrinsicParamsUpdated(_txGas, _txGasContractCreation, _zeroGas, _nonZeroGas); diff --git a/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol b/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol index dc1af58d..20106e1b 100644 --- a/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol +++ b/contracts/src/L1/rollup/MultipleVersionRollupVerifier.sol @@ -15,7 +15,6 @@ contract MultipleVersionRollupVerifier is IRollupVerifier, Ownable { * Events * * */ - /// @notice Emitted when the address of verifier is updated. /// @param version The version of the verifier. /// @param startBatchIndex The start batch index when the verifier will be used. diff --git a/contracts/src/L1/rollup/T1Chain.sol b/contracts/src/L1/rollup/T1Chain.sol index e3168317..174c73dc 100644 --- a/contracts/src/L1/rollup/T1Chain.sol +++ b/contracts/src/L1/rollup/T1Chain.sol @@ -421,9 +421,8 @@ contract T1Chain is OwnableUpgradeable, PausableUpgradeable, IT1Chain { // `getL1MessagePopped` codes are the same in V0, V1, V2, V3 uint256 l1MessagePoppedFirstBatch = BatchHeaderV0Codec.getL1MessagePopped(firstBatchPtr); unchecked { - IL1MessageQueue(messageQueue).resetPoppedCrossDomainMessage( - _totalL1MessagesPoppedOverallFirstBatch - l1MessagePoppedFirstBatch - ); + IL1MessageQueue(messageQueue) + .resetPoppedCrossDomainMessage(_totalL1MessagesPoppedOverallFirstBatch - l1MessagePoppedFirstBatch); } } diff --git a/contracts/src/L2/IL2T1Messenger.sol b/contracts/src/L2/IL2T1Messenger.sol index 91146ed0..7fca2678 100644 --- a/contracts/src/L2/IL2T1Messenger.sol +++ b/contracts/src/L2/IL2T1Messenger.sol @@ -10,7 +10,6 @@ interface IL2T1Messenger is IT1Messenger { * Events * * */ - /// @notice Emitted when the maximum number of times each message can fail in L2 is updated. /// @param oldMaxFailedExecutionTimes The old maximum number of times each message can fail in L2. /// @param newMaxFailedExecutionTimes The new maximum number of times each message can fail in L2. diff --git a/contracts/src/L2/gateways/IL2ERC20Gateway.sol b/contracts/src/L2/gateways/IL2ERC20Gateway.sol index 24a48e03..26cc30c9 100644 --- a/contracts/src/L2/gateways/IL2ERC20Gateway.sol +++ b/contracts/src/L2/gateways/IL2ERC20Gateway.sol @@ -8,7 +8,6 @@ interface IL2ERC20Gateway { * Events * * */ - /// @notice Emitted when ERC20 token is deposited from L1 to L2 and transfer to recipient. /// @param l1Token The address of the token in L1. /// @param l2Token The address of the token in L2. diff --git a/contracts/src/L2/gateways/IL2ETHGateway.sol b/contracts/src/L2/gateways/IL2ETHGateway.sol index 1ca0d9f3..e1859ab6 100644 --- a/contracts/src/L2/gateways/IL2ETHGateway.sol +++ b/contracts/src/L2/gateways/IL2ETHGateway.sol @@ -8,7 +8,6 @@ interface IL2ETHGateway { * Events * * */ - /// @notice Emitted when someone withdraw ETH from L2 to L1. /// @param from The address of sender in L2. /// @param to The address of recipient in L1. diff --git a/contracts/src/L2/gateways/IL2GatewayRouter.sol b/contracts/src/L2/gateways/IL2GatewayRouter.sol index 6f4565fd..f87a2792 100644 --- a/contracts/src/L2/gateways/IL2GatewayRouter.sol +++ b/contracts/src/L2/gateways/IL2GatewayRouter.sol @@ -11,7 +11,6 @@ interface IL2GatewayRouter is IL2ETHGateway, IL2ERC20Gateway { * Events * * */ - /// @notice Emitted when the address of ETH Gateway is updated. /// @param oldETHGateway The address of the old ETH Gateway. /// @param newEthGateway The address of the new ETH Gateway. diff --git a/contracts/src/L2/gateways/L2ERC20Gateway.sol b/contracts/src/L2/gateways/L2ERC20Gateway.sol index a4ac31d4..c8423514 100644 --- a/contracts/src/L2/gateways/L2ERC20Gateway.sol +++ b/contracts/src/L2/gateways/L2ERC20Gateway.sol @@ -12,7 +12,6 @@ abstract contract L2ERC20Gateway is T1GatewayBase, IL2ERC20Gateway { * Variables * * */ - /// @dev The storage slots for future usage. uint256[50] private __gap; diff --git a/contracts/src/L2/gateways/L2ETHGateway.sol b/contracts/src/L2/gateways/L2ETHGateway.sol index 2437214b..1a3d4082 100644 --- a/contracts/src/L2/gateways/L2ETHGateway.sol +++ b/contracts/src/L2/gateways/L2ETHGateway.sol @@ -20,7 +20,6 @@ contract L2ETHGateway is T1GatewayBase, IL2ETHGateway { * Constructor * * */ - /// @notice Constructor for `L2ETHGateway` implementation contract. /// /// @param _counterpart The address of `L1ETHGateway` contract in L1. diff --git a/contracts/src/L2/gateways/L2GatewayRouter.sol b/contracts/src/L2/gateways/L2GatewayRouter.sol index 85b1c57e..532df94c 100644 --- a/contracts/src/L2/gateways/L2GatewayRouter.sol +++ b/contracts/src/L2/gateways/L2GatewayRouter.sol @@ -19,7 +19,6 @@ contract L2GatewayRouter is OwnableUpgradeable, IL2GatewayRouter { * Variables * * */ - /// @notice The address of L2ETHGateway. address public ethGateway; diff --git a/contracts/src/L2/predeploys/IL1GasPriceOracle.sol b/contracts/src/L2/predeploys/IL1GasPriceOracle.sol index 6fc3f185..29ada7f2 100644 --- a/contracts/src/L2/predeploys/IL1GasPriceOracle.sol +++ b/contracts/src/L2/predeploys/IL1GasPriceOracle.sol @@ -8,7 +8,6 @@ interface IL1GasPriceOracle { * Events * * */ - /// @notice Emitted when current fee overhead is updated. /// @param overhead The current fee overhead updated. event OverheadUpdated(uint256 overhead); diff --git a/contracts/src/L2/predeploys/L1GasPriceOracle.sol b/contracts/src/L2/predeploys/L1GasPriceOracle.sol index 6cc10e1f..328fdfa6 100644 --- a/contracts/src/L2/predeploys/L1GasPriceOracle.sol +++ b/contracts/src/L2/predeploys/L1GasPriceOracle.sol @@ -13,7 +13,6 @@ contract L1GasPriceOracle is OwnableBase, IL1GasPriceOracle { * Events * * */ - /// @notice Emitted when owner updates whitelist contract. /// @param _oldWhitelist The address of old whitelist contract. /// @param _newWhitelist The address of new whitelist contract. diff --git a/contracts/src/L2/predeploys/L2MessageQueue.sol b/contracts/src/L2/predeploys/L2MessageQueue.sol index bcddbf62..638b4b2b 100644 --- a/contracts/src/L2/predeploys/L2MessageQueue.sol +++ b/contracts/src/L2/predeploys/L2MessageQueue.sol @@ -20,7 +20,6 @@ contract L2MessageQueue is AppendOnlyMerkleTree, OwnableBase { * Events * * */ - /// @notice Emitted when a new message is added to the merkle tree. /// @param index The index of the corresponding message. /// @param messageHash The hash of the corresponding message. diff --git a/contracts/src/libraries/IT1Messenger.sol b/contracts/src/libraries/IT1Messenger.sol index 158855f6..8d6d649e 100644 --- a/contracts/src/libraries/IT1Messenger.sol +++ b/contracts/src/libraries/IT1Messenger.sol @@ -8,7 +8,6 @@ interface IT1Messenger { * Events * * */ - /// @notice Emitted when a cross domain message is relayed successfully. /// @param messageHash The hash of the message. event RelayedMessage(bytes32 indexed messageHash); diff --git a/contracts/src/libraries/T1MessengerBase.sol b/contracts/src/libraries/T1MessengerBase.sol index 5bb94fbd..2eaea764 100644 --- a/contracts/src/libraries/T1MessengerBase.sol +++ b/contracts/src/libraries/T1MessengerBase.sol @@ -4,25 +4,21 @@ pragma solidity ^0.8.25; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; -import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import { + ReentrancyGuardUpgradeable +} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import { T1Constants } from "./constants/T1Constants.sol"; import { IT1Messenger } from "./IT1Messenger.sol"; // solhint-disable var-name-mixedcase -abstract contract T1MessengerBase is - OwnableUpgradeable, - PausableUpgradeable, - ReentrancyGuardUpgradeable, - IT1Messenger -{ +abstract contract T1MessengerBase is OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable, IT1Messenger { /** * * Events * * */ - /// @notice Emitted when owner updates fee vault contract. /// @param _oldFeeVault The address of old fee vault contract. /// @param _newFeeVault The address of new fee vault contract. diff --git a/contracts/src/libraries/codec/BatchHeaderV0Codec.sol b/contracts/src/libraries/codec/BatchHeaderV0Codec.sol index 78eb5109..1a5c1f71 100644 --- a/contracts/src/libraries/codec/BatchHeaderV0Codec.sol +++ b/contracts/src/libraries/codec/BatchHeaderV0Codec.sol @@ -190,7 +190,9 @@ library BatchHeaderV0Codec { function storeSkippedBitmap(uint256 batchPtr, bytes calldata _skippedL1MessageBitmap) internal pure { assembly { calldatacopy( - add(batchPtr, BATCH_HEADER_FIXED_LENGTH), _skippedL1MessageBitmap.offset, _skippedL1MessageBitmap.length + add(batchPtr, BATCH_HEADER_FIXED_LENGTH), + _skippedL1MessageBitmap.offset, + _skippedL1MessageBitmap.length ) } } diff --git a/contracts/src/libraries/codec/BatchHeaderV1Codec.sol b/contracts/src/libraries/codec/BatchHeaderV1Codec.sol index d4efc134..9faf3a68 100644 --- a/contracts/src/libraries/codec/BatchHeaderV1Codec.sol +++ b/contracts/src/libraries/codec/BatchHeaderV1Codec.sol @@ -120,7 +120,9 @@ library BatchHeaderV1Codec { function storeSkippedBitmap(uint256 batchPtr, bytes calldata _skippedL1MessageBitmap) internal pure { assembly { calldatacopy( - add(batchPtr, BATCH_HEADER_FIXED_LENGTH), _skippedL1MessageBitmap.offset, _skippedL1MessageBitmap.length + add(batchPtr, BATCH_HEADER_FIXED_LENGTH), + _skippedL1MessageBitmap.offset, + _skippedL1MessageBitmap.length ) } } diff --git a/contracts/src/libraries/common/OwnableBase.sol b/contracts/src/libraries/common/OwnableBase.sol index cd1cfee5..cb6239d8 100644 --- a/contracts/src/libraries/common/OwnableBase.sol +++ b/contracts/src/libraries/common/OwnableBase.sol @@ -8,7 +8,6 @@ abstract contract OwnableBase { * Events * * */ - /// @notice Emitted when owner is changed by current owner. /// @param _oldOwner The address of previous owner. /// @param _newOwner The address of new owner. diff --git a/contracts/src/libraries/constants/T1Constants.sol b/contracts/src/libraries/constants/T1Constants.sol index 3cce25a1..946cbaa0 100644 --- a/contracts/src/libraries/constants/T1Constants.sol +++ b/contracts/src/libraries/constants/T1Constants.sol @@ -31,7 +31,7 @@ library T1Constants { /// @notice The EIP-712 type string for the remaining after the witness. string internal constant WITNESS_TYPE_STRING = // solhint-disable-next-line max-line-length - "Witness witness)TokenPermissions(address token,uint256 amount)Witness(uint8 direction,uint256 priceAfterSlippage,address outputTokenAddress,uint256 outputTokenAmount)"; + "Witness witness)TokenPermissions(address token,uint256 amount)Witness(uint8 direction,uint256 priceAfterSlippage,address outputTokenAddress,uint256 outputTokenAmount)"; /// @notice The full EIP-712 type definition for the PermitWitnessTransferFrom typehash. bytes32 internal constant FULL_PERMITWITNESSTRANSFERFROM_TYPEHASH = keccak256( diff --git a/contracts/src/libraries/gateway/IT1Gateway.sol b/contracts/src/libraries/gateway/IT1Gateway.sol index 4d022a6f..bb2fd193 100644 --- a/contracts/src/libraries/gateway/IT1Gateway.sol +++ b/contracts/src/libraries/gateway/IT1Gateway.sol @@ -8,7 +8,6 @@ interface IT1Gateway { * Errors * * */ - /// @dev Thrown when the given address is `address(0)`. error ErrorZeroAddress(); diff --git a/contracts/src/libraries/gateway/T1GatewayBase.sol b/contracts/src/libraries/gateway/T1GatewayBase.sol index 0988f5ca..937293b2 100644 --- a/contracts/src/libraries/gateway/T1GatewayBase.sol +++ b/contracts/src/libraries/gateway/T1GatewayBase.sol @@ -3,7 +3,9 @@ pragma solidity ^0.8.25; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import { + ReentrancyGuardUpgradeable +} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import { IT1Gateway } from "./IT1Gateway.sol"; import { IT1Messenger } from "../IT1Messenger.sol"; @@ -18,7 +20,6 @@ abstract contract T1GatewayBase is ReentrancyGuardUpgradeable, OwnableUpgradeabl * Constants * * */ - /// @inheritdoc IT1Gateway address public immutable override counterpart; diff --git a/contracts/src/libraries/token/IT1ERC20Upgradeable.sol b/contracts/src/libraries/token/IT1ERC20Upgradeable.sol index fe225a67..88633a8d 100644 --- a/contracts/src/libraries/token/IT1ERC20Upgradeable.sol +++ b/contracts/src/libraries/token/IT1ERC20Upgradeable.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.25; import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; -import { IERC20PermitUpgradeable } from - "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol"; +import { + IERC20PermitUpgradeable +} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol"; // The recommended ERC20 implementation for bridge token. // deployed in L2 when original token is on L1 diff --git a/contracts/src/libraries/token/T1StandardERC20.sol b/contracts/src/libraries/token/T1StandardERC20.sol index d8489063..6fa567c3 100644 --- a/contracts/src/libraries/token/T1StandardERC20.sol +++ b/contracts/src/libraries/token/T1StandardERC20.sol @@ -3,8 +3,9 @@ pragma solidity ^0.8.25; import { ERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; -import { ERC20PermitUpgradeable } from - "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; +import { + ERC20PermitUpgradeable +} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; import { IT1ERC20Upgradeable } from "./IT1ERC20Upgradeable.sol"; import { IERC677Receiver } from "../callbacks/IERC677Receiver.sol"; diff --git a/contracts/src/libraries/verifier/IRollupVerifier.sol b/contracts/src/libraries/verifier/IRollupVerifier.sol index efd19e53..0b9b4ba6 100644 --- a/contracts/src/libraries/verifier/IRollupVerifier.sol +++ b/contracts/src/libraries/verifier/IRollupVerifier.sol @@ -9,13 +9,7 @@ interface IRollupVerifier { /// @param batchIndex The batch index to verify. /// @param aggrProof The aggregated proof. /// @param publicInputHash The public input hash. - function verifyAggregateProof( - uint256 batchIndex, - bytes calldata aggrProof, - bytes32 publicInputHash - ) - external - view; + function verifyAggregateProof(uint256 batchIndex, bytes calldata aggrProof, bytes32 publicInputHash) external view; /// @notice Verify aggregate zk proof. /// @param version The version of verifier to use. diff --git a/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol b/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol index 945707ff..e5f2268c 100644 --- a/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol +++ b/contracts/src/libraries/verifier/ZkEvmVerifierV1.sol @@ -12,7 +12,6 @@ contract ZkEvmVerifierV1 is IZkEvmVerifierV1 { * Errors * * */ - /// @dev Thrown when aggregate zk proof verification is failed. error VerificationFailed(); diff --git a/contracts/src/libraries/xChain/T1XChainReader.sol b/contracts/src/libraries/xChain/T1XChainReader.sol index 91c98b4b..c167cf1f 100644 --- a/contracts/src/libraries/xChain/T1XChainReader.sol +++ b/contracts/src/libraries/xChain/T1XChainReader.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import { + ReentrancyGuardUpgradeable +} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import { WithdrawTrieVerifier } from "../verifier/WithdrawTrieVerifier.sol"; import { IT1XChainReader } from "./IT1XChainReader.sol"; diff --git a/contracts/src/mocks/T1ChainMockBlob.sol b/contracts/src/mocks/T1ChainMockBlob.sol index 40632dda..caec9caf 100644 --- a/contracts/src/mocks/T1ChainMockBlob.sol +++ b/contracts/src/mocks/T1ChainMockBlob.sol @@ -22,11 +22,7 @@ contract T1ChainMockBlob is T1Chain { /// @param _chainId The chain id of L2. /// @param _messageQueue The address of `L1MessageQueue` contract. /// @param _verifier The address of zkevm verifier contract. - constructor( - uint64 _chainId, - address _messageQueue, - address _verifier - ) + constructor(uint64 _chainId, address _messageQueue, address _verifier) T1Chain(_chainId, _messageQueue, _verifier) { } diff --git a/contracts/src/test/7683/ClosedAuctionTest.sol b/contracts/src/test/7683/ClosedAuctionTest.sol index b0b25b06..111f1ea0 100644 --- a/contracts/src/test/7683/ClosedAuctionTest.sol +++ b/contracts/src/test/7683/ClosedAuctionTest.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; import { TypeCasts } from "@hyperlane-xyz/libs/TypeCasts.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { OrderData, OrderEncoder } from "../../../src/libraries/7683/OrderEncoder.sol"; import { OnchainCrossChainOrder } from "../../../src/interfaces/IERC7683.sol"; diff --git a/contracts/src/test/7683/PausableTest.t.sol b/contracts/src/test/7683/PausableTest.t.sol index 5e6a7ed7..3121c46a 100644 --- a/contracts/src/test/7683/PausableTest.t.sol +++ b/contracts/src/test/7683/PausableTest.t.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; import { TypeCasts } from "@hyperlane-xyz/libs/TypeCasts.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { ISignatureTransfer } from "@uniswap/permit2/src/interfaces/IPermit2.sol"; import { IT1ERC7683 } from "../../../src/interfaces/IT1ERC7683.sol"; diff --git a/contracts/src/test/7683/T1XChainReaderTest.t.sol b/contracts/src/test/7683/T1XChainReaderTest.t.sol index 62f3f646..6b1cd95e 100644 --- a/contracts/src/test/7683/T1XChainReaderTest.t.sol +++ b/contracts/src/test/7683/T1XChainReaderTest.t.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; import { TypeCasts } from "@hyperlane-xyz/libs/TypeCasts.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { OrderData, OrderEncoder } from "../../../src/libraries/7683/OrderEncoder.sol"; import { OnchainCrossChainOrder } from "../../../src/interfaces/IERC7683.sol"; diff --git a/contracts/src/test/L1ETHGateway.t.sol b/contracts/src/test/L1ETHGateway.t.sol index 376cc4a9..408f38cc 100644 --- a/contracts/src/test/L1ETHGateway.t.sol +++ b/contracts/src/test/L1ETHGateway.t.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L1GatewayRouter } from "../L1/gateways/L1GatewayRouter.sol"; import { IL1ETHGateway, L1ETHGateway } from "../L1/gateways/L1ETHGateway.sol"; diff --git a/contracts/src/test/L1GatewayRouter.t.sol b/contracts/src/test/L1GatewayRouter.t.sol index 4abb04b8..cf1fafdd 100644 --- a/contracts/src/test/L1GatewayRouter.t.sol +++ b/contracts/src/test/L1GatewayRouter.t.sol @@ -5,7 +5,9 @@ pragma solidity ^0.8.25; import { WETH } from "solmate/tokens/WETH.sol"; import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { DeployPermit2 } from "@uniswap/permit2/test/utils/DeployPermit2.sol"; import { ISignatureTransfer } from "@uniswap/permit2/src/interfaces/ISignatureTransfer.sol"; @@ -511,10 +513,7 @@ contract L1GatewayRouterTest is L1GatewayTestBase, DeployPermit2, PermitSignatur }); IL1GatewayRouter.Witness memory witness = IL1GatewayRouter.Witness({ - direction: 0, - priceAfterSlippage: 0, - outputTokenAddress: address(aave), - outputTokenAmount: 1e21 + direction: 0, priceAfterSlippage: 0, outputTokenAddress: address(aave), outputTokenAmount: 1e21 }); return IL1GatewayRouter.SwapParams({ permit: permit, owner: address(1), witness: witness, sig: bytes("") }); diff --git a/contracts/src/test/L1GatewayTestBase.t.sol b/contracts/src/test/L1GatewayTestBase.t.sol index 41003b06..82a8c1b7 100644 --- a/contracts/src/test/L1GatewayTestBase.t.sol +++ b/contracts/src/test/L1GatewayTestBase.t.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L1MessageQueueWithGasPriceOracle } from "../L1/rollup/L1MessageQueueWithGasPriceOracle.sol"; import { L2GasPriceOracle } from "../L1/rollup/L2GasPriceOracle.sol"; @@ -140,7 +142,7 @@ abstract contract L1GatewayTestBase is T1TestBase { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; rollup.setBlobVersionedHash(blobVersionedHash); // commit one batch diff --git a/contracts/src/test/L1MessageQueue.t.sol b/contracts/src/test/L1MessageQueue.t.sol index c1047ae2..b9e65414 100644 --- a/contracts/src/test/L1MessageQueue.t.sol +++ b/contracts/src/test/L1MessageQueue.t.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L1MessageQueue } from "../L1/rollup/L1MessageQueue.sol"; import { L2GasPriceOracle } from "../L1/rollup/L2GasPriceOracle.sol"; diff --git a/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol b/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol index 61e302c5..f656eaae 100644 --- a/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol +++ b/contracts/src/test/L1MessageQueueWithGasPriceOracle.t.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { IL1MessageQueueWithGasPriceOracle } from "../L1/rollup/IL1MessageQueueWithGasPriceOracle.sol"; import { L1MessageQueueWithGasPriceOracle } from "../L1/rollup/L1MessageQueueWithGasPriceOracle.sol"; diff --git a/contracts/src/test/L1StandardERC20Gateway.t.sol b/contracts/src/test/L1StandardERC20Gateway.t.sol index 972ec293..56895e5e 100644 --- a/contracts/src/test/L1StandardERC20Gateway.t.sol +++ b/contracts/src/test/L1StandardERC20Gateway.t.sol @@ -4,9 +4,12 @@ pragma solidity ^0.8.25; import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import { IERC20MetadataUpgradeable } from - "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + IERC20MetadataUpgradeable +} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; import { DeployPermit2 } from "@uniswap/permit2/test/utils/DeployPermit2.sol"; import { IAllowanceTransfer } from "@uniswap/permit2/src/interfaces/IAllowanceTransfer.sol"; diff --git a/contracts/src/test/L1T1Messenger.t.sol b/contracts/src/test/L1T1Messenger.t.sol index 04ce0028..02d7a9a8 100644 --- a/contracts/src/test/L1T1Messenger.t.sol +++ b/contracts/src/test/L1T1Messenger.t.sol @@ -338,7 +338,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { bytes32 batchHash0 = rollup.committedBatches(0); bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; assembly { mstore8(add(batchHeader1, 0x20), 3) // version mstore(add(batchHeader1, add(0x20, 1)), shl(192, 1)) // batchIndex @@ -366,7 +366,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { // generated with off-chain merkle proof generator bytes memory proof = // solhint-disable-next-line max-line-length - hex"00000000000000000000000000000000000000000000000000000000000000005bc8d719dee759f579606f5e9326010c9b4f1c89d2579636761a6bd37e348f4e"; + hex"00000000000000000000000000000000000000000000000000000000000000005bc8d719dee759f579606f5e9326010c9b4f1c89d2579636761a6bd37e348f4e"; IL1T1Messenger.L2MessageProof memory messageProof = IL1T1Messenger.L2MessageProof({ batchIndex: 1, merkleProof: proof }); uint256 nonce = 2; @@ -393,7 +393,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { bytes memory proof = // solhint-disable-next-line max-line-length - hex""; + hex""; IL1T1Messenger.L2MessageProof memory messageProof = IL1T1Messenger.L2MessageProof({ batchIndex: 1, merkleProof: proof }); // hash f527187db10d953f02ec890a9d325af97abfcf3ee8fc4d3e388c3a38c8905065 @@ -401,7 +401,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { uint256 msgValue = 1_000_000_000_000_000; bytes memory message = // solhint-disable-next-line max-line-length - hex"8eaac8a30000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa7760000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa77600000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"; + hex"8eaac8a30000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa7760000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa77600000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"; address from = address(0x454A310f46C8d9403ba6F6c514aD3fDE1ad97a5E); address to = address(0x8260eca2072D01c561ea8Cc7e9ba504e10A00ddC); // does not revert @@ -423,7 +423,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { // generated with off-chain merkle proof generator bytes memory proof = // solhint-disable-next-line max-line-length - hex"f527187db10d953f02ec890a9d325af97abfcf3ee8fc4d3e388c3a38c8905065"; + hex"f527187db10d953f02ec890a9d325af97abfcf3ee8fc4d3e388c3a38c8905065"; IL1T1Messenger.L2MessageProof memory messageProof = IL1T1Messenger.L2MessageProof({ batchIndex: 1, merkleProof: proof }); // hash 0x8572b59cc4b45153d52602d23eef03110237f38e16d762df7bc65210d9552530 @@ -431,7 +431,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { uint256 msgValue = 1_000_000_000_000_000; bytes memory message = // solhint-disable-next-line max-line-length - hex"8eaac8a30000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa7760000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa77600000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"; + hex"8eaac8a30000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa7760000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa77600000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"; address from = address(0x454A310f46C8d9403ba6F6c514aD3fDE1ad97a5E); address to = address(0x8260eca2072D01c561ea8Cc7e9ba504e10A00ddC); // does not revert @@ -462,7 +462,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { uint256 msgValue = 1_000_000_000_000_000; bytes memory message = // solhint-disable-next-line max-line-length - hex"8eaac8a30000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa7760000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa77600000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"; + hex"8eaac8a30000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa7760000000000000000000000008943545177806ed17b9f23f0a21ee5948ecaa77600000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"; address from = address(0x454A310f46C8d9403ba6F6c514aD3fDE1ad97a5E); address to = address(0x8260eca2072D01c561ea8Cc7e9ba504e10A00ddC); // does not revert @@ -485,7 +485,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { bytes memory proof = // solhint-disable-next-line max-line-length - hex""; + hex""; IL1T1Messenger.L2MessageProof memory messageProof = IL1T1Messenger.L2MessageProof({ batchIndex: 1, merkleProof: proof }); // hash f527187db10d953f02ec890a9d325af97abfcf3ee8fc4d3e388c3a38c8905065 @@ -493,7 +493,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { uint256 msgValue = 100_000_000_000_000; bytes memory message = // solhint-disable-next-line max-line-length - hex""; + hex""; address from = address(0x82a5B34bEa21E55C2e6adA0d4f811EBf3A547640); address to = address(0x82a5B34bEa21E55C2e6adA0d4f811EBf3A547640); // does not revert @@ -516,7 +516,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { bytes memory proof = // solhint-disable-next-line max-line-length - hex"130cef0bc21be7263033e5b153601dcb98684296fc29cfe5e41173b6b18ee6bf"; + hex"130cef0bc21be7263033e5b153601dcb98684296fc29cfe5e41173b6b18ee6bf"; IL1T1Messenger.L2MessageProof memory messageProof = IL1T1Messenger.L2MessageProof({ batchIndex: 1, merkleProof: proof }); // hash @@ -524,7 +524,7 @@ contract L1T1MessengerTest is L1GatewayTestBase { uint256 msgValue = 100_000_000_000_000; bytes memory message = // solhint-disable-next-line max-line-length - hex""; + hex""; address from = address(0x82a5B34bEa21E55C2e6adA0d4f811EBf3A547640); address to = address(0x82a5B34bEa21E55C2e6adA0d4f811EBf3A547640); // does not revert diff --git a/contracts/src/test/L1WETHGateway.t.sol b/contracts/src/test/L1WETHGateway.t.sol index ab57fcbb..b66bf632 100644 --- a/contracts/src/test/L1WETHGateway.t.sol +++ b/contracts/src/test/L1WETHGateway.t.sol @@ -4,7 +4,9 @@ pragma solidity ^0.8.25; import { WETH } from "solmate/tokens/WETH.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L1GatewayRouter } from "../L1/gateways/L1GatewayRouter.sol"; import { IL1ERC20Gateway, L1WETHGateway } from "../L1/gateways/L1WETHGateway.sol"; diff --git a/contracts/src/test/L2ETHGateway.t.sol b/contracts/src/test/L2ETHGateway.t.sol index cbcf37d7..b98bbb0b 100644 --- a/contracts/src/test/L2ETHGateway.t.sol +++ b/contracts/src/test/L2ETHGateway.t.sol @@ -2,7 +2,9 @@ pragma solidity ^0.8.25; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L2GatewayRouter } from "../L2/gateways/L2GatewayRouter.sol"; import { IL1ETHGateway, L1ETHGateway } from "../L1/gateways/L1ETHGateway.sol"; diff --git a/contracts/src/test/L2GatewayRouter.t.sol b/contracts/src/test/L2GatewayRouter.t.sol index 6a93a968..2cbd03f7 100644 --- a/contracts/src/test/L2GatewayRouter.t.sol +++ b/contracts/src/test/L2GatewayRouter.t.sol @@ -4,7 +4,9 @@ pragma solidity ^0.8.25; import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { L1ETHGateway } from "../L1/gateways/L1ETHGateway.sol"; import { L1StandardERC20Gateway } from "../L1/gateways/L1StandardERC20Gateway.sol"; diff --git a/contracts/src/test/L2StandardERC20Gateway.t.sol b/contracts/src/test/L2StandardERC20Gateway.t.sol index cb5ec8e5..89c928da 100644 --- a/contracts/src/test/L2StandardERC20Gateway.t.sol +++ b/contracts/src/test/L2StandardERC20Gateway.t.sol @@ -4,7 +4,9 @@ pragma solidity ^0.8.25; import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { IL1ERC20Gateway, L1StandardERC20Gateway } from "../L1/gateways/L1StandardERC20Gateway.sol"; import { L2GatewayRouter } from "../L2/gateways/L2GatewayRouter.sol"; diff --git a/contracts/src/test/L2T1Messenger.t.sol b/contracts/src/test/L2T1Messenger.t.sol index 9c3a03b4..e6920963 100644 --- a/contracts/src/test/L2T1Messenger.t.sol +++ b/contracts/src/test/L2T1Messenger.t.sol @@ -40,11 +40,9 @@ contract L2T1MessengerTest is Test { l1GasOracle = new L1GasPriceOracle(address(this)); l2GasOracle = L2GasPriceOracle(payable(new ERC1967Proxy(address(new L2GasPriceOracle()), new bytes(0)))); l2Messenger = L2T1Messenger( - payable( - new ERC1967Proxy( + payable(new ERC1967Proxy( address(new L2T1Messenger(address(l1Messenger), address(l2MessageQueue))), new bytes(0) - ) - ) + )) ); mockCallbackRecipient = new MockCallbackRecipient(); diff --git a/contracts/src/test/L2WETHGateway.t.sol b/contracts/src/test/L2WETHGateway.t.sol index 0bfc581f..8301155e 100644 --- a/contracts/src/test/L2WETHGateway.t.sol +++ b/contracts/src/test/L2WETHGateway.t.sol @@ -4,7 +4,9 @@ pragma solidity ^0.8.25; import { WETH } from "solmate/tokens/WETH.sol"; -import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import { + ITransparentUpgradeableProxy +} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import { IL1ERC20Gateway, L1WETHGateway } from "../L1/gateways/L1WETHGateway.sol"; import { L2GatewayRouter } from "../L2/gateways/L2GatewayRouter.sol"; diff --git a/contracts/src/test/T1Chain.t.sol b/contracts/src/test/T1Chain.t.sol index 1c2a0ce6..93c7c312 100644 --- a/contracts/src/test/T1Chain.t.sol +++ b/contracts/src/test/T1Chain.t.sol @@ -185,9 +185,8 @@ contract T1ChainTest is Test { T1ChainMockBlob impl = new T1ChainMockBlob(rollup.layer2ChainId(), rollup.messageQueue(), rollup.verifier()); admin.upgrade(ITransparentUpgradeableProxy(address(rollup)), address(impl)); // this is keccak(""); - T1ChainMockBlob(address(rollup)).setBlobVersionedHash( - 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 - ); + T1ChainMockBlob(address(rollup)) + .setBlobVersionedHash(0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470); bytes32 batchHash0 = rollup.committedBatches(0); bytes memory batchHeader1 = new bytes(121); @@ -252,7 +251,7 @@ contract T1ChainTest is Test { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; T1ChainMockBlob(address(rollup)).setBlobVersionedHash(blobVersionedHash); bytes32 batchHash0 = rollup.committedBatches(0); @@ -359,7 +358,7 @@ contract T1ChainTest is Test { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; T1ChainMockBlob(address(rollup)).setBlobVersionedHash(blobVersionedHash); bytes memory bitmap; @@ -480,7 +479,8 @@ contract T1ChainTest is Test { // 013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757 // 66b68a5092940d88a8c6f203d2071303557c024275d8ceaa2e12662bc61c8d8f // solhint-disable-next-line max-line-length - // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28000000000000000000000000000000000000000000000000000000000000002a + // + // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28000000000000000000000000000000000000000000000000000000000000002a // => hash for batch header // b9dff5d21381176a73b20a9294eb2703c803113f9559e358708c659fa1cf62eb bytes memory batchHeader2 = new bytes(121 + 32 + 32); @@ -521,7 +521,8 @@ contract T1ChainTest is Test { bitmap = new bytes(64); assembly { mstore( - add(bitmap, add(0x20, 0)), 77194726158210796949047323339125271902179989777093709359638389338608753093160 + add(bitmap, add(0x20, 0)), + 77194726158210796949047323339125271902179989777093709359638389338608753093160 ) // bitmap0 mstore(add(bitmap, add(0x20, 32)), 42) // bitmap1 } @@ -702,7 +703,7 @@ contract T1ChainTest is Test { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; T1ChainMockBlob(address(rollup)).setBlobVersionedHash(blobVersionedHash); chunk0 = new bytes(1 + 60); @@ -766,7 +767,7 @@ contract T1ChainTest is Test { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; T1ChainMockBlob(address(rollup)).setBlobVersionedHash(blobVersionedHash); bytes[] memory chunks = new bytes[](1); @@ -858,7 +859,7 @@ contract T1ChainTest is Test { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; T1ChainMockBlob(address(rollup)).setBlobVersionedHash(blobVersionedHash); bytes memory bitmap; @@ -1013,7 +1014,8 @@ contract T1ChainTest is Test { bitmap = new bytes(64); assembly { mstore( - add(bitmap, add(0x20, 0)), 77194726158210796949047323339125271902179989777093709359638389338608753093160 + add(bitmap, add(0x20, 0)), + 77194726158210796949047323339125271902179989777093709359638389338608753093160 ) // bitmap0 mstore(add(bitmap, add(0x20, 32)), 42) // bitmap1 } @@ -1023,13 +1025,13 @@ contract T1ChainTest is Test { vm.startPrank(address(0)); vm.expectRevert(T1Chain.ErrorTooManyTxsInOneChunk.selector); rollup.commitBatchWithBlobProof(3, batchHeader1, chunks, bitmap, blobDataProof); // first chunk with too many - // txs + // txs vm.stopPrank(); rollup.updateMaxNumTxInChunk(185); // 5+10+300 - 2 - 127 vm.startPrank(address(0)); vm.expectRevert(T1Chain.ErrorTooManyTxsInOneChunk.selector); rollup.commitBatchWithBlobProof(3, batchHeader1, chunks, bitmap, blobDataProof); // second chunk with too many - // txs + // txs vm.stopPrank(); rollup.updateMaxNumTxInChunk(186); @@ -1158,7 +1160,7 @@ contract T1ChainTest is Test { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; T1ChainMockBlob(address(rollup)).setBlobVersionedHash(blobVersionedHash); bytes memory bitmap; @@ -1306,7 +1308,8 @@ contract T1ChainTest is Test { bitmap = new bytes(64); assembly { mstore( - add(bitmap, add(0x20, 0)), 77194726158210796949047323339125271902179989777093709359638389338608753093160 + add(bitmap, add(0x20, 0)), + 77194726158210796949047323339125271902179989777093709359638389338608753093160 ) // bitmap0 mstore(add(bitmap, add(0x20, 32)), 42) // bitmap1 } @@ -1368,7 +1371,8 @@ contract T1ChainTest is Test { bytes32 blobVersionedHash = 0x013590dc3544d56629ba81bb14d4d31248f825001653aa575eb8e3a719046757; // bytes memory blobDataProof = // solhint-disable-next-line max-line-length - // hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + // + // hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; T1ChainMockBlob(address(rollup)).setBlobVersionedHash(blobVersionedHash); // caller not owner, revert diff --git a/contracts/src/test/WithdrawTrieVerifier.t.sol b/contracts/src/test/WithdrawTrieVerifier.t.sol index e7d6cbae..7253405c 100644 --- a/contracts/src/test/WithdrawTrieVerifier.t.sol +++ b/contracts/src/test/WithdrawTrieVerifier.t.sol @@ -37,6 +37,7 @@ contract WithdrawTrieVerifierTest is Test { nonces[2] = 2; proofs[2] = // solhint-disable-next-line max-line-length + hex"0000000000000000000000000000000000000000000000000000000000000000e90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0"; roots[3] = hex"a9bb8c3f1f12e9aa903a50c47f314b57610a3ab32f2d463293f58836def38d36"; @@ -44,6 +45,7 @@ contract WithdrawTrieVerifierTest is Test { nonces[3] = 3; proofs[3] = // solhint-disable-next-line max-line-length + hex"0000000000000000000000000000000000000000000000000000000000000003e90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0"; for (uint256 i = 0; i < 4; i++) { diff --git a/contracts/src/test/mocks/MockT1Messenger.sol b/contracts/src/test/mocks/MockT1Messenger.sol index 62ac5aa8..5834d7ca 100644 --- a/contracts/src/test/mocks/MockT1Messenger.sol +++ b/contracts/src/test/mocks/MockT1Messenger.sol @@ -41,8 +41,7 @@ contract MockT1Messenger is IT1Messenger { uint64 destChainId ) external - payable - { } + payable { } function sendMessage( address target, @@ -53,6 +52,5 @@ contract MockT1Messenger is IT1Messenger { address callbackAddress ) external - payable - { } + payable { } } diff --git a/contracts/src/test/utils/BatchHeaders.sol b/contracts/src/test/utils/BatchHeaders.sol index 72600733..9294d469 100644 --- a/contracts/src/test/utils/BatchHeaders.sol +++ b/contracts/src/test/utils/BatchHeaders.sol @@ -10,7 +10,7 @@ library BatchHeaders { bytes32 batchHash0 = rollup.committedBatches(0); bytes memory blobDataProof = // solhint-disable-next-line max-line-length - hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; + hex"2c9d777660f14ad49803a6442935c0d24a0d83551de5995890bf70a17d24e68753ab0fe6807c7081f0885fe7da741554d658a03730b1fa006f8319f8b993bcb0a5a0c9e8a145c5ef6e415c245690effa2914ec9393f58a7251d30c0657da1453d9ad906eae8b97dd60c9a216f81b4df7af34d01e214e1ec5865f0133ecc16d7459e49dab66087340677751e82097fbdd20551d66076f425775d1758a9dfd186b"; assembly { mstore8(add(batchHeader1, 0x20), 3) // version mstore(add(batchHeader1, add(0x20, 1)), shl(192, 1)) // batchIndex diff --git a/contracts/src/test/utils/T1MurkyMerkle.sol b/contracts/src/test/utils/T1MurkyMerkle.sol index 8862fb81..77ef17ce 100644 --- a/contracts/src/test/utils/T1MurkyMerkle.sol +++ b/contracts/src/test/utils/T1MurkyMerkle.sol @@ -12,7 +12,6 @@ contract T1MurkyMerkle is MurkyMerkleBase { * HASHING FUNCTION * * */ - /// ascending sort and concat prior to hashing function hashLeafPairs(bytes32 left, bytes32 right) public pure override returns (bytes32 _hash) { assembly { diff --git a/contracts/src/test/xYield/xYieldForkTest.t.sol b/contracts/src/test/xYield/xYieldForkTest.t.sol index 5f0cdc35..959cfe7c 100644 --- a/contracts/src/test/xYield/xYieldForkTest.t.sol +++ b/contracts/src/test/xYield/xYieldForkTest.t.sol @@ -392,9 +392,7 @@ contract xYieldForkTest is Test { balanceUpdates[0] = xYieldVault.BalanceUpdate({ recipient: bob, amount: bobSharesRemote, txType: xYieldVault.TxType.Deposit }); balanceUpdates[1] = xYieldVault.BalanceUpdate({ - recipient: charlie, - amount: charlieSharesRemote, - txType: xYieldVault.TxType.Deposit + recipient: charlie, amount: charlieSharesRemote, txType: xYieldVault.TxType.Deposit }); vm.startPrank(guardian); @@ -483,14 +481,10 @@ contract xYieldForkTest is Test { // Update totals to reflect both operations xYieldVault.BalanceUpdate[] memory withdrawUpdates = new xYieldVault.BalanceUpdate[](2); withdrawUpdates[0] = xYieldVault.BalanceUpdate({ - recipient: bob, - amount: sharesBurnedByWithdraw, - txType: xYieldVault.TxType.Withdraw + recipient: bob, amount: sharesBurnedByWithdraw, txType: xYieldVault.TxType.Withdraw }); withdrawUpdates[1] = xYieldVault.BalanceUpdate({ - recipient: charlie, - amount: sharesToRedeem, - txType: xYieldVault.TxType.Withdraw + recipient: charlie, amount: sharesToRedeem, txType: xYieldVault.TxType.Withdraw }); uint256 newTotalSharesGlobal = totalSharesGlobal - sharesBurnedByWithdraw - sharesToRedeem; diff --git a/contracts/src/test/xYield/xYieldTest.t.sol b/contracts/src/test/xYield/xYieldTest.t.sol index 68d3d172..6555d837 100644 --- a/contracts/src/test/xYield/xYieldTest.t.sol +++ b/contracts/src/test/xYield/xYieldTest.t.sol @@ -64,8 +64,7 @@ contract MockSpokePool { bytes calldata ) external - payable - { } + payable { } function counterpart() external pure returns (address) { return address(0x1234); @@ -385,9 +384,7 @@ contract xYieldTest is Test { } return OnchainCrossChainOrder({ - fillDeadline: fillDeadline, - orderDataType: OrderEncoder.orderDataType(), - orderData: abi.encode(orderData) + fillDeadline: fillDeadline, orderDataType: OrderEncoder.orderDataType(), orderData: abi.encode(orderData) }); } } diff --git a/contracts/src/xYield/MintableERC20.sol b/contracts/src/xYield/MintableERC20.sol index c6ecd888..5ab9f25f 100644 --- a/contracts/src/xYield/MintableERC20.sol +++ b/contracts/src/xYield/MintableERC20.sol @@ -11,6 +11,11 @@ contract MintableERC20 is ERC20 { /// @param newMinter The address now authorized to mint event MinterChanged(address indexed oldMinter, address indexed newMinter); + /// @notice Emitted when an address burns tokens. + /// @param account The address that burnt their tokens + /// @param amount The amount that was burnt + event Burn(address indexed account, uint256 indexed amount); + /// @dev Thrown if the minter would be set to the zero address error ZeroAddress(); /// @dev Thrown if the minter cannot be set due to an invalid input @@ -53,4 +58,11 @@ contract MintableERC20 is ERC20 { /// @dev The standard burn function is already public and allows any address to burn their own tokens, /// emitting a Transfer event to address(0) as the burn signal. Thus, no custom burn event is defined. + + /// @notice Burns own tokens + /// @param amount The amount of tokens to burn + function burn(uint256 amount) external { + _burn(_msgSender(), amount); + emit Burn(_msgSender(), amount); + } }