diff --git a/l1-contracts/contracts/bridge/L2SharedBridgeLegacy.sol b/l1-contracts/contracts/bridge/L2SharedBridgeLegacy.sol index 03d692f3e..561364e6f 100644 --- a/l1-contracts/contracts/bridge/L2SharedBridgeLegacy.sol +++ b/l1-contracts/contracts/bridge/L2SharedBridgeLegacy.sol @@ -120,7 +120,10 @@ contract L2SharedBridgeLegacy is IL2SharedBridgeLegacy, Initializable { bytes calldata _data ) external { // Only the L1 bridge counterpart can initiate and finalize the deposit. - if (AddressAliasHelper.undoL1ToL2Alias(msg.sender) != l1Bridge && AddressAliasHelper.undoL1ToL2Alias(msg.sender) != l1SharedBridge) { + if ( + AddressAliasHelper.undoL1ToL2Alias(msg.sender) != l1Bridge && + AddressAliasHelper.undoL1ToL2Alias(msg.sender) != l1SharedBridge + ) { revert InvalidCaller(msg.sender); } @@ -132,7 +135,6 @@ contract L2SharedBridgeLegacy is IL2SharedBridgeLegacy, Initializable { _data: _data }); - address l2Token = IL2NativeTokenVault(L2_NATIVE_TOKEN_VAULT_ADDR).l2TokenAddress(_l1Token); if (l1TokenAddress[l2Token] == address(0)) { diff --git a/l1-contracts/contracts/bridge/asset-router/L1AssetRouter.sol b/l1-contracts/contracts/bridge/asset-router/L1AssetRouter.sol index c6b050b9c..16b14f2ea 100644 --- a/l1-contracts/contracts/bridge/asset-router/L1AssetRouter.sol +++ b/l1-contracts/contracts/bridge/asset-router/L1AssetRouter.sol @@ -587,7 +587,7 @@ contract L1AssetRouter is AssetRouterBase, IL1AssetRouter, ReentrancyGuard { } /// @notice Legacy function to get the L2 shared bridge address for a chain. - /// @dev In case the chain has been deployed after the gateway release, + /// @dev In case the chain has been deployed after the gateway release, /// the returned value is 0. function l2BridgeAddress(uint256 _chainId) external view override returns (address) { return L1_NULLIFIER.l2BridgeAddress(_chainId); diff --git a/l1-contracts/contracts/bridge/asset-router/L2AssetRouter.sol b/l1-contracts/contracts/bridge/asset-router/L2AssetRouter.sol index e3edd602b..b22b3f5b9 100644 --- a/l1-contracts/contracts/bridge/asset-router/L2AssetRouter.sol +++ b/l1-contracts/contracts/bridge/asset-router/L2AssetRouter.sol @@ -221,7 +221,6 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter { _l1Token: _l1Token, _amount: _amount, _data: _data - }); } diff --git a/l1-contracts/contracts/governance/L2ProxyAdminDeployer.sol b/l1-contracts/contracts/governance/L2ProxyAdminDeployer.sol index c5bb128ad..144f951bf 100644 --- a/l1-contracts/contracts/governance/L2ProxyAdminDeployer.sol +++ b/l1-contracts/contracts/governance/L2ProxyAdminDeployer.sol @@ -8,10 +8,10 @@ import {ProxyAdmin} from "@openzeppelin/contracts-v4/proxy/transparent/ProxyAdmi /// @author Matter Labs /// @custom:security-contact security@matterlabs.dev -/// @notice The contract that deterministically deploys a ProxyAdmin, while +/// @notice The contract that deterministically deploys a ProxyAdmin, while /// ensuring that its owner is the aliased governance contract contract L2ProxyAdminDeployer { - address immutable public PROXY_ADMIN_ADDRESS; + address public immutable PROXY_ADMIN_ADDRESS; constructor(address _aliasedGovernance) { ProxyAdmin admin = new ProxyAdmin{salt: bytes32(0)}(); diff --git a/l1-contracts/contracts/governance/TransitionaryOwner.sol b/l1-contracts/contracts/governance/TransitionaryOwner.sol index a218dd7de..6b71ddd3c 100644 --- a/l1-contracts/contracts/governance/TransitionaryOwner.sol +++ b/l1-contracts/contracts/governance/TransitionaryOwner.sol @@ -8,11 +8,11 @@ import {Ownable2Step} from "@openzeppelin/contracts-v4/access/Ownable2Step.sol"; /// @author Matter Labs /// @custom:security-contact security@matterlabs.dev -/// @notice The contract that is used a temporary owner for Ownable2Step contracts until the +/// @notice The contract that is used a temporary owner for Ownable2Step contracts until the /// governance can accept the ownership contract TransitionaryOwner { address public immutable GOVERNANCE_ADDRESS; - + constructor(address _goveranceAddress) { GOVERNANCE_ADDRESS = _goveranceAddress; } diff --git a/l1-contracts/contracts/upgrades/GatewayHelper.sol b/l1-contracts/contracts/upgrades/GatewayHelper.sol index d4fba48e0..5ae02b9a0 100644 --- a/l1-contracts/contracts/upgrades/GatewayHelper.sol +++ b/l1-contracts/contracts/upgrades/GatewayHelper.sol @@ -3,11 +3,11 @@ pragma solidity 0.8.24; import {IL1SharedBridgeLegacy} from "../bridge/interfaces/IL1SharedBridgeLegacy.sol"; -import {IBridgehub} from "../bridgehub/IBridgehub.sol"; +import {IBridgehub} from "../bridgehub/IBridgehub.sol"; -import { ZKChainSpecificForceDeploymentsData} from "../state-transition/l2-deps/IL2GenesisUpgrade.sol"; +import {ZKChainSpecificForceDeploymentsData} from "../state-transition/l2-deps/IL2GenesisUpgrade.sol"; -import { ZKChainStorage } from "../state-transition/chain-deps/ZKChainStorage.sol"; +import {ZKChainStorage} from "../state-transition/chain-deps/ZKChainStorage.sol"; library GatewayHelper { function getZKChainSpecificForceDeploymentsData(ZKChainStorage storage s) internal view returns (bytes memory) { diff --git a/l1-contracts/contracts/upgrades/GatewayUpgrade.sol b/l1-contracts/contracts/upgrades/GatewayUpgrade.sol index 162edf228..3420d81ae 100644 --- a/l1-contracts/contracts/upgrades/GatewayUpgrade.sol +++ b/l1-contracts/contracts/upgrades/GatewayUpgrade.sol @@ -11,22 +11,21 @@ import {PriorityQueue} from "../state-transition/libraries/PriorityQueue.sol"; import {PriorityTree} from "../state-transition/libraries/PriorityTree.sol"; import {IGatewayUpgrade} from "./IGatewayUpgrade.sol"; -import {IL1SharedBridgeLegacy} from "../bridge/interfaces/IL1SharedBridgeLegacy.sol"; import {IComplexUpgrader} from "../state-transition/l2-deps/IComplexUpgrader.sol"; import {IL2GatewayUpgrade} from "../state-transition/l2-deps/IL2GatewayUpgrade.sol"; -import {IBridgehub} from "../bridgehub/IBridgehub.sol"; import {IL2ContractDeployer} from "../common/interfaces/IL2ContractDeployer.sol"; import {GatewayHelper} from "./GatewayHelper.sol"; +// solhint-disable-next-line gas-struct-packing struct GatewayUpgradeEncodedInput { IL2ContractDeployer.ForceDeployment[] baseForceDeployments; + bytes fixedForceDeploymentsData; address ctmDeployer; address l2GatewayUpgrade; address oldValidatorTimelock; address newValidatorTimelock; - bytes fixedForceDeploymentsData; } /// @author Matter Labs @@ -45,7 +44,10 @@ contract GatewayUpgrade is BaseZkSyncUpgrade { /// @notice The main function that will be called by the upgrade proxy. /// @param _proposedUpgrade The upgrade to be executed. function upgrade(ProposedUpgrade calldata _proposedUpgrade) public override returns (bytes32) { - GatewayUpgradeEncodedInput memory encodedInput = abi.decode(_proposedUpgrade.postUpgradeCalldata, (GatewayUpgradeEncodedInput)); + GatewayUpgradeEncodedInput memory encodedInput = abi.decode( + _proposedUpgrade.postUpgradeCalldata, + (GatewayUpgradeEncodedInput) + ); bytes32 baseTokenAssetId = DataEncoding.encodeNTVAssetId(block.chainid, s.__DEPRECATED_baseToken); @@ -53,7 +55,6 @@ contract GatewayUpgrade is BaseZkSyncUpgrade { s.priorityTree.setup(s.priorityQueue.getTotalPriorityTxs()); s.validators[encodedInput.oldValidatorTimelock] = false; s.validators[encodedInput.newValidatorTimelock] = true; - IBridgehub bridgehub = IBridgehub(s.bridgehub); ProposedUpgrade memory proposedUpgrade = _proposedUpgrade; bytes memory gatewayUpgradeCalldata = abi.encodeCall( @@ -66,11 +67,11 @@ contract GatewayUpgrade is BaseZkSyncUpgrade { ) ); - proposedUpgrade.l2ProtocolUpgradeTx.data = abi.encodeCall(IComplexUpgrader.upgrade, ( - encodedInput.l2GatewayUpgrade, - gatewayUpgradeCalldata - )); - + proposedUpgrade.l2ProtocolUpgradeTx.data = abi.encodeCall( + IComplexUpgrader.upgrade, + (encodedInput.l2GatewayUpgrade, gatewayUpgradeCalldata) + ); + // slither-disable-next-line controlled-delegatecall (bool success, ) = THIS_ADDRESS.delegatecall( abi.encodeWithSelector(IGatewayUpgrade.upgradeExternal.selector, proposedUpgrade) diff --git a/l1-contracts/contracts/upgrades/L1GenesisUpgrade.sol b/l1-contracts/contracts/upgrades/L1GenesisUpgrade.sol index 034387f1a..a6475f59a 100644 --- a/l1-contracts/contracts/upgrades/L1GenesisUpgrade.sol +++ b/l1-contracts/contracts/upgrades/L1GenesisUpgrade.sol @@ -16,9 +16,9 @@ import {REQUIRED_L2_GAS_PRICE_PER_PUBDATA, SYSTEM_UPGRADE_L2_TX_TYPE, PRIORITY_T import {SemVer} from "../common/libraries/SemVer.sol"; import {IL1SharedBridgeLegacy} from "../bridge/interfaces/IL1SharedBridgeLegacy.sol"; -import {IBridgehub} from "../bridgehub/IBridgehub.sol"; +import {IBridgehub} from "../bridgehub/IBridgehub.sol"; -import { ZKChainSpecificForceDeploymentsData} from "../state-transition/l2-deps/IL2GenesisUpgrade.sol"; +import {ZKChainSpecificForceDeploymentsData} from "../state-transition/l2-deps/IL2GenesisUpgrade.sol"; import {VerifierParams} from "../state-transition/chain-interfaces/IVerifier.sol"; import {L2ContractHelper} from "../common/libraries/L2ContractHelper.sol"; diff --git a/l1-contracts/deploy-scripts/Utils.sol b/l1-contracts/deploy-scripts/Utils.sol index 32ca012fe..9b8a9e7da 100644 --- a/l1-contracts/deploy-scripts/Utils.sol +++ b/l1-contracts/deploy-scripts/Utils.sol @@ -245,11 +245,7 @@ library Utils { address bridgehubAddress, address l1SharedBridgeProxy ) internal returns (address) { - (bytes32 bytecodeHash, bytes memory deployData) = getDeploymentCalldata( - create2salt, - bytecode, - constructorargs - ); + (bytes32 bytecodeHash, bytes memory deployData) = getDeploymentCalldata(create2salt, bytecode, constructorargs); address contractAddress = L2ContractHelper.computeCreate2Address( msg.sender, @@ -278,12 +274,13 @@ library Utils { bytes32 bytecodeHash, bytes memory constructorArgs ) internal view returns (address) { - return L2ContractHelper.computeCreate2Address( - L2_CREATE2_FACTORY_ADDRESS, - create2Salt, - bytecodeHash, - keccak256(constructorArgs) - ); + return + L2ContractHelper.computeCreate2Address( + L2_CREATE2_FACTORY_ADDRESS, + create2Salt, + bytecodeHash, + keccak256(constructorArgs) + ); } function getDeploymentCalldata( @@ -293,18 +290,10 @@ library Utils { ) internal view returns (bytes32 bytecodeHash, bytes memory data) { bytecodeHash = L2ContractHelper.hashL2Bytecode(bytecode); - data = abi.encodeWithSignature( - "create2(bytes32,bytes32,bytes)", - create2Salt, - bytecodeHash, - constructorArgs - ); + data = abi.encodeWithSignature("create2(bytes32,bytes32,bytes)", create2Salt, bytecodeHash, constructorArgs); } - function appendArray( - bytes[] memory array, - bytes memory element - ) internal pure returns (bytes[] memory) { + function appendArray(bytes[] memory array, bytes memory element) internal pure returns (bytes[] memory) { uint256 arrayLength = array.length; bytes[] memory newArray = new bytes[](arrayLength + 1); for (uint256 i = 0; i < arrayLength; ++i) { @@ -313,7 +302,7 @@ library Utils { newArray[arrayLength] = element; return newArray; } - + /** * @dev Deploy l2 contracts through l1, while using built-in L2 Create2Factory contract. */ @@ -327,20 +316,12 @@ library Utils { address bridgehubAddress, address l1SharedBridgeProxy ) internal returns (address) { - (bytes32 bytecodeHash, bytes memory deployData) = getDeploymentCalldata( - create2salt, - bytecode, - constructorargs - ); + (bytes32 bytecodeHash, bytes memory deployData) = getDeploymentCalldata(create2salt, bytecode, constructorargs); - address contractAddress = getL2AddressViaCreate2Factory( - create2salt, - bytecodeHash, - constructorargs - ); + address contractAddress = getL2AddressViaCreate2Factory(create2salt, bytecodeHash, constructorargs); bytes[] memory _factoryDeps = appendArray(factoryDeps, bytecode); - + runL1L2Transaction({ l2Calldata: deployData, l2GasLimit: l2GasLimit, diff --git a/l1-contracts/deploy-scripts/upgrade/ChainUpgrade.s.sol b/l1-contracts/deploy-scripts/upgrade/ChainUpgrade.s.sol index b140aed9a..7df6863d3 100644 --- a/l1-contracts/deploy-scripts/upgrade/ChainUpgrade.s.sol +++ b/l1-contracts/deploy-scripts/upgrade/ChainUpgrade.s.sol @@ -19,9 +19,9 @@ interface LegacyChainAdmin { function owner() external view returns (address); } -contract ChainUpgrade is Script { +contract ChainUpgrade is Script { using stdToml for string; - + struct ChainConfig { address deployerAddress; address ownerAddress; @@ -29,13 +29,11 @@ contract ChainUpgrade is Script { address chainDiamondProxyAddress; bool validiumMode; bool permanentRollup; - // FIXME: From ecosystem, maybe move to a different struct address expectedRollupL2DAValidator; address expectedL2GatewayUpgrade; address expectedValidiumL2DAValidator; address permanentRollupRestriction; - address bridgehubProxyAddress; address oldSharedBridgeProxyAddress; } @@ -67,8 +65,8 @@ contract ChainUpgrade is Script { checkCorrectOwnerAddress(); // Preparation of chain consists of two parts: // - Deploying l2 da validator - // - Deploying new chain admin - + // - Deploying new chain admin + deployNewL2DAValidator(); deployL2GatewayUpgrade(); deployNewChainAdmin(); @@ -77,30 +75,26 @@ contract ChainUpgrade is Script { saveOutput(outputPath); } - function upgradeChain( - uint256 oldProtocolVersion, - Diamond.DiamondCutData memory upgradeCutData - ) public { + function upgradeChain(uint256 oldProtocolVersion, Diamond.DiamondCutData memory upgradeCutData) public { Utils.adminExecute( - output.chainAdmin, - output.accessControlRestriction, - config.chainDiamondProxyAddress, + output.chainAdmin, + output.accessControlRestriction, + config.chainDiamondProxyAddress, abi.encodeCall(IAdmin.upgradeChainFromVersion, (oldProtocolVersion, upgradeCutData)), 0 ); } - + function initializeConfig( string memory configPath, string memory ecosystemInputPath, string memory ecosystemOutputPath ) internal { config.deployerAddress = msg.sender; - + // Grab config from output of l1 deployment string memory toml = vm.readFile(configPath); - // Config file must be parsed key by key, otherwise values returned // are parsed alfabetically and not by key. // https://book.getfoundry.sh/cheatcodes/parse-toml @@ -110,7 +104,7 @@ contract ChainUpgrade is Script { config.validiumMode = toml.readBool("$.chain.validium_mode"); config.chainDiamondProxyAddress = toml.readAddress("$.chain.diamond_proxy_address"); config.permanentRollup = toml.readBool("$.chain.permanent_rollup"); - + toml = vm.readFile(ecosystemOutputPath); config.expectedRollupL2DAValidator = toml.readAddress("$.contracts_config.expected_rollup_l2_da_validator"); @@ -129,7 +123,6 @@ contract ChainUpgrade is Script { address currentAdminOwner = LegacyChainAdmin(currentChainAdmin).owner(); require(currentAdminOwner == config.ownerAddress, "Only the owner of the chain admin can call this function"); - } function deployNewL2DAValidator() internal { @@ -167,7 +160,7 @@ contract ChainUpgrade is Script { function deployNewChainAdmin() internal { AccessControlRestriction accessControlRestriction = new AccessControlRestriction(0, config.ownerAddress); - address[] memory restrictions; + address[] memory restrictions; if (config.permanentRollup) { restrictions = new address[](2); restrictions[0] = address(accessControlRestriction); @@ -182,17 +175,21 @@ contract ChainUpgrade is Script { output.accessControlRestriction = address(accessControlRestriction); } - /// @dev The caller of this function needs to be the owner of the chain admin - /// of the + /// @dev The caller of this function needs to be the owner of the chain admin + /// of the function governanceMoveToNewChainAdmin() internal { // Firstly, we need to call the legacy chain admin to transfer the ownership to the new chain admin Call[] memory calls = new Call[](1); - calls[0] = Call({target: config.chainDiamondProxyAddress, value: 0, data: abi.encodeCall(IAdmin.setPendingAdmin, (output.chainAdmin))}); + calls[0] = Call({ + target: config.chainDiamondProxyAddress, + value: 0, + data: abi.encodeCall(IAdmin.setPendingAdmin, (output.chainAdmin)) + }); vm.startBroadcast(config.ownerAddress); ChainAdmin(payable(currentChainAdmin)).multicall(calls, true); vm.stopBroadcast(); - + // Now we need to accept the adminship Utils.adminExecute({ _admin: output.chainAdmin, @@ -211,6 +208,5 @@ contract ChainUpgrade is Script { string memory root = vm.projectRoot(); vm.writeToml(toml, outputPath); console.log("Output saved at:", outputPath); - } } diff --git a/l1-contracts/deploy-scripts/upgrade/EcosystemUpgrade.s.sol b/l1-contracts/deploy-scripts/upgrade/EcosystemUpgrade.s.sol index 3046f4d81..9f563de0f 100644 --- a/l1-contracts/deploy-scripts/upgrade/EcosystemUpgrade.s.sol +++ b/l1-contracts/deploy-scripts/upgrade/EcosystemUpgrade.s.sol @@ -16,7 +16,7 @@ import {VerifierParams, IVerifier} from "contracts/state-transition/chain-interf import {DefaultUpgrade} from "contracts/upgrades/DefaultUpgrade.sol"; import {Governance} from "contracts/governance/Governance.sol"; import {L1GenesisUpgrade} from "contracts/upgrades/L1GenesisUpgrade.sol"; -import {GatewayUpgrade} from "contracts/upgrades/GatewayUpgrade.sol"; +import {GatewayUpgrade} from "contracts/upgrades/GatewayUpgrade.sol"; import {ChainAdmin} from "contracts/governance/ChainAdmin.sol"; import {ValidatorTimelock} from "contracts/state-transition/ValidatorTimelock.sol"; import {Bridgehub} from "contracts/bridgehub/Bridgehub.sol"; @@ -60,7 +60,7 @@ import {ValidiumL1DAValidator} from "contracts/state-transition/data-availabilit import {Call} from "contracts/governance/Common.sol"; import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable-v4/access/Ownable2StepUpgradeable.sol"; import {IZKChain} from "contracts/state-transition/chain-interfaces/IZKChain.sol"; -import {ProposedUpgrade} from "contracts/upgrades/BaseZkSyncUpgrade.sol"; +import {ProposedUpgrade} from "contracts/upgrades/BaseZkSyncUpgrade.sol"; import {L2CanonicalTransaction} from "contracts/common/Messaging.sol"; @@ -129,7 +129,6 @@ contract EcosystemUpgrade is Script { address expectedL2GatewayUpgrade; address l2SharedBridgeLegacyImpl; address l2BridgedStandardERC20Impl; - // In reality, the following addresses need to be // deployed only on a settlement layer, i.e. the Gateway. address expectedL2ProxyAdminDeployer; @@ -208,7 +207,6 @@ contract EcosystemUpgrade is Script { uint256 maxNumberOfChains; bytes32 bootloaderHash; bytes32 defaultAAHash; - address oldValidatorTimelock; address legacyErc20BridgeAddress; address bridgehubProxyAddress; @@ -229,16 +227,13 @@ contract EcosystemUpgrade is Script { GeneratedData internal generatedData; DeployedAddresses internal addresses; - function prepareEcosystemContracts( - string memory configPath, - string memory outputPath - ) public { + function prepareEcosystemContracts(string memory configPath, string memory outputPath) public { string memory root = vm.projectRoot(); configPath = string.concat(root, configPath); outputPath = string.concat(root, outputPath); initializeConfig(configPath); - + instantiateCreate2Factory(); deployVerifier(); @@ -344,7 +339,7 @@ contract EcosystemUpgrade is Script { paymaster: uint256(uint160(address(0))), nonce: 25, value: 0, - reserved: [uint256(0),uint256(0),uint256(0),uint256(0)], + reserved: [uint256(0), uint256(0), uint256(0), uint256(0)], // Note, that the data is empty, it will be fully composed inside the `GatewayUpgrade` contract data: new bytes(0), signature: new bytes(0), @@ -373,7 +368,10 @@ contract EcosystemUpgrade is Script { uint256 NEW_PROTOCOL_VERSION = getNewProtocolVersion(); Call memory call = Call({ target: config.contracts.stateTransitionManagerAddress, - data: abi.encodeCall(ChainTypeManager.setNewVersionUpgrade, (getChainUpgradeInfo(), PREVIOUS_PROTOCOL_VERSION, DEADLINE, NEW_PROTOCOL_VERSION)), + data: abi.encodeCall( + ChainTypeManager.setNewVersionUpgrade, + (getChainUpgradeInfo(), PREVIOUS_PROTOCOL_VERSION, DEADLINE, NEW_PROTOCOL_VERSION) + ), value: 0 }); @@ -381,7 +379,7 @@ contract EcosystemUpgrade is Script { calls[0] = call; } - function getChainUpgradeInfo() public returns (Diamond.DiamondCutData memory upgradeCutData) { + function getChainUpgradeInfo() public returns (Diamond.DiamondCutData memory upgradeCutData) { Diamond.FacetCut[] memory deletedFacets = _getFacetCutsForDeletion(); Diamond.FacetCut[] memory facetCuts = new Diamond.FacetCut[](deletedFacets.length + 4); @@ -420,7 +418,9 @@ contract EcosystemUpgrade is Script { }); // TODO: we should fill this one up completely, but it is straightforward - IL2ContractDeployer.ForceDeployment[] memory baseForceDeployments = new IL2ContractDeployer.ForceDeployment[](0); + IL2ContractDeployer.ForceDeployment[] memory baseForceDeployments = new IL2ContractDeployer.ForceDeployment[]( + 0 + ); address ctmDeployer = addresses.bridgehub.ctmDeploymentTrackerProxy; GatewayUpgradeEncodedInput memory gateUpgradeInput = GatewayUpgradeEncodedInput({ @@ -432,7 +432,7 @@ contract EcosystemUpgrade is Script { newValidatorTimelock: addresses.validatorTimelock }); - bytes memory postUpgradeCalldata = abi.encode(gateUpgradeInput); + bytes memory postUpgradeCalldata = abi.encode(gateUpgradeInput); ProposedUpgrade memory proposedUpgrade = ProposedUpgrade({ l2ProtocolUpgradeTx: _composeUpgradeTx(), @@ -443,7 +443,7 @@ contract EcosystemUpgrade is Script { verifierParams: verifierParams, l1ContractsUpgradeCalldata: new bytes(0), postUpgradeCalldata: postUpgradeCalldata, - // FIXME: TBH, I am not sure if even should even put any time there, + // FIXME: TBH, I am not sure if even should even put any time there, // but we may upgradeTimestamp: 0, newProtocolVersion: 0x1900000000 @@ -462,22 +462,47 @@ contract EcosystemUpgrade is Script { // We need to firstly update all the contracts calls[0] = Call({ target: config.contracts.transparentProxyAdmin, - data: abi.encodeCall(ProxyAdmin.upgrade, (ITransparentUpgradeableProxy(payable(config.contracts.stateTransitionManagerAddress)), addresses.stateTransition.chainTypeManagerImplementation)), + data: abi.encodeCall( + ProxyAdmin.upgrade, + ( + ITransparentUpgradeableProxy(payable(config.contracts.stateTransitionManagerAddress)), + addresses.stateTransition.chainTypeManagerImplementation + ) + ), value: 0 }); calls[1] = Call({ target: config.contracts.transparentProxyAdmin, - data: abi.encodeCall(ProxyAdmin.upgradeAndCall, (ITransparentUpgradeableProxy(payable(config.contracts.bridgehubProxyAddress)), addresses.bridgehub.bridgehubImplementation, abi.encodeCall(Bridgehub.initializeV2, ()))), + data: abi.encodeCall( + ProxyAdmin.upgradeAndCall, + ( + ITransparentUpgradeableProxy(payable(config.contracts.bridgehubProxyAddress)), + addresses.bridgehub.bridgehubImplementation, + abi.encodeCall(Bridgehub.initializeV2, ()) + ) + ), value: 0 }); calls[2] = Call({ target: config.contracts.transparentProxyAdmin, - data: abi.encodeCall(ProxyAdmin.upgrade, (ITransparentUpgradeableProxy(payable(config.contracts.oldSharedBridgeProxyAddress)), addresses.bridges.l1NullifierImplementation)), + data: abi.encodeCall( + ProxyAdmin.upgrade, + ( + ITransparentUpgradeableProxy(payable(config.contracts.oldSharedBridgeProxyAddress)), + addresses.bridges.l1NullifierImplementation + ) + ), value: 0 }); calls[3] = Call({ target: config.contracts.transparentProxyAdmin, - data: abi.encodeCall(ProxyAdmin.upgrade, (ITransparentUpgradeableProxy(payable(config.contracts.legacyErc20BridgeAddress)), addresses.bridges.erc20BridgeImplementation)), + data: abi.encodeCall( + ProxyAdmin.upgrade, + ( + ITransparentUpgradeableProxy(payable(config.contracts.legacyErc20BridgeAddress)), + addresses.bridges.erc20BridgeImplementation + ) + ), value: 0 }); @@ -496,14 +521,24 @@ contract EcosystemUpgrade is Script { // Now, we need to update the bridgehub calls[6] = Call({ target: config.contracts.bridgehubProxyAddress, - data: abi.encodeCall(Bridgehub.setAddresses, (addresses.bridges.sharedBridgeProxy, CTMDeploymentTracker(addresses.bridgehub.ctmDeploymentTrackerProxy), MessageRoot(addresses.bridgehub.messageRootProxy))), + data: abi.encodeCall( + Bridgehub.setAddresses, + ( + addresses.bridges.sharedBridgeProxy, + CTMDeploymentTracker(addresses.bridgehub.ctmDeploymentTrackerProxy), + MessageRoot(addresses.bridgehub.messageRootProxy) + ) + ), value: 0 }); // Setting the necessary params for the L1Nullifier contract calls[7] = Call({ target: config.contracts.oldSharedBridgeProxyAddress, - data: abi.encodeCall(L1Nullifier.setL1NativeTokenVault, (L1NativeTokenVault(payable(addresses.vaults.l1NativeTokenVaultProxy)))), + data: abi.encodeCall( + L1Nullifier.setL1NativeTokenVault, + (L1NativeTokenVault(payable(addresses.vaults.l1NativeTokenVaultProxy))) + ), value: 0 }); calls[8] = Call({ @@ -559,7 +594,9 @@ contract EcosystemUpgrade is Script { config.contracts.defaultAAHash = toml.readBytes32("$.contracts.default_aa_hash"); config.contracts.bootloaderHash = toml.readBytes32("$.contracts.bootloader_hash"); - config.contracts.stateTransitionManagerAddress = toml.readAddress("$.contracts.state_transition_manager_address"); + config.contracts.stateTransitionManagerAddress = toml.readAddress( + "$.contracts.state_transition_manager_address" + ); config.contracts.bridgehubProxyAddress = toml.readAddress("$.contracts.bridgehub_proxy_address"); config.contracts.oldSharedBridgeProxyAddress = toml.readAddress("$.contracts.old_shared_bridge_proxy_address"); config.contracts.transparentProxyAdmin = toml.readAddress("$.contracts.transparent_proxy_admin"); @@ -569,7 +606,9 @@ contract EcosystemUpgrade is Script { // FIXME: value stored there is incorrect at the moment, figure out the correct value config.contracts.blobVersionedHashRetriever = toml.readAddress("$.contracts.blob_versioned_hash_retriever"); config.contracts.l2BridgeProxyOwnerAddress = toml.readAddress("$.contracts.l2_bridge_proxy_owner_address"); - config.contracts.l2BridgedStandardERC20ProxyOwnerAddress = toml.readAddress("$.contracts.l2_bridged_standard_erc20_proxy_owner_address"); + config.contracts.l2BridgedStandardERC20ProxyOwnerAddress = toml.readAddress( + "$.contracts.l2_bridged_standard_erc20_proxy_owner_address" + ); config.tokens.tokenWethAddress = toml.readAddress("$.tokens.token_weth_address"); } @@ -582,8 +621,8 @@ contract EcosystemUpgrade is Script { address aliasedGovernance = AddressAliasHelper.applyL1ToL2Alias(config.ownerAddress); address expectedL2ProxyAdminDeployer = Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readProxyAdminDeployerBytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readProxyAdminDeployerBytecode()), abi.encode(aliasedGovernance) ); address expectedL2ProxyAdmin = L2ContractHelper.computeCreate2Address( @@ -594,52 +633,56 @@ contract EcosystemUpgrade is Script { ); address permanentRestrictionImpl = Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readPermanentRestrictionBytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readPermanentRestrictionBytecode()), // Note that for L2 deployments the L2AdminFactory is 0. abi.encode(L2_BRIDGEHUB_ADDRESS, address(0)) ); address permanentRestrictionProxy = Utils.getL2AddressViaCreate2Factory( - bytes32(0), + bytes32(0), L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readTransparentUpgradeableProxyBytecode()), - abi.encode(permanentRestrictionImpl, expectedL2ProxyAdmin, abi.encodeCall(PermanentRestriction.initialize, (aliasedGovernance))) + abi.encode( + permanentRestrictionImpl, + expectedL2ProxyAdmin, + abi.encodeCall(PermanentRestriction.initialize, (aliasedGovernance)) + ) ); address[] memory requiredL2Restrictions = new address[](1); - requiredL2Restrictions[0] = permanentRestrictionProxy; + requiredL2Restrictions[0] = permanentRestrictionProxy; addresses.expectedL2Addresses = ExpectedL2Addresses({ expectedRollupL2DAValidator: Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readRollupL2DAValidatorBytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readRollupL2DAValidatorBytecode()), hex"" ), expectedValidiumL2DAValidator: Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readValidiumL2DAValidatorBytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readValidiumL2DAValidatorBytecode()), hex"" ), expectedL2GatewayUpgrade: Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readGatewayUpgradeBytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readGatewayUpgradeBytecode()), hex"" ), l2SharedBridgeLegacyImpl: Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readL2LegacySharedBridgeBytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readL2LegacySharedBridgeBytecode()), hex"" ), l2BridgedStandardERC20Impl: Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readStandardERC20Bytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readStandardERC20Bytecode()), hex"" ), expectedL2ProxyAdminDeployer: expectedL2ProxyAdminDeployer, expectedL2ProxyAdmin: expectedL2ProxyAdmin, expectedL2AdminFactory: Utils.getL2AddressViaCreate2Factory( - bytes32(0), - L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readL2AdminFactoryBytecode()), + bytes32(0), + L2ContractHelper.hashL2Bytecode(L2ContractsBytecodesLib.readL2AdminFactoryBytecode()), abi.encode(requiredL2Restrictions) ), expectedL2PermanentRestrictionImpl: permanentRestrictionImpl, @@ -908,7 +951,11 @@ contract EcosystemUpgrade is Script { bytes memory initCalldata = abi.encodeCall(L1AssetRouter.initialize, (config.deployerAddress)); bytes memory bytecode = abi.encodePacked( type(TransparentUpgradeableProxy).creationCode, - abi.encode(addresses.bridges.sharedBridgeImplementation, config.contracts.transparentProxyAdmin, initCalldata) + abi.encode( + addresses.bridges.sharedBridgeImplementation, + config.contracts.transparentProxyAdmin, + initCalldata + ) ); address contractAddress = deployViaCreate2(bytecode); console.log("SharedBridgeProxy deployed at:", contractAddress); @@ -917,7 +964,9 @@ contract EcosystemUpgrade is Script { function setL1LegacyBridge() internal { vm.broadcast(msg.sender); - L1AssetRouter(addresses.bridges.sharedBridgeProxy).setL1Erc20Bridge(L1ERC20Bridge(config.contracts.legacyErc20BridgeAddress)); + L1AssetRouter(addresses.bridges.sharedBridgeProxy).setL1Erc20Bridge( + L1ERC20Bridge(config.contracts.legacyErc20BridgeAddress) + ); } function deployErc20BridgeImplementation() internal { @@ -982,7 +1031,11 @@ contract EcosystemUpgrade is Script { ); bytes memory bytecode = abi.encodePacked( type(TransparentUpgradeableProxy).creationCode, - abi.encode(addresses.vaults.l1NativeTokenVaultImplementation, config.contracts.transparentProxyAdmin, initCalldata) + abi.encode( + addresses.vaults.l1NativeTokenVaultImplementation, + config.contracts.transparentProxyAdmin, + initCalldata + ) ); address contractAddress = deployViaCreate2(bytecode); console.log("L1NativeTokenVaultProxy deployed at:", contractAddress); @@ -1016,7 +1069,7 @@ contract EcosystemUpgrade is Script { vm.startBroadcast(msg.sender); // Note, that it will take some time for the governance to sign the "acceptOwnership" transaction, - // in order to avoid any possibilty of the front-run, we will temporarily give the ownership to the + // in order to avoid any possibilty of the front-run, we will temporarily give the ownership to the // contract that can only transfer ownership to the governance. _moveGovernanceToOwner(addresses.validatorTimelock); _moveGovernanceToOwner(addresses.bridges.sharedBridgeProxy); @@ -1127,7 +1180,11 @@ contract EcosystemUpgrade is Script { vm.serializeAddress("state_transition", "getters_facet_addr", addresses.stateTransition.gettersFacet); vm.serializeAddress("state_transition", "diamond_init_addr", addresses.stateTransition.diamondInit); vm.serializeAddress("state_transition", "genesis_upgrade_addr", addresses.stateTransition.genesisUpgrade); - string memory stateTransition = vm.serializeAddress("state_transition", "default_upgrade_addr", addresses.stateTransition.defaultUpgrade); + string memory stateTransition = vm.serializeAddress( + "state_transition", + "default_upgrade_addr", + addresses.stateTransition.defaultUpgrade + ); vm.serializeAddress("bridges", "erc20_bridge_implementation_addr", addresses.bridges.erc20BridgeImplementation); vm.serializeAddress("bridges", "l1_nullifier_implementation_addr", addresses.bridges.l1NullifierImplementation); @@ -1189,9 +1246,21 @@ contract EcosystemUpgrade is Script { config.contracts.recursionNodeLevelVkHash ); - vm.serializeAddress("contracts_config", "expected_rollup_l2_da_validator", addresses.expectedL2Addresses.expectedRollupL2DAValidator); - vm.serializeAddress("contracts_config", "expected_validium_l2_da_validator", addresses.expectedL2Addresses.expectedValidiumL2DAValidator); - vm.serializeAddress("contracts_config", "expected_l2_gateway_upgrade", addresses.expectedL2Addresses.expectedL2GatewayUpgrade); + vm.serializeAddress( + "contracts_config", + "expected_rollup_l2_da_validator", + addresses.expectedL2Addresses.expectedRollupL2DAValidator + ); + vm.serializeAddress( + "contracts_config", + "expected_validium_l2_da_validator", + addresses.expectedL2Addresses.expectedValidiumL2DAValidator + ); + vm.serializeAddress( + "contracts_config", + "expected_l2_gateway_upgrade", + addresses.expectedL2Addresses.expectedL2GatewayUpgrade + ); vm.serializeBytes("contracts_config", "diamond_cut_data", generatedData.diamondCutData); string memory contractsConfig = vm.serializeBytes( diff --git a/l1-contracts/test/foundry/l1/integration/UpgradeTest.t.sol b/l1-contracts/test/foundry/l1/integration/UpgradeTest.t.sol index 9fe76496f..1fde9886e 100644 --- a/l1-contracts/test/foundry/l1/integration/UpgradeTest.t.sol +++ b/l1-contracts/test/foundry/l1/integration/UpgradeTest.t.sol @@ -12,13 +12,11 @@ import {Call} from "contracts/governance/Common.sol"; import {Test} from "forge-std/Test.sol"; string constant ECOSYSTEM_INPUT = "/test/foundry/l1/integration/upgrade-envs/script-config/mainnet.toml"; -string constant ECOSYSTEM_OUTPUT = "/test/foundry/l1/integration/upgrade-envs/script-out/mainnet.toml"; +string constant ECOSYSTEM_OUTPUT = "/test/foundry/l1/integration/upgrade-envs/script-out/mainnet.toml"; string constant CHAIN_INPUT = "/test/foundry/l1/integration/upgrade-envs/script-config/mainnet-era.toml"; string constant CHAIN_OUTPUT = "/test/foundry/l1/integration/upgrade-envs/script-out/mainnet-era.toml"; - contract UpgradeTest is Test { - EcosystemUpgrade generateUpgradeData; ChainUpgrade chainUpgrade; @@ -29,26 +27,18 @@ contract UpgradeTest is Test { function test_MainnetFork() public { console.log("Preparing ecosystem contracts"); - // Firstly, we deploy all the contracts. - generateUpgradeData.prepareEcosystemContracts( - ECOSYSTEM_INPUT, - ECOSYSTEM_OUTPUT - ); + // Firstly, we deploy all the contracts. + generateUpgradeData.prepareEcosystemContracts(ECOSYSTEM_INPUT, ECOSYSTEM_OUTPUT); // For chain, we have deployed the DA validator contracts // and also updated the chain admin. // IMPORTANT: for erc20-based chains with token multiplier setter // this should be coordinated with the server. console.log("Preparing chain for the upgrade"); - chainUpgrade.prepareChain( - ECOSYSTEM_INPUT, - ECOSYSTEM_OUTPUT, - CHAIN_INPUT, - CHAIN_OUTPUT - ); + chainUpgrade.prepareChain(ECOSYSTEM_INPUT, ECOSYSTEM_OUTPUT, CHAIN_INPUT, CHAIN_OUTPUT); console.log("Starting stage1 of the upgrade!"); - // Now, some time has passed and we are ready to start the upgrade of the + // Now, some time has passed and we are ready to start the upgrade of the // ecosystem. // Stage 1 of the upgrade: // - accept all the ownerships of the contracts @@ -94,7 +84,7 @@ contract UpgradeTest is Test { // How the governance is implemented is out of scope here vm.startBroadcast(governanceAddr); - for(uint256 i = 0; i < calls.length; i++) { + for (uint256 i = 0; i < calls.length; i++) { Call memory call = calls[i]; (bool success, bytes memory data) = payable(call.target).call{value: call.value}(call.data); diff --git a/l1-contracts/test/foundry/l1/unit/concrete/Governance/PermanentRestriction.t.sol b/l1-contracts/test/foundry/l1/unit/concrete/Governance/PermanentRestriction.t.sol index aa272b3e5..bcfe6ae2c 100644 --- a/l1-contracts/test/foundry/l1/unit/concrete/Governance/PermanentRestriction.t.sol +++ b/l1-contracts/test/foundry/l1/unit/concrete/Governance/PermanentRestriction.t.sol @@ -386,4 +386,4 @@ contract PermanentRestrictionTest is ChainTypeManagerTest { }); vm.stopPrank(); } -} \ No newline at end of file +} diff --git a/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/FinalizeWithdrawal.t.sol b/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/FinalizeWithdrawal.t.sol index 74004e5fb..5e7fa27f6 100644 --- a/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/FinalizeWithdrawal.t.sol +++ b/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/FinalizeWithdrawal.t.sol @@ -23,14 +23,7 @@ contract MailboxFinalizeWithdrawal is MailboxTest { L1AssetRouter = new DummySharedBridge(keccak256("dummyDepositHash")); baseTokenBridgeAddress = address(L1AssetRouter); - vm.mockCall( - bridgehub, - abi.encodeCall( - Bridgehub.sharedBridge, - () - ), - abi.encode(baseTokenBridgeAddress) - ); + vm.mockCall(bridgehub, abi.encodeCall(Bridgehub.sharedBridge, ()), abi.encode(baseTokenBridgeAddress)); proof = new bytes32[](0); message = "message"; diff --git a/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/RequestL2Transaction.t.sol b/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/RequestL2Transaction.t.sol index f990bc025..0ea16b46c 100644 --- a/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/RequestL2Transaction.t.sol +++ b/l1-contracts/test/foundry/l1/unit/concrete/state-transition/chain-deps/facets/Mailbox/RequestL2Transaction.t.sol @@ -25,14 +25,7 @@ contract MailboxRequestL2TransactionTest is MailboxTest { l1SharedBridge = new DummySharedBridge(keccak256("dummyDepositHash")); baseTokenBridgeAddress = address(l1SharedBridge); - vm.mockCall( - bridgehub, - abi.encodeCall( - Bridgehub.sharedBridge, - () - ), - abi.encode(baseTokenBridgeAddress) - ); + vm.mockCall(bridgehub, abi.encodeCall(Bridgehub.sharedBridge, ()), abi.encode(baseTokenBridgeAddress)); tempAddress = makeAddr("temp"); tempBytesArr = new bytes[](0); diff --git a/system-contracts/contracts/L2GatewayUpgrade.sol b/system-contracts/contracts/L2GatewayUpgrade.sol index b712ad147..1fd1567fd 100644 --- a/system-contracts/contracts/L2GatewayUpgrade.sol +++ b/system-contracts/contracts/L2GatewayUpgrade.sol @@ -5,8 +5,7 @@ pragma solidity 0.8.24; import {DEPLOYER_SYSTEM_CONTRACT} from "./Constants.sol"; import {IContractDeployer, ForceDeployment} from "./interfaces/IContractDeployer.sol"; import {SystemContractHelper} from "./libraries/SystemContractHelper.sol"; -import {ISystemContext} from "./interfaces/ISystemContext.sol"; -import {IL2GenesisUpgrade, FixedForceDeploymentsData, ZKChainSpecificForceDeploymentsData} from "./interfaces/IL2GenesisUpgrade.sol"; +import {FixedForceDeploymentsData, ZKChainSpecificForceDeploymentsData} from "./interfaces/IL2GenesisUpgrade.sol"; import {GatewayUpgrade} from "./GatewayUpgrade.sol"; import {ITransparentUpgradeableProxy} from "@openzeppelin/contracts-v4/proxy/transparent/TransparentUpgradeableProxy.sol"; @@ -28,11 +27,11 @@ contract L2GatewayUpgrade is GatewayUpgrade { bytes calldata _fixedForceDeploymentsData, bytes calldata _additionalForceDeploymentsData ) external payable { - // Firstly, we force deploy the main set of contracts. + // Firstly, we force deploy the main set of contracts. // Those will be deployed without any contract invocation. IContractDeployer(DEPLOYER_SYSTEM_CONTRACT).forceDeployOnAddresses{value: msg.value}(_forceDeployments); - // Secondly, we perform the more complex deployment of the gateway contracts. + // Secondly, we perform the more complex deployment of the gateway contracts. performGatewayContractsInit(_ctmDeployer, _fixedForceDeploymentsData, _additionalForceDeploymentsData); ZKChainSpecificForceDeploymentsData memory additionalForceDeploymentsData = abi.decode( @@ -41,7 +40,7 @@ contract L2GatewayUpgrade is GatewayUpgrade { ); address l2LegacyBridgeAddress = additionalForceDeploymentsData.l2LegacySharedBridge; - + if (l2LegacyBridgeAddress != address(0)) { FixedForceDeploymentsData memory fixedForceDeploymentsData = abi.decode( _fixedForceDeploymentsData, diff --git a/system-contracts/contracts/L2GenesisUpgrade.sol b/system-contracts/contracts/L2GenesisUpgrade.sol index 5fd1a8003..8fc53efe5 100644 --- a/system-contracts/contracts/L2GenesisUpgrade.sol +++ b/system-contracts/contracts/L2GenesisUpgrade.sol @@ -23,7 +23,7 @@ contract L2GenesisUpgrade is IL2GenesisUpgrade, GatewayUpgrade { ISystemContext(SYSTEM_CONTEXT_CONTRACT).setChainId(_chainId); performGatewayContractsInit(_ctmDeployer, _fixedForceDeploymentsData, _additionalForceDeploymentsData); - + emit UpgradeComplete(_chainId); } } diff --git a/system-contracts/contracts/interfaces/IL2GenesisUpgrade.sol b/system-contracts/contracts/interfaces/IL2GenesisUpgrade.sol index bc0bf5c3a..8752202a5 100644 --- a/system-contracts/contracts/interfaces/IL2GenesisUpgrade.sol +++ b/system-contracts/contracts/interfaces/IL2GenesisUpgrade.sol @@ -8,17 +8,18 @@ struct ZKChainSpecificForceDeploymentsData { address l2Weth; } +// solhint-disable-next-line gas-struct-packing struct FixedForceDeploymentsData { uint256 l1ChainId; uint256 eraChainId; - uint256 maxNumberOfZKChains; + address l1AssetRouter; bytes32 l2TokenProxyBytecodeHash; + address aliasedL1Governance; + uint256 maxNumberOfZKChains; bytes32 bridgehubBytecodeHash; bytes32 l2AssetRouterBytecodeHash; bytes32 l2NtvBytecodeHash; bytes32 messageRootBytecodeHash; - address l1AssetRouter; - address aliasedL1Governance; address l2SharedBridgeLegacyImpl; address l2BridgedStandardERC20Impl; address l2BridgeProxyOwnerAddress; diff --git a/system-contracts/contracts/libraries/SystemContractHelper.sol b/system-contracts/contracts/libraries/SystemContractHelper.sol index 50c592dad..d3d5e7536 100644 --- a/system-contracts/contracts/libraries/SystemContractHelper.sol +++ b/system-contracts/contracts/libraries/SystemContractHelper.sol @@ -402,16 +402,12 @@ library SystemContractHelper { } } - /// @notice Performs a `mimicCall` to an address, while ensuring that the call + /// @notice Performs a `mimicCall` to an address, while ensuring that the call /// was successful /// @param _to The address to call. /// @param _whoToMimic The address to mimic. /// @param _data The data to pass to the call. - function mimicCallWithPropagatedRevert( - address _to, - address _whoToMimic, - bytes memory _data - ) internal { + function mimicCallWithPropagatedRevert(address _to, address _whoToMimic, bytes memory _data) internal { (bool success, bytes memory returnData) = mimicCall(_to, _whoToMimic, _data); if (!success) { // Propagate revert reason