Skip to content

Commit 92a1745

Browse files
committed
fixes
1 parent dc0467c commit 92a1745

File tree

8 files changed

+163
-169
lines changed

8 files changed

+163
-169
lines changed

src/genesis-hardhat/constants.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
// Those genesis are already imported on different tooling and added as a metadata on-chain. Therefore, this util aims
66
// to support them too
77

8-
import { GENESIS_CONTRACT_NAMES } from "../utils-common-aggchain";
8+
import { GENESIS_CONTRACT_NAMES } from '../utils-common-aggchain';
99

10-
export const SUPPORTED_GER_MANAGERS = ['LegacyAgglayerGERL2 implementation'];
10+
export const SUPPORTED_GER_MANAGERS = [
11+
'PolygonZkEVMGlobalExitRootL2 implementation',
12+
GENESIS_CONTRACT_NAMES.GER_L2_IMPLEMENTATION,
13+
];
1114

1215
export const SUPPORTED_BRIDGE_CONTRACTS = ['PolygonZkEVMBridge implementation', 'AgglayerBridge implementation'];
1316

src/genesis-hardhat/create-genesis-hardhat.ts

Lines changed: 57 additions & 67 deletions
Large diffs are not rendered by default.

src/genesis-hardhat/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export async function getAddressesGenesisBase(genesisBase: any) {
3232
).address;
3333

3434
// get the bridge proxy address
35-
const gerManagerProxyAddress = genesisBase.find(
36-
(account: any) => account.contractName === GENESIS_CONTRACT_NAMES.GER_L2_PROXY,
35+
const gerManagerProxyAddress = genesisBase.find((account: any) =>
36+
SUPPORTED_GER_MANAGERS.includes(account.contractName),
3737
).address;
3838

3939
// get the bridge proxy implementation address
@@ -154,7 +154,7 @@ export async function deployProxyWithTxCapture(implementation: any, proxyAdmin:
154154
}
155155

156156
/**
157-
* Deploy implmentation and proxy for BridgeL2SovereignChain
157+
* Deploy implmentation and proxy for AgglayerBridgeL2
158158
* @param {String} proxyAdmin - proxy admin, for proxy deployment
159159
* @param {Array} deployer - deployer for deploy transactions
160160
* @returns {Object} - proxy address, implementation address, txHashes: { proxy txHash, impl txHash }
@@ -168,7 +168,7 @@ export async function deployBridgeL2SovereignChain(proxyAdmin: any, deployer: an
168168
}
169169

170170
/**
171-
* Deploy implmentation and proxy for GlobalExitRootManagerL2SovereignChain
171+
* Deploy implmentation and proxy for AgglayerGERL2
172172
* @param {String} proxyAdmin - proxy admin, for proxy deployment
173173
* @param {Array} deployer - deployer for deploy transactions
174174
* @param {String} bridgeProxyAddress - bridge address (ger constructor)
@@ -195,7 +195,7 @@ export async function deployGlobalExitRootManagerL2SovereignChain(
195195
*/
196196
export async function deployAggOracleCommittee(proxyAdmin: any, deployer: any, gerManagerAddress: any) {
197197
// Deploy implementation
198-
const GERManagerFactory = await ethers.getContractFactory(GENESIS_CONTRACT_NAMES.AGGORACLE_COMMITTEE, deployer);
198+
const GERManagerFactory = await ethers.getContractFactory(GENESIS_CONTRACT_NAMES.AGG_ORACLE, deployer);
199199
const implementation = await GERManagerFactory.deploy(gerManagerAddress);
200200
const result = await deployProxyWithTxCapture(implementation, proxyAdmin, deployer);
201201
return result;

src/utils-common-aggchain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const GENESIS_CONTRACT_NAMES = {
3636
POLYGON_TIMELOCK: 'PolygonZkEVMTimelock',
3737
POLYGON_DEPLOYER: 'PolygonZkEVMDeployer',
3838
BRIDGE_LIB: `BridgeLib`,
39+
AGG_ORACLE: 'AggOracleCommittee',
3940
AGG_ORACLE_PROXY: 'AggOracleCommittee proxy',
4041
AGG_ORACLE_IMPL: 'AggOracleCommittee implementation',
4142
ROLLUP_MANAGER_IMPLEMENTATION: 'AgglayerManager implementation',
File renamed without changes.

test/createSovereignGenesisWithHardhat/createSovereignGenesisWithHardhat.ts renamed to test/legacy-createSovereignGenesisWithHardhat/createSovereignGenesisWithHardhat.ts

File renamed without changes.

tools/createSovereignGenesisHardhat/create-sovereign-genesis-hardhat.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as dotenv from 'dotenv';
88
import { ethers, hardhatArguments } from 'hardhat';
99

1010
// internal dependencies
11-
import { PolygonRollupManager, PolygonZkEVMBridgeV2 } from '../../typechain-types';
11+
import { AgglayerManager, AgglayerBridge } from '../../typechain-types';
1212
import '../../deployment/helpers/utils';
1313
import { initializeTimelockStorage } from '../../src/genesis/genesis-helpers';
1414
import { checkParams, getGitInfo } from '../../src/utils';
@@ -97,10 +97,10 @@ async function main() {
9797
logger.info('Check SovereignBridge requirements for its correct initialization');
9898

9999
// Load Rollup manager
100-
const PolygonRollupManagerFactory = await ethers.getContractFactory('PolygonRollupManager');
100+
const PolygonRollupManagerFactory = await ethers.getContractFactory('AgglayerManager');
101101
const rollupManagerContract = PolygonRollupManagerFactory.attach(
102102
createGenesisSovereignParams.rollupManagerAddress,
103-
) as PolygonRollupManager;
103+
) as AgglayerManager;
104104

105105
// Checks like in bridge contract
106106
if (
@@ -133,9 +133,9 @@ async function main() {
133133
let gasTokenMetadata;
134134

135135
// Get bridge instance
136-
const bridgeFactory = await ethers.getContractFactory('PolygonZkEVMBridgeV2');
136+
const bridgeFactory = await ethers.getContractFactory('AgglayerBridge');
137137
const bridgeContractAddress = await rollupManagerContract.bridgeAddress();
138-
const rollupBridgeContract = bridgeFactory.attach(bridgeContractAddress) as PolygonZkEVMBridgeV2;
138+
const rollupBridgeContract = bridgeFactory.attach(bridgeContractAddress) as AgglayerBridge;
139139

140140
// check bridge address is the same in genesisBase and on-chain
141141
checkBridgeAddress(genesisBase, bridgeContractAddress);

tools/createSovereignGenesisHardhat/genesis-base.json.example

Lines changed: 90 additions & 90 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)