We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0178990 + 825e8ec commit 2706b41Copy full SHA for 2706b41
hardhat.config.ts
@@ -17,7 +17,7 @@ import { resolve } from "path";
17
import fs from "fs";
18
19
import "./tasks/accounts";
20
-import { gasPrice, getJsonRpcUrl } from "./scripts/constants/networks";
+import { getJsonRpcUrl } from "./scripts/constants/networks";
21
import { ChainKey, chainKeyToSlug } from "./src";
22
23
const dotenvConfigPath: string = process.env.DOTENV_CONFIG_PATH || "./.env";
@@ -33,7 +33,6 @@ function getChainConfig(chain: keyof typeof chainKeyToSlug): NetworkUserConfig {
33
return {
34
accounts: [`0x${privateKey}`],
35
chainId: chainKeyToSlug[chain],
36
- gasPrice: gasPrice[chain] ? gasPrice[chain] : "auto",
37
url: getJsonRpcUrl(chain),
38
};
39
}
scripts/constants/networks.ts
@@ -6,23 +6,6 @@ import { ChainKey, networkToChainSlug } from "../../src";
6
7
dotenvConfig({ path: resolve(__dirname, dotenvConfigPath) });
8
9
-export const gasPrice: {
10
- [chainKEY in ChainKey]?: number | "auto" | undefined;
11
-} = {
12
- [ChainKey.ARBITRUM]: "auto",
13
- [ChainKey.ARBITRUM_GOERLI]: "auto",
14
- [ChainKey.OPTIMISM]: "auto",
15
- [ChainKey.OPTIMISM_GOERLI]: "auto",
16
- [ChainKey.AVALANCHE]: "auto",
- [ChainKey.BSC]: "auto",
- [ChainKey.BSC_TESTNET]: "auto",
- [ChainKey.MAINNET]: "auto",
- [ChainKey.GOERLI]: "auto",
- [ChainKey.POLYGON_MAINNET]: "auto",
- [ChainKey.POLYGON_MUMBAI]: "auto",
- [ChainKey.HARDHAT]: "auto",
24
-};
25
-
26
export const chainSlugKeys: string[] = Object.values(networkToChainSlug);
27
28
export function getJsonRpcUrl(chain: ChainKey): string {
scripts/deploy/checkRoles.ts
@@ -31,6 +31,7 @@ import {
31
transmitterAddresses,
32
watcherAddresses,
} from "./config";
+import { overrides } from "./config";
let roleStatus: any = {};
@@ -154,6 +155,7 @@ const executeRoleTransactions = async (
154
155
let tx = await wallet.sendTransaction({
156
to: contractAddress,
157
data,
158
+ ...overrides[chainId],
159
});
160
console.log(
161
`chain: ${chainId}`,
scripts/deploy/config.ts
@@ -37,6 +37,11 @@ export const filterChains: number[] = chains;
export const capacitorType = 1;
export const maxPacketLength = 1;
40
+export const gasLimit = 30_000_000;
41
+export const type = 0;
42
+export const gasMultiplier = 1;
43
+export const gasPrice = "auto";
44
+
45
export const transmitterAddresses = {
46
[DeploymentMode.DEV]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320",
47
[DeploymentMode.SURGE]: "0x22883bEF8302d50Ac76c6F6e048965Cd4413EBb7",
@@ -54,3 +59,66 @@ export const executorAddresses = {
54
59
[DeploymentMode.SURGE]: "0x3051Aa7F267bF425A4e8bF766750D60391F014B4",
55
60
[DeploymentMode.PROD]: "0x557E729E55d49E767c11982d026a63aBFD930Ac9",
56
61
62
63
+export const overrides = {
64
+ [ChainSlug.ARBITRUM]: {
65
+ type,
66
+ gasPrice,
67
+ gasLimit,
68
+ gasMultiplier,
69
+ },
70
+ [ChainSlug.ARBITRUM_GOERLI]: {
71
72
73
74
75
76
+ [ChainSlug.OPTIMISM]: {
77
78
79
80
81
82
+ [ChainSlug.OPTIMISM_GOERLI]: {
83
84
85
86
87
88
+ [ChainSlug.BSC]: {
89
90
91
92
93
94
+ [ChainSlug.BSC_TESTNET]: {
95
96
97
98
99
100
+ [ChainSlug.MAINNET]: {
101
102
103
104
105
106
+ [ChainSlug.GOERLI]: {
107
108
109
110
111
112
+ [ChainSlug.POLYGON_MAINNET]: {
113
114
115
116
117
118
+ [ChainSlug.POLYGON_MUMBAI]: {
119
120
121
122
123
124
+};
scripts/deploy/configure.ts
@@ -21,6 +21,7 @@ import {
} from "../../src";
import registerSwitchBoard from "./scripts/registerSwitchboard";
import { capacitorType, chains, maxPacketLength, mode } from "./config";
export const main = async () => {
try {
@@ -185,7 +186,9 @@ const setRemoteSwitchboards = async (addresses) => {
185
186
187
const tx = await sbContract
188
.connect(socketSigner)
- [functionName](dstSwitchboardAddress);
189
+ [functionName](dstSwitchboardAddress, {
190
+ ...overrides[await socketSigner.getChainId()],
191
+ });
192
console.log(tx.hash);
193
await tx.wait();
194
scripts/deploy/connect.ts
@@ -17,6 +17,7 @@ import {
import { mode } from "./config";
import { Contract, Wallet } from "ethers";
import { getSwitchboardAddress } from "../../src";
const chains = [...TestnetIds, ...MainnetIds];
@@ -88,7 +89,8 @@ export const main = async () => {
const tx = await counter.setSocketConfig(
sibling,
siblingCounter,
- switchboard
+ switchboard,
+ { ...overrides[await socketSigner.getChainId()] }
);
scripts/deploy/scripts/registerSwitchboard.ts
@@ -3,6 +3,7 @@ import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
3
4
import { createObj, getInstance } from "../utils";
5
import { ChainSlug, ChainSocketAddresses } from "../../../src";
+import { overrides } from "../config";
export default async function registerSwitchBoard(
switchBoardAddress: string,
@@ -29,7 +30,8 @@ export default async function registerSwitchBoard(
29
30
switchBoardAddress,
maxPacketLength,
remoteChainSlug,
- capacitorType
+ capacitorType,
+ { ...overrides[await signer.getChainId()] }
`Registering Switchboard ${switchBoardAddress}: ${registerTx.hash}`
scripts/deploy/utils/utils.ts
@@ -12,6 +12,7 @@ import {
DeploymentMode,
} from "../../../src";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
export const deploymentsPath = path.join(__dirname, `/../../../deployments/`);
@@ -84,8 +85,9 @@ export async function deployContractWithArgs(
const Contract: ContractFactory = await ethers.getContractFactory(
contractName
- const contract: Contract = await Contract.connect(signer).deploy(...args);
+ const contract: Contract = await Contract.connect(signer).deploy(...args, {
+ ...overrides[await signer.getChainId()],
await contract.deployed();
return contract;
} catch (error) {
0 commit comments