Skip to content

Commit

Permalink
Move some configs into mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
makoto committed Oct 18, 2023
1 parent 5fe480d commit 0fa0cd5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions op-verifier/deploy_l1/00_op_verifier.ts
Expand Up @@ -2,23 +2,30 @@ import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';
import fs from 'fs';

const GATEWAY_URLS = {
'opDevnetL1':'http://localhost:8080/{sender}/{data}.json',
'goerli':'https://op-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json',
}

const L2_OUTPUT_ORACLE_ADDRESSES = {
'goerli': '0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0'
}

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, getNamedAccounts, network} = hre;
const {deploy} = deployments;
const {deployer} = await getNamedAccounts();
let L2_OUTPUT_ORACLE_ADDRESS, GATEWAY_URL
if(network.name === 'opDevnetL1'){
GATEWAY_URL = 'http://localhost:8080/{sender}/{data}.json'
const opAddresses = await (await fetch("http://localhost:8080/addresses.json")).json();
L2_OUTPUT_ORACLE_ADDRESS = opAddresses.L2OutputOracleProxy
}else if('goerli'){
GATEWAY_URL = 'https://op-gateway-worker.ens-cf.workers.dev/{sender}/{data}.json'
L2_OUTPUT_ORACLE_ADDRESS = '0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0'
}else{
L2_OUTPUT_ORACLE_ADDRESS = L2_OUTPUT_ORACLE_ADDRESSES[network.name]
}
console.log('OPVerifier', [[GATEWAY_URL], L2_OUTPUT_ORACLE_ADDRESS])
await deploy('OPVerifier', {
from: deployer,
args: [[GATEWAY_URL], L2_OUTPUT_ORACLE_ADDRESS],
args: [[GATEWAY_URLS[network.name]], L2_OUTPUT_ORACLE_ADDRESS],
log: true,
});
};
Expand Down

0 comments on commit 0fa0cd5

Please sign in to comment.