Skip to content

Commit b56f372

Browse files
style: fix code lint
1 parent 55a2c50 commit b56f372

File tree

1 file changed

+46
-27
lines changed

1 file changed

+46
-27
lines changed

contracts/deploy/01-foreign-chain.ts

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,34 +84,27 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme
8484
],
8585
log: true,
8686
});
87+
let foreignGateway = await deployForeignGateways(
88+
"ForeignGatewayOnEthereum",
89+
deploy,
90+
deployer,
91+
fastBridgeReceiver.address,
92+
[ethers.BigNumber.from(10).pow(17)],
93+
homeGatewayAddress,
94+
homeChainIdAsBytes32,
95+
chainIdAsBytes32
96+
)
8797

88-
const foreignGateway = await deploy("ForeignGatewayOnEthereum", {
89-
from: deployer,
90-
contract: "ForeignGatewayOnEthereum",
91-
args: [
92-
deployer,
93-
fastBridgeReceiver.address,
94-
[ethers.BigNumber.from(10).pow(17)],
95-
homeGatewayAddress,
96-
homeChainIdAsBytes32,
97-
chainIdAsBytes32
98-
],
99-
log: true,
100-
});
101-
102-
const foreignGatewayCentralizedArbitrator = await deploy("ForeignGatewayOnEthereumCentralizedArbitrator", {
103-
from: deployer,
104-
contract: "ForeignGatewayOnEthereum",
105-
args: [
106-
deployer,
107-
fastBridgeReceiver.address,
108-
[ethers.BigNumber.from(10).pow(17)],
109-
homeGatewayCentralizedArbitratorAddress,
110-
homeChainIdAsBytes32,
111-
chainIdAsBytes32
112-
],
113-
log: true,
114-
});
98+
const foreignGatewayCentralizedArbitrator = await deployForeignGateways(
99+
"ForeignGatewayOnEthereumCentralizedArbitrator",
100+
deploy,
101+
deployer,
102+
fastBridgeReceiver.address,
103+
[ethers.BigNumber.from(10).pow(17)],
104+
homeGatewayCentralizedArbitratorAddress,
105+
homeChainIdAsBytes32,
106+
chainIdAsBytes32
107+
)
115108

116109
const metaEvidenceUri =
117110
"https://raw.githubusercontent.com/kleros/kleros-v2/master/contracts/deployments/rinkeby/MetaEvidence_ArbitrableExample.json";
@@ -129,6 +122,32 @@ const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironme
129122
});
130123
};
131124

125+
async function deployForeignGateways(
126+
name,
127+
deploy,
128+
deployer,
129+
fastBridgeReceiverAddress,
130+
feeForJuror,
131+
homeGatewayAddress,
132+
homeChainIdAsBytes32,
133+
chainIdAsBytes32
134+
){
135+
let foreignGateway = await deploy(name, {
136+
from: deployer,
137+
contract: "ForeignGatewayOnEthereum",
138+
args: [
139+
deployer,
140+
fastBridgeReceiverAddress,
141+
feeForJuror,
142+
homeGatewayAddress,
143+
homeChainIdAsBytes32,
144+
chainIdAsBytes32
145+
],
146+
log: true,
147+
});
148+
return foreignGateway;
149+
}
150+
132151
deployForeignGateway.tags = ["ForeignChain", "ForeignGateway"];
133152
deployForeignGateway.skip = async ({ getChainId }) => {
134153
const chainId = Number(await getChainId());

0 commit comments

Comments
 (0)