From b773f43a543d1fe8e40fbbba78e15c0fa38a9adf Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 19 Aug 2024 14:38:36 -0300 Subject: [PATCH] fix: Deploy L1 rollup contract using salt if provided Fixes a bad merge that disabled the usage of deployment salt for rollup contract. --- l1-contracts/src/core/FeeJuicePortal.sol | 2 +- l1-contracts/test/Rollup.t.sol | 2 +- .../ethereum/src/deploy_l1_contracts.ts | 27 ++++++------------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/l1-contracts/src/core/FeeJuicePortal.sol b/l1-contracts/src/core/FeeJuicePortal.sol index 5b899bd577f2..00e166a51477 100644 --- a/l1-contracts/src/core/FeeJuicePortal.sol +++ b/l1-contracts/src/core/FeeJuicePortal.sol @@ -22,7 +22,7 @@ contract FeeJuicePortal is IFeeJuicePortal, Ownable { IERC20 public underlying; bytes32 public l2TokenAddress; - constructor() Ownable(msg.sender) {} + constructor(address owner) Ownable(owner) {} /** * @notice Initialize the FeeJuicePortal diff --git a/l1-contracts/test/Rollup.t.sol b/l1-contracts/test/Rollup.t.sol index c47e631adf4f..796d647ce453 100644 --- a/l1-contracts/test/Rollup.t.sol +++ b/l1-contracts/test/Rollup.t.sol @@ -56,7 +56,7 @@ contract RollupTest is DecoderBase { registry = new Registry(address(this)); availabilityOracle = new AvailabilityOracle(); portalERC20 = new PortalERC20(); - feeJuicePortal = new FeeJuicePortal(); + feeJuicePortal = new FeeJuicePortal(address(this)); portalERC20.mint(address(feeJuicePortal), Constants.FEE_JUICE_INITIAL_MINT); feeJuicePortal.initialize( address(registry), address(portalERC20), bytes32(Constants.FEE_JUICE_ADDRESS) diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.ts b/yarn-project/ethereum/src/deploy_l1_contracts.ts index 9b63a51a5ae8..d009a5f570cb 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.ts @@ -183,12 +183,7 @@ export const deployL1Contracts = async ( logger.info(`Deployed Fee Juice at ${feeJuiceAddress}`); - const feeJuicePortalAddress = await deployL1Contract( - walletClient, - publicClient, - contractsToDeploy.feeJuicePortal.contractAbi, - contractsToDeploy.feeJuicePortal.contractBytecode, - ); + const feeJuicePortalAddress = await deployer.deploy(contractsToDeploy.feeJuicePortal, [account.address.toString()]); logger.info(`Deployed Gas Portal at ${feeJuicePortalAddress}`); @@ -224,19 +219,13 @@ export const deployL1Contracts = async ( `Initialized Gas Portal at ${feeJuicePortalAddress} to bridge between L1 ${feeJuiceAddress} to L2 ${args.l2FeeJuiceAddress}`, ); - const rollupAddress = await deployL1Contract( - walletClient, - publicClient, - contractsToDeploy.rollup.contractAbi, - contractsToDeploy.rollup.contractBytecode, - [ - getAddress(registryAddress.toString()), - getAddress(availabilityOracleAddress.toString()), - getAddress(feeJuicePortalAddress.toString()), - args.vkTreeRoot.toString(), - account.address.toString(), - ], - ); + const rollupAddress = await deployer.deploy(contractsToDeploy.rollup, [ + getAddress(registryAddress.toString()), + getAddress(availabilityOracleAddress.toString()), + getAddress(feeJuicePortalAddress.toString()), + args.vkTreeRoot.toString(), + account.address.toString(), + ]); logger.info(`Deployed Rollup at ${rollupAddress}`); // Set initial blocks as proven if requested