Skip to content

Commit

Permalink
fix deployment scripts for new oracle and token
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalgek committed Jan 9, 2024
1 parent e314bb1 commit 4b56ccf
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ ETHERSCAN_API_KEY_OPT=
# Address of the token to deploy the bridge/gateway for
TOKEN=

# Address of the rebasable token to deploy the bridge/gateway for
STETH_TOKEN=

# Name of the network environments used by deployment scripts.
# Might be one of: "mainnet", "goerli".
NETWORK=mainnet
Expand Down
3 changes: 3 additions & 0 deletions .env.wsteth.opt_mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ETHERSCAN_API_KEY_OPT=
# Address of the token to deploy the bridge/gateway for
TOKEN=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0

# Address of the rebasable token to deploy the bridge/gateway for
STETH_TOKEN=

# Name of the network environments used by deployment scripts.
# Might be one of: "mainnet", "goerli".
NETWORK=mainnet
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Fill the newly created `.env` file with the required variables. See the [Project

The configuration of the deployment scripts happens via the ENV variables. The following variables are required:

- [`TOKEN`](#TOKEN) - address of the token to deploy a new bridge on the Ethereum chain.
- [`TOKEN`](#TOKEN) - address of the non-rebasable token to deploy a new bridge on the Ethereum chain.
- [`STETH_TOKEN`] (#STETH_TOKEN) - address of the rebasable token to deploy new bridge on the Ethereum chain.
- [`NETWORK`](#NETWORK) - name of the network environments used by deployment scripts. Allowed values: `mainnet`, `goerli`.
- [`FORKING`](#FORKING) - run deployment in the forking network instead of real ones
- [`ETH_DEPLOYER_PRIVATE_KEY`](#ETH_DEPLOYER_PRIVATE_KEY) - The private key of the deployer account in the Ethereum network is used during the deployment process.
Expand Down Expand Up @@ -314,7 +315,11 @@ Below variables used in the Arbitrum/Optimism bridge deployment process.

#### `TOKEN`

Address of the token to deploy a new bridge on the Ethereum chain.
Address of the non-rebasable token to deploy a new bridge on the Ethereum chain.

#### `STETH_TOKEN`

Address of the rebasable token to deploy new bridge on the Ethereum chain.

#### `NETWORK`

Expand Down
8 changes: 4 additions & 4 deletions scripts/optimism/deploy-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function main() {
.deployment(networkName, { logger: console })
.erc20TokenBridgeDeployScript(
deploymentConfig.token,
deploymentConfig.token, // FIX
deploymentConfig.stETHToken,
{
deployer: ethDeployer,
admins: {
Expand Down Expand Up @@ -63,15 +63,15 @@ async function main() {
{ logger: console }
);

const l2ERC20TokenBridgeProxyDeployStepIndex = 3;
const l2ERC20TokenBridgeProxyDeployStepIndex = 6;
const l2BridgingManagement = new BridgingManagement(
l2DeployScript.getContractAddress(l2ERC20TokenBridgeProxyDeployStepIndex),
optDeployer,
{ logger: console }
);

await l1BridgingManagement.setup(deploymentConfig.l1);
await l2BridgingManagement.setup(deploymentConfig.l2);
await l1BridgingManagement.setup(deploymentConfig.l1);
await l2BridgingManagement.setup(deploymentConfig.l2);
}

main().catch((error) => {
Expand Down
6 changes: 4 additions & 2 deletions utils/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ interface ChainDeploymentConfig extends BridgingManagerSetupConfig {

interface MultiChainDeploymentConfig {
token: string;
stETHToken: string;
l1: ChainDeploymentConfig;
l2: ChainDeploymentConfig;
}

export function loadMultiChainDeploymentConfig(): MultiChainDeploymentConfig {
return {
token: env.address("TOKEN"),
stETHToken: env.address("STETH_TOKEN"),
l1: {
proxyAdmin: env.address("L1_PROXY_ADMIN"),
bridgeAdmin: env.address("L1_BRIDGE_ADMIN"),
Expand Down Expand Up @@ -49,8 +51,8 @@ export async function printMultiChainDeploymentConfig(
l1DeployScript: DeployScript,
l2DeployScript: DeployScript
) {
const { token, l1, l2 } = deploymentParams;
console.log(chalk.bold(`${title} :: ${chalk.underline(token)}\n`));
const { token, stETHToken, l1, l2 } = deploymentParams;
console.log(chalk.bold(`${title} :: ${chalk.underline(token)} :: ${chalk.underline(stETHToken)}\n`));
console.log(chalk.bold(" · L1 Deployment Params:"));
await printChainDeploymentConfig(l1Deployer, l1);
console.log();
Expand Down
4 changes: 2 additions & 2 deletions utils/testing/scenario.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CtxFactory, StepTest, CtxFn } from "./types";

class ScenarioTest<T> {
class ScenarioTest<T extends object> {
private afterFn?: CtxFn<T>;
private beforeFn?: CtxFn<T>;

Expand Down Expand Up @@ -68,6 +68,6 @@ class ScenarioTest<T> {
}
}

export function scenario<T>(title: string, ctxFactory: CtxFactory<T>) {
export function scenario<T extends object>(title: string, ctxFactory: CtxFactory<T>) {
return new ScenarioTest(title, ctxFactory);
}
4 changes: 2 additions & 2 deletions utils/testing/unit.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import hre from "hardhat";
import { CtxFactory, StepTest, CtxFn } from "./types";

export function unit<T>(title: string, ctxFactory: CtxFactory<T>) {
export function unit<T extends object>(title: string, ctxFactory: CtxFactory<T>) {
return new UnitTest(title, ctxFactory);
}

class UnitTest<T> {
class UnitTest<T extends object> {
public readonly title: string;

private readonly ctxFactory: CtxFactory<T>;
Expand Down

0 comments on commit 4b56ccf

Please sign in to comment.