Skip to content

Commit

Permalink
fix: Deploy L1 rollup contract using salt if provided
Browse files Browse the repository at this point in the history
Fixes a bad merge that disabled the usage of deployment salt for rollup
contract.
  • Loading branch information
spalladino committed Aug 19, 2024
1 parent 99d1131 commit b773f43
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/src/core/FeeJuicePortal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/Rollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
27 changes: 8 additions & 19 deletions yarn-project/ethereum/src/deploy_l1_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b773f43

Please sign in to comment.