Skip to content

Commit

Permalink
make scripts work
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Aug 14, 2024
1 parent 2a2e6cf commit 9f6d439
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/scripts/sync-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ async function registerSLContractsOnL1(deployer: Deployer) {
const receipt2 = await deployer.executeUpgrade(
stmDeploymentTracker.address,
value,
stmDeploymentTracker.encodeFunctionData("registerSTMAssetOnL2SharedBridge", [
stmDeploymentTracker.interface.encodeFunctionData("registerSTMAssetOnL2SharedBridge", [
chainId,
l1STM.address,
value,
Expand Down
54 changes: 27 additions & 27 deletions l1-contracts/src.ts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { ValidatorTimelockFactory } from "../typechain/ValidatorTimelockFactory"
import type { FacetCut } from "./diamondCut";
import { getCurrentFacetCutsForAdd } from "./diamondCut";

import { ChainAdminFactory, ERC20Factory, StateTransitionManagerFactory } from "../typechain";
import { BridgehubFactory, ChainAdminFactory, ERC20Factory, StateTransitionManagerFactory } from "../typechain";

import { IL1AssetRouterFactory } from "../typechain/IL1AssetRouterFactory";
import { IL1NativeTokenVaultFactory } from "../typechain/IL1NativeTokenVaultFactory";
Expand Down Expand Up @@ -1042,32 +1042,32 @@ export class Deployer {
if (this.verbose) {
console.log(`StateTransition System registered, gas used: ${receipt1.gasUsed.toString()}`);
}
}

const stmDeploymentTracker = this.stmDeploymentTracker(this.deployWallet);

const l1AssetRouter = this.defaultSharedBridge(this.deployWallet);
const whitelistData = l1AssetRouter.interface.encodeFunctionData("setAssetDeploymentTracker", [
ethers.utils.hexZeroPad(this.addresses.StateTransition.StateTransitionProxy, 32),
stmDeploymentTracker.address,
]);
const receipt2 = await this.executeUpgrade(l1AssetRouter.address, 0, whitelistData);
if (this.verbose) {
console.log("STM deployment tracker whitelisted in L1 Shared Bridge", receipt2.gasUsed.toString());
console.log(
`CONTRACTS_STM_ASSET_INFO=${await bridgehub.stmAssetId(this.addresses.StateTransition.StateTransitionProxy)}`
);
}

const stmDeploymentTracker = this.stmDeploymentTracker(this.deployWallet);

const l1AssetRouter = this.defaultSharedBridge(this.deployWallet);
const whitelistData = l1AssetRouter.interface.encodeFunctionData("setAssetDeploymentTracker", [
ethers.utils.hexZeroPad(this.addresses.StateTransition.StateTransitionProxy, 32),
stmDeploymentTracker.address,
]);
const receipt2 = await this.executeUpgrade(l1AssetRouter.address, 0, whitelistData);
if (this.verbose) {
console.log("STM deployment tracker whitelisted in L1 Shared Bridge", receipt2.gasUsed.toString());
console.log(
`CONTRACTS_STM_ASSET_INFO=${await bridgehub.stmAssetId(this.addresses.StateTransition.StateTransitionProxy)}`
);
}

const data1 = stmDeploymentTracker.interface.encodeFunctionData("registerSTMAssetOnL1", [
this.addresses.StateTransition.StateTransitionProxy,
]);
const receipt3 = await this.executeUpgrade(this.addresses.Bridgehub.STMDeploymentTrackerProxy, 0, data1);
if (this.verbose) {
console.log("STM asset registered in L1 Shared Bridge via STM Deployment Tracker", receipt3.gasUsed.toString());
console.log(
`CONTRACTS_STM_ASSET_INFO=${await bridgehub.stmAssetId(this.addresses.StateTransition.StateTransitionProxy)}`
);
const data1 = stmDeploymentTracker.interface.encodeFunctionData("registerSTMAssetOnL1", [
this.addresses.StateTransition.StateTransitionProxy,
]);
const receipt3 = await this.executeUpgrade(this.addresses.Bridgehub.STMDeploymentTrackerProxy, 0, data1);
if (this.verbose) {
console.log("STM asset registered in L1 Shared Bridge via STM Deployment Tracker", receipt3.gasUsed.toString());
console.log(
`CONTRACTS_STM_ASSET_INFO=${await bridgehub.stmAssetId(this.addresses.StateTransition.StateTransitionProxy)}`
);
}
}
}
}
Expand Down Expand Up @@ -1483,7 +1483,7 @@ export class Deployer {
}

public bridgehubContract(signerOrProvider: Signer | providers.Provider) {
return IBridgehubFactory.connect(this.addresses.Bridgehub.BridgehubProxy, signerOrProvider);
return BridgehubFactory.connect(this.addresses.Bridgehub.BridgehubProxy, signerOrProvider);
}

public stateTransitionManagerContract(signerOrProvider: Signer | providers.Provider) {
Expand Down

0 comments on commit 9f6d439

Please sign in to comment.