Skip to content

Commit

Permalink
feat(protocol): add proto_broker / oracle_prover addresses into `…
Browse files Browse the repository at this point in the history
…AddressManager` in deploy_L1 script (#13079)
  • Loading branch information
davidtaikocha committed Jan 31, 2023
1 parent d69c369 commit f3bea40
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:genesis": "./test/genesis/generate_genesis.test.sh",
"test:integration": "TEST_TYPE=integration ./test/test_integration.sh",
"test:tokenomics": "TEST_TYPE=tokenomics ./test/test_integration.sh",
"deploy:hardhat": "./scripts/download_solc.sh && LOG_LEVEL=debug pnpm hardhat deploy_L1 --network hardhat --dao-vault 0xdf08f82de32b8d460adbe8d72043e3a7e25a3b39 --team-vault 0xdf08f82de32b8d460adbe8d72043e3a7e25a3b39 --l2-genesis-block-hash 0xee1950562d42f0da28bd4550d88886bc90894c77c9c9eaefef775d4c8223f259 --bridge-funder-private-key ddbf12f72c946bb1e6de5eaf580c51db51828ba198d9b0dba9c7d48ec748dc04 --bridge-fund 0xff --confirmations 1",
"deploy:hardhat": "./scripts/download_solc.sh && LOG_LEVEL=debug pnpm hardhat deploy_L1 --network hardhat --dao-vault 0xdf08f82de32b8d460adbe8d72043e3a7e25a3b39 --team-vault 0xdf08f82de32b8d460adbe8d72043e3a7e25a3b39 --l2-genesis-block-hash 0xee1950562d42f0da28bd4550d88886bc90894c77c9c9eaefef775d4c8223f259 --bridge-funder-private-key ddbf12f72c946bb1e6de5eaf580c51db51828ba198d9b0dba9c7d48ec748dc04 --bridge-fund 0xff --oracle-prover 0xdf08f82de32b8d460adbe8d72043e3a7e25a3b39 --confirmations 1",
"lint-staged": "lint-staged --allow-empty"
},
"lint-staged": {
Expand Down
27 changes: 27 additions & 0 deletions packages/protocol/tasks/deploy_L1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ task("deploy_L1")
"",
types.string
)
.addOptionalParam(
"oracleProver",
"Address of the oracle prover",
"",
types.string
)
.addOptionalParam(
"confirmations",
"Number of confirmations to wait for deploy transaction.",
Expand Down Expand Up @@ -65,6 +71,7 @@ export async function deployContracts(hre: any) {
const l2ChainId = hre.args.l2ChainId;
const bridgeFunderPrivateKey = hre.args.bridgeFunderPrivateKey;
const bridgeFund = hre.args.bridgeFund;
const oracleProver = hre.args.oracleProver;

log.debug(`network: ${network}`);
log.debug(`chainId: ${chainId}`);
Expand All @@ -75,6 +82,7 @@ export async function deployContracts(hre: any) {
log.debug(`l2ChainId: ${l2ChainId}`);
log.debug(`bridgeFunderPrivateKey: ${bridgeFunderPrivateKey}`);
log.debug(`bridgeFund: ${bridgeFund}`);
log.debug(`oracleProver: ${oracleProver}`);
log.debug(`confirmations: ${hre.args.confirmations}`);
log.debug();

Expand Down Expand Up @@ -137,6 +145,15 @@ export async function deployContracts(hre: any) {
await AddressManager.setAddress(`${chainId}.taiko`, TaikoL1.address)
);

// Used by TkoToken
await utils.waitTx(
hre,
await AddressManager.setAddress(
`${chainId}.proto_broker`,
TaikoL1.address
)
);

// Bridge
const Bridge = await deployBridge(hre, AddressManager.address);

Expand Down Expand Up @@ -206,6 +223,16 @@ export async function deployContracts(hre: any) {
)
);

if (ethers.utils.isAddress(oracleProver)) {
await utils.waitTx(
hre,
await AddressManager.setAddress(
`${chainId}.oracle_prover`,
oracleProver
)
);
}

// save deployments
const deployments = {
network,
Expand Down

0 comments on commit f3bea40

Please sign in to comment.