Skip to content

Commit 2f4cdb7

Browse files
committed
Merge branch 'dev' into chore/initialize-relayer-testing
2 parents a9a3c00 + 1f6c3dd commit 2f4cdb7

28 files changed

+5033
-8496
lines changed

contracts/deploy/01-outbox/01-arb-sepolia-to-chiado-outbox.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parseEther } from "ethers/lib/utils";
1+
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
44
import getContractAddress from "../../deploy-helpers/getContractAddress";
@@ -26,18 +26,17 @@ const paramsByChainId = {
2626
epochPeriod: 600, // 10 min
2727
minChallengePeriod: 600, // 10 min
2828
numEpochTimeout: 24, // 6 hours
29-
amb: ethers.constants.AddressZero,
29+
amb: ethers.ZeroAddress,
3030
sequencerLimit: 0,
3131
maxMissingBlocks: 10000000000000,
3232
routerChainId: 31337,
33-
WETH: ethers.constants.AddressZero,
33+
WETH: ethers.ZeroAddress,
3434
},
3535
};
3636

3737
const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
3838
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
3939
const { deploy } = deployments;
40-
const { providers } = ethers;
4140

4241
// fallback to hardhat node signers on local network
4342
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
@@ -85,7 +84,7 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
8584
minChallengePeriod,
8685
numEpochTimeout,
8786
amb,
88-
ethers.constants.AddressZero,
87+
ethers.ZeroAddress,
8988
sequencerLimit,
9089
maxMissingBlocks,
9190
routerChainId,
@@ -98,14 +97,14 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
9897
// ----------------------------------------------------------------------------------------------
9998
const liveDeployer = async () => {
10099
const gasOptions = {
101-
maxFeePerGas: ethers.utils.parseUnits("1", "gwei"),
102-
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
100+
maxFeePerGas: String(ethers.parseUnits("1", "gwei")),
101+
maxPriorityFeePerGas: String(ethers.parseUnits("1", "gwei")),
103102
};
104103

105-
const senderChainProvider = new providers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
104+
const senderChainProvider = new ethers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
106105
let nonce = await senderChainProvider.getTransactionCount(deployer);
107106

108-
const routerChainProvider = new providers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
107+
const routerChainProvider = new ethers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
109108
let nonceRouter = await routerChainProvider.getTransactionCount(deployer);
110109

111110
const routerAddress = getContractAddress(deployer, nonceRouter);

contracts/deploy/01-outbox/01-arb-sepolia-to-sepolia-outbox.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parseEther } from "ethers/lib/utils";
1+
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
44
import getContractAddress from "../../deploy-helpers/getContractAddress";
@@ -26,14 +26,13 @@ const paramsByChainId = {
2626
minChallengePeriod: 600, // 10 min (assume no sequencer backdating)
2727
numEpochTimeout: 10000000000000, // 6 hours
2828
maxMissingBlocks: 10000000000000,
29-
arbitrumBridge: ethers.constants.AddressZero,
29+
arbitrumBridge: ethers.ZeroAddress,
3030
},
3131
};
3232

3333
const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
3434
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
3535
const { deploy } = deployments;
36-
const { providers } = ethers;
3736

3837
// fallback to hardhat node signers on local network
3938
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
@@ -98,7 +97,7 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
9897

9998
// ----------------------------------------------------------------------------------------------
10099
const liveDeployer = async () => {
101-
const senderChainProvider = new providers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
100+
const senderChainProvider = new ethers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
102101
let nonce = await senderChainProvider.getTransactionCount(deployer);
103102

104103
const veaInboxAddress = getContractAddress(deployer, nonce);

contracts/deploy/01-outbox/01-arb-to-eth-outbox.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parseEther } from "ethers/lib/utils";
1+
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
44
import getContractAddress from "../../deploy-helpers/getContractAddress";
@@ -35,14 +35,13 @@ const paramsByChainId = {
3535
minChallengePeriod: 600, // 10 min
3636
numEpochTimeout: 10000000000000, // never
3737
maxMissingBlocks: 10,
38-
arbitrumBridge: ethers.constants.AddressZero,
38+
arbitrumBridge: ethers.ZeroAddress,
3939
},
4040
};
4141

4242
const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
4343
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
4444
const { deploy } = deployments;
45-
const { providers } = ethers;
4645

4746
// fallback to hardhat node signers on local network
4847
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
@@ -120,7 +119,7 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
120119
// ----------------------------------------------------------------------------------------------
121120
const liveDeployer = async () => {
122121
console.log(config.networks);
123-
const senderChainProvider = new providers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
122+
const senderChainProvider = new ethers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
124123
let nonce = await senderChainProvider.getTransactionCount(deployer);
125124

126125
const veaInboxAddress = getContractAddress(deployer, nonce);

contracts/deploy/01-outbox/01-arb-to-gnosis-outbox.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parseEther } from "ethers/lib/utils";
1+
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
44
import getContractAddress from "../../deploy-helpers/getContractAddress";
@@ -42,8 +42,8 @@ const paramsByChainId = {
4242
minChallengePeriod: 600, // 10 min (assume no sequencer backdating)
4343
numEpochTimeout: 21600, // 6 hours
4444
claimDelay: 2,
45-
amb: ethers.constants.AddressZero,
46-
routerAddress: ethers.constants.AddressZero,
45+
amb: ethers.ZeroAddress,
46+
routerAddress: ethers.ZeroAddress,
4747
maxMissingBlocks: 10000000000000,
4848
routerChainId: 31337,
4949
sequencerLimit: 864,
@@ -53,7 +53,6 @@ const paramsByChainId = {
5353
const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
5454
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
5555
const { deploy } = deployments;
56-
const { providers } = ethers;
5756

5857
// fallback to hardhat node signers on local network
5958
const [namedAccounts, signers, rawChainId] = await Promise.all([
@@ -139,7 +138,7 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
139138

140139
// ----------------------------------------------------------------------------------------------
141140
const liveDeployer = async () => {
142-
const routerChainProvider = new providers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
141+
const routerChainProvider = new ethers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
143142
let nonceRouter = await routerChainProvider.getTransactionCount(deployer);
144143

145144
const routerAddress = getContractAddress(deployer, nonceRouter);
@@ -161,7 +160,7 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
161160
WETH,
162161
],
163162
log: true,
164-
gasPrice: ethers.utils.parseUnits("1", "gwei"), // chiado rpc response underprices gas
163+
gasPrice: String(10 ** 9), // chiado rpc response underprices gas, 1 gwei
165164
});
166165

167166
console.log("VeaOutboxArbToGnosis deployed to:", txn.address);

contracts/deploy/01-outbox/01-chiado-to-arb-sepolia-outbox.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parseEther } from "ethers/lib/utils";
1+
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
44
import getContractAddress from "../../deploy-helpers/getContractAddress";
@@ -25,7 +25,7 @@ const paramsByChainId = {
2525
epochPeriod: 600, // 10 min
2626
challengePeriod: 600, // 10 min
2727
numEpochTimeout: 24, // 6 hours
28-
amb: ethers.constants.AddressZero,
28+
amb: ethers.ZeroAddress,
2929
sequencerDelayLimit: 86400,
3030
sequencerFutureLimit: 3600,
3131
maxMissingBlocks: 10000000000000,
@@ -36,7 +36,6 @@ const paramsByChainId = {
3636
const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
3737
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
3838
const { deploy } = deployments;
39-
const { providers } = ethers;
4039

4140
// fallback to hardhat node signers on local network
4241
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
@@ -77,7 +76,7 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
7776
challengePeriod,
7877
numEpochTimeout,
7978
amb,
80-
ethers.constants.AddressZero,
79+
ethers.ZeroAddress,
8180
sequencerLimit,
8281
maxMissingBlocks,
8382
routerChainId,
@@ -92,14 +91,14 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
9291
// ----------------------------------------------------------------------------------------------
9392
const liveDeployer = async () => {
9493
const gasOptions = {
95-
maxFeePerGas: ethers.utils.parseUnits("1", "gwei"),
96-
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
94+
maxFeePerGas: String(ethers.parseUnits("1", "gwei")),
95+
maxPriorityFeePerGas: String(ethers.parseUnits("1", "gwei")),
9796
};
9897

99-
const senderChainProvider = new providers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
98+
const senderChainProvider = new ethers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
10099
let nonce = await senderChainProvider.getTransactionCount(deployer);
101100

102-
const routerChainProvider = new providers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
101+
const routerChainProvider = new ethers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
103102
let nonceRouter = await routerChainProvider.getTransactionCount(deployer);
104103

105104
const routerAddress = getContractAddress(deployer, nonceRouter);

contracts/deploy/01-outbox/01-gnosis-to-arb-outbox.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { parseEther } from "ethers/lib/utils";
1+
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
44
import getContractAddress from "../../deploy-helpers/getContractAddress";
5-
import { ethers } from "hardhat";
65

76
enum ReceiverChains {
87
ARBITRUM_SEPOLIA = 421614,
@@ -40,7 +39,6 @@ const paramsByChainId = {
4039
const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
4140
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
4241
const { deploy } = deployments;
43-
const { providers } = ethers;
4442

4543
// fallback to hardhat node signers on local network
4644
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
@@ -83,7 +81,7 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
8381
challengePeriod,
8482
numEpochTimeout,
8583
amb,
86-
ethers.constants.AddressZero,
84+
ethers.ZeroAddress,
8785
sequencerLimit,
8886
maxMissingBlocks,
8987
routerChainId,
@@ -98,14 +96,14 @@ const deployOutbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
9896
// ----------------------------------------------------------------------------------------------
9997
const liveDeployer = async () => {
10098
const gasOptions = {
101-
maxFeePerGas: ethers.utils.parseUnits("1", "gwei"),
102-
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
99+
maxFeePerGas: String(ethers.parseUnits("1", "gwei")),
100+
maxPriorityFeePerGas: String(ethers.parseUnits("1", "gwei")),
103101
};
104102

105-
const senderChainProvider = new providers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
103+
const senderChainProvider = new ethers.JsonRpcProvider(senderNetworks[ReceiverChains[chainId]].url);
106104
let nonce = await senderChainProvider.getTransactionCount(deployer);
107105

108-
const routerChainProvider = new providers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
106+
const routerChainProvider = new ethers.JsonRpcProvider(routerNetworks[ReceiverChains[chainId]].url);
109107
let nonceRouter = await routerChainProvider.getTransactionCount(deployer);
110108

111109
const routerAddress = getContractAddress(deployer, nonceRouter);

contracts/deploy/02-inbox/02-arb-to-gnosis-inbox.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import getContractAddress from "../../deploy-helpers/getContractAddress";
4-
import { ethers } from "hardhat";
5-
import { providers } from "ethers";
64

75
enum SenderChains {
86
ARBITRUM = 42161,
@@ -84,7 +82,7 @@ const deployInbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
8482

8583
// ----------------------------------------------------------------------------------------------
8684
const liveDeployer = async () => {
87-
const routerChainProvider = new providers.JsonRpcProvider(routerNetworks[SenderChains[chainId]].url);
85+
const routerChainProvider = new ethers.JsonRpcProvider(routerNetworks[SenderChains[chainId]].url);
8886
let nonceRouter = await routerChainProvider.getTransactionCount(deployer);
8987

9088
const routerAddress = getContractAddress(deployer, nonceRouter);

contracts/deploy/02-inbox/02-chiado-to-arb-sepolia-inbox.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const paramsByChainId = {
1313
amb: "0x8448E15d0e706C0298dECA99F0b4744030e59d7d", // https://docs.gnosischain.com/bridges/About%20Token%20Bridges/amb-bridge#key-contracts
1414
},
1515
HARDHAT: {
16-
amb: ethers.constants.AddressZero,
16+
amb: ethers.ZeroAddress,
1717
epochPeriod: 600, // 10 minutes
1818
},
1919
};
@@ -34,8 +34,8 @@ const deployInbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
3434
const veaOutboxArb = await hre.companionNetworks.arbitrumSepolia.deployments.get("VeaOutboxGnosisToArbDevnet");
3535

3636
const gasOptions = {
37-
maxFeePerGas: ethers.utils.parseUnits("1", "gwei"),
38-
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
37+
maxFeePerGas: String(ethers.parseUnits("1", "gwei")),
38+
maxPriorityFeePerGas: String(ethers.parseUnits("1", "gwei")),
3939
};
4040

4141
const inbox = await deploy("VeaInboxGnosisToArbDevnet", {

contracts/deploy/02-inbox/02-gnosis-to-arb-inbox.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
3-
import { ethers } from "hardhat";
3+
import { ethers } from "ethers";
44

55
enum SenderChains {
66
GNOSIS = 100,
@@ -40,8 +40,8 @@ const deployInbox: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
4040
);
4141

4242
const gasOptions = {
43-
maxFeePerGas: ethers.utils.parseUnits("1", "gwei"),
44-
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
43+
maxFeePerGas: String(ethers.parseUnits("1", "gwei")),
44+
maxPriorityFeePerGas: String(ethers.parseUnits("1", "gwei")),
4545
};
4646

4747
const inbox = await deploy("VeaInboxGnosisToArb" + (chainId === 100 ? "" : "Testnet"), {

contracts/deploy/03-routers/03-arb-sepolia-to-chiado-router.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
3-
import { ethers } from "hardhat";
3+
import { ZeroAddress } from "ethers";
44

55
enum RouterChains {
66
ETHEREUM_SEPOLIA = 11155111,
@@ -13,8 +13,8 @@ const paramsByChainId = {
1313
amb: "0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a",
1414
},
1515
HARDHAT: {
16-
arbitrumBridge: ethers.constants.AddressZero,
17-
amb: ethers.constants.AddressZero,
16+
arbitrumBridge: ZeroAddress,
17+
amb: ZeroAddress,
1818
},
1919
};
2020

@@ -25,7 +25,9 @@ const deployRouter: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
2525
const chainId = Number(await getChainId());
2626

2727
// fallback to hardhat node signers on local network
28-
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
28+
const namedAccounts = await getNamedAccounts();
29+
const signers = await hre.ethers.getSigners();
30+
const deployer = namedAccounts.deployer ?? signers[0].address;
2931
console.log("deployer: %s", deployer);
3032

3133
const { arbitrumBridge, amb } = paramsByChainId[RouterChains[chainId]];
@@ -58,7 +60,7 @@ const deployRouter: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
5860
};
5961

6062
// ----------------------------------------------------------------------------------------------
61-
if (chainId === 31337) {
63+
if (chainId === RouterChains.HARDHAT) {
6264
await hardhatDeployer();
6365
} else {
6466
await liveDeployer();

0 commit comments

Comments
 (0)