Skip to content

Commit d553130

Browse files
committed
fix: eslint and prettify
1 parent fd26bdf commit d553130

File tree

2 files changed

+24
-29
lines changed

2 files changed

+24
-29
lines changed

contracts/deploy/01-foreign-chain.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import {parseEther} from 'ethers/lib/utils';
1+
import { parseEther } from "ethers/lib/utils";
22

3-
import {HardhatRuntimeEnvironment} from 'hardhat/types';
4-
import {DeployFunction} from 'hardhat-deploy/types';
3+
import { HardhatRuntimeEnvironment } from "hardhat/types";
4+
import { DeployFunction } from "hardhat-deploy/types";
55

66
import getContractAddress from "../deploy-helpers/getContractAddress";
77

88
const FOREIGN_CHAIN_IDS = [1, 4];
99
const paramsByChainId = {
1010
1: {
11-
claimDeposit: parseEther('0.1'),
11+
claimDeposit: parseEther("0.1"),
1212
challengeDuration: 86400, // 1 day
1313
homeChainId: 42161,
1414
},
1515
4: {
16-
claimDeposit: parseEther('0.1'),
16+
claimDeposit: parseEther("0.1"),
1717
challengeDuration: 3600, // 1 hour
1818
homeChainId: 421611,
1919
},
2020
};
2121

22-
const deployForeignGateway: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
23-
const {ethers, deployments, getNamedAccounts, getChainId, config} = hre;
24-
const {deploy} = deployments;
22+
const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
23+
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
24+
const { deploy } = deployments;
2525
const { providers, constants } = ethers;
2626
const { hexZeroPad } = hre.ethers.utils;
2727

28-
const {deployer } = await getNamedAccounts();
28+
const { deployer } = await getNamedAccounts();
2929
const chainId = await getChainId();
3030

3131
const homeNetworks = {
@@ -36,7 +36,7 @@ const deployForeignGateway: DeployFunction = async function (hre: HardhatRuntime
3636
const homeChainProvider = new providers.JsonRpcProvider(url);
3737
const nonce = await homeChainProvider.getTransactionCount(deployer);
3838

39-
const { claimDeposit, challengeDuration, homeChainId} = paramsByChainId[chainId];
39+
const { claimDeposit, challengeDuration, homeChainId } = paramsByChainId[chainId];
4040

4141
// home Gateway deploy tx will the third tx after this on it's network,
4242
// so we add two to the current nonce.
@@ -46,13 +46,13 @@ const deployForeignGateway: DeployFunction = async function (hre: HardhatRuntime
4646
console.log(nonce + 2);
4747
console.log(homeGatewayAddress);
4848

49-
let fastBridgeReceiver = await deploy('FastBridgeReceiver', {
49+
const fastBridgeReceiver = await deploy("FastBridgeReceiver", {
5050
from: deployer,
5151
args: [deployer, claimDeposit, challengeDuration],
5252
log: true,
5353
});
5454

55-
let foreignGateway = await deploy('ForeignGateway', {
55+
const foreignGateway = await deploy("ForeignGateway", {
5656
from: deployer,
5757
args: [deployer, fastBridgeReceiver.address, ["1000", "10000"], homeGatewayAddress, homeChainIdAsBytes32],
5858
log: true,

contracts/deploy/02-home-chain.ts

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {HardhatRuntimeEnvironment} from 'hardhat/types';
2-
import {DeployFunction} from 'hardhat-deploy/types';
1+
import { HardhatRuntimeEnvironment } from "hardhat/types";
2+
import { DeployFunction } from "hardhat-deploy/types";
33

44
import getContractAddress from "../deploy-helpers/getContractAddress";
55

@@ -19,44 +19,39 @@ const paramsByChainId = {
1919
},
2020
};
2121

22-
const deployHomeGateway: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
23-
const {deployments, getNamedAccounts, getChainId} = hre;
24-
const {deploy, execute} = deployments;
22+
const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
23+
const { deployments, getNamedAccounts, getChainId } = hre;
24+
const { deploy, execute } = deployments;
2525
const { hexZeroPad } = hre.ethers.utils;
2626

27-
const {deployer } = await getNamedAccounts();
27+
const { deployer } = await getNamedAccounts();
2828
const chainId = await getChainId();
2929

3030
const { arbitrator, foreignChainId } = paramsByChainId[chainId];
3131

32-
const foreignGateway = await hre.companionNetworks['foreign'].deployments.get('ForeignGateway');
33-
const fastBridgeReceiver = await hre.companionNetworks['foreign'].deployments.get('FastBridgeReceiver');
32+
const foreignGateway = await hre.companionNetworks.foreign.deployments.get("ForeignGateway");
33+
const fastBridgeReceiver = await hre.companionNetworks.foreign.deployments.get("FastBridgeReceiver");
3434

3535
const foreignChainIdAsBytes32 = hexZeroPad(foreignChainId, 32);
3636

37-
let safeBridge = await deploy('SafeBridgeArbitrum', {
37+
const safeBridge = await deploy("SafeBridgeArbitrum", {
3838
from: deployer,
3939
log: true,
4040
});
4141

42-
let fastBridgeSender = await deploy('FastBridgeSender', {
42+
const fastBridgeSender = await deploy("FastBridgeSender", {
4343
from: deployer,
4444
args: [safeBridge.address, fastBridgeReceiver.address],
4545
log: true,
4646
});
4747

48-
let homeGateway = await deploy('HomeGateway', {
48+
const homeGateway = await deploy("HomeGateway", {
4949
from: deployer,
5050
args: [arbitrator, fastBridgeSender.address, foreignGateway.address, foreignChainIdAsBytes32],
5151
log: true,
5252
});
5353

54-
await execute(
55-
'FastBridgeSender',
56-
{from: deployer, log: true},
57-
'setFastSender',
58-
homeGateway.address
59-
);
54+
await execute("FastBridgeSender", { from: deployer, log: true }, "setFastSender", homeGateway.address);
6055
};
6156

6257
deployHomeGateway.tags = ["HomeChain"];

0 commit comments

Comments
 (0)