-
Notifications
You must be signed in to change notification settings - Fork 14
Add CreateX factory for new chain deployment #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1e29b3c
5e833cd
7f0345c
804664d
f6dfe7b
d86109e
c5372df
f7eba8e
7246d45
ba423b0
8a2e36a
029d916
1b56be8
451b684
8a4f8f8
3b792be
8356452
a8ffb0c
385d8bb
709b77c
06732be
2237a04
1d428be
76cf6c4
c1bdebc
c671acd
5558358
f6c8f22
fd50b3f
39b36e3
d2b00dd
5e8c2f2
1be040a
f06e9df
417fa0f
af68498
80da385
9c65946
c1a0e6e
69be4ab
e737a6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ import chainConfig from './utils/config'; | |
|
||
const isNativeChainType = chainConfig.isNativeChain(); | ||
const isLocalFork = process.env.LOCAL_FORK == 'true'; | ||
const isFujiFork = process.env.FUJI_FORK == 'true'; | ||
const isArbitrumSepoliaFork = process.env.ARBITRUM_SEPOLIA_FORK == 'true'; | ||
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keeping only a single variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is to select the current chain to fork either local as bellecour, fuji, or arbi There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gonna check that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made some research, can't figure it out a better way than what we have rn |
||
const bellecourBlockscoutUrl = 'https://blockscout.bellecour.iex.ec'; | ||
|
||
/** | ||
|
@@ -28,6 +30,20 @@ const bellecourBaseConfig = { | |
blockGasLimit: 6_700_000, | ||
}; | ||
|
||
// Avalanche Fuji specific configuration | ||
const fujiBaseConfig = { | ||
gasPrice: 25_000_000_000, // 25 Gwei default | ||
blockGasLimit: 8_000_000, | ||
chainId: 43113, | ||
}; | ||
|
||
// Arbitrum Sepolia specific configuration | ||
const arbitrumSepoliaBaseConfig = { | ||
gasPrice: 100_000_000, // 0.1 Gwei default (Arbitrum has lower gas prices) | ||
blockGasLimit: 30_000_000, // Arbitrum has higher block gas limits | ||
chainId: 421614, | ||
}; | ||
|
||
const settings = { | ||
optimizer: { | ||
enabled: true, | ||
|
@@ -81,6 +97,26 @@ const config: HardhatUserConfig = { | |
}, | ||
chainId: 134, | ||
}), | ||
...(isFujiFork && { | ||
forking: { | ||
url: process.env.FUJI_RPC_URL || 'https://api.avax-test.network/ext/bc/C/rpc', | ||
blockNumber: process.env.FUJI_BLOCK_NUMBER | ||
? parseInt(process.env.FUJI_BLOCK_NUMBER) | ||
: undefined, | ||
}, | ||
...fujiBaseConfig, | ||
}), | ||
...(isArbitrumSepoliaFork && { | ||
forking: { | ||
url: | ||
process.env.ARBITRUM_SEPOLIA_RPC_URL || | ||
'https://sepolia-rollup.arbitrum.io/rpc', | ||
blockNumber: process.env.ARBITRUM_SEPOLIA_BLOCK_NUMBER | ||
? parseInt(process.env.ARBITRUM_SEPOLIA_BLOCK_NUMBER) | ||
: undefined, | ||
}, | ||
...arbitrumSepoliaBaseConfig, | ||
}), | ||
}, | ||
'external-hardhat': { | ||
...defaultHardhatNetworkParams, | ||
|
@@ -93,6 +129,14 @@ const config: HardhatUserConfig = { | |
accounts: 'remote', // Override defaults accounts for impersonation | ||
chainId: 134, | ||
}), | ||
...(isFujiFork && { | ||
accounts: 'remote', // Override defaults accounts for impersonation | ||
...fujiBaseConfig, | ||
}), | ||
...(isArbitrumSepoliaFork && { | ||
accounts: 'remote', // Override defaults accounts for impersonation | ||
...arbitrumSepoliaBaseConfig, | ||
}), | ||
}, | ||
'dev-native': { | ||
chainId: 65535, | ||
|
@@ -128,6 +172,22 @@ const config: HardhatUserConfig = { | |
mnemonic: process.env.MNEMONIC || '', | ||
}, | ||
}, | ||
// Add Fuji as a network | ||
avalancheFujiTestnet: { | ||
url: process.env.FUJI_RPC_URL || 'https://api.avax-test.network/ext/bc/C/rpc', | ||
accounts: { | ||
mnemonic: process.env.MNEMONIC || HARDHAT_NETWORK_MNEMONIC, | ||
}, | ||
...fujiBaseConfig, | ||
}, | ||
// Add Arbitrum Sepolia as a network | ||
'arbitrum-sepolia': { | ||
url: process.env.ARBITRUM_SEPOLIA_RPC_URL || 'https://sepolia-rollup.arbitrum.io/rpc', | ||
accounts: { | ||
mnemonic: process.env.MNEMONIC || HARDHAT_NETWORK_MNEMONIC, | ||
}, | ||
...arbitrumSepoliaBaseConfig, | ||
}, | ||
viviani: { | ||
chainId: 133, | ||
url: 'https://viviani.iex.ec', | ||
|
@@ -155,6 +215,8 @@ const config: HardhatUserConfig = { | |
etherscan: { | ||
apiKey: { | ||
mainnet: process.env.ETHERSCAN_API_KEY || '', | ||
avalancheFujiTestnet: 'nothing', // a non-empty string is needed by the plugin. | ||
arbitrumSepolia: process.env.ARBISCAN_API_KEY || '', | ||
viviani: 'nothing', // a non-empty string is needed by the plugin. | ||
bellecour: 'nothing', // a non-empty string is needed by the plugin. | ||
}, | ||
|
@@ -195,6 +257,7 @@ const config: HardhatUserConfig = { | |
'@openzeppelin/contracts-v5/interfaces/IERC1271.sol', | ||
// Used in deployment | ||
'@amxx/factory/contracts/v6/GenericFactory.sol', | ||
'createx/src/ICreateX.sol', | ||
], | ||
keep: true, // Slither requires compiled dependencies | ||
}, | ||
|
@@ -218,7 +281,7 @@ const config: HardhatUserConfig = { | |
'Store.v8.sol', | ||
], | ||
}, | ||
mocha: { timeout: 50000 }, | ||
mocha: { timeout: 300000 }, | ||
}; | ||
|
||
/** | ||
|
Uh oh!
There was an error while loading. Please reload this page.