Skip to content

Commit

Permalink
Merge branch 'main' into manta_deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujia6139 committed Feb 6, 2024
2 parents 27b91d8 + f741497 commit 09829e9
Show file tree
Hide file tree
Showing 18 changed files with 453 additions and 147 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ send-eth:
set-traits-multipliers:
make SCRIPT_PATH=./scripts/dev/11.set-traits-multipliers.ts run

.PHONY: set-timelock-strategy
set-timelock-strategy:
.PHONY: update-timelock-strategy
update-timelock-strategy:
make SCRIPT_PATH=./scripts/dev/12.set-timelock-strategy.ts run

.PHONY: acl
Expand Down Expand Up @@ -576,6 +576,10 @@ set-interest-rate-strategy:
set-auction-strategy:
make TASK_NAME=set-auction-strategy run-task

.PHONY: set-timelock-strategy
set-timelock-strategy:
make TASK_NAME=set-timelock-strategy run-task

.PHONY: set-supply-cap
set-supply-cap:
make TASK_NAME=set-supply-cap run-task
Expand Down
74 changes: 50 additions & 24 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ import {
MOONBASE_ETHERSCAN_KEY,
LINEA_ETHERSCAN_KEY,
LINEA_GOERLI_ETHERSCAN_KEY,
SEPOLIA_ETHERSCAN_KEY,
ARBITRUM_SEPOLIA_ETHERSCAN_KEY,
PARALLEL_DEV_ETHERSCAN_KEY,
NEON_ETHERSCAN_KEY,
PARALLEL_ETHERSCAN_KEY,
} from "./helpers/hardhat-constants";
import {accounts} from "./wallets";
import {accounts as evmAccounts} from "./evm-wallets";
import {
buildForkConfig,
CHAINS_ID,
Expand Down Expand Up @@ -74,12 +78,7 @@ const hardhatConfig: HardhatUserConfig = {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: false,
except: [
"Mock*",
"ApeCoinStaking",
"SwapRouter",
"NonfungiblePositionManager",
],
except: ["Mock*"],
strict: true,
},
paths: {
Expand Down Expand Up @@ -154,13 +153,23 @@ const hardhatConfig: HardhatUserConfig = {
allowUnlimitedContractSize: true,
timeout: 9000000,
},
hardhat: {
hardfork: HARDFORK,
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
gas: DEFAULT_BLOCK_GAS_LIMIT,
gasPrice: "auto",
chainId: CHAINS_ID[eEthereumNetwork.hardhat],
throwOnTransactionFailures: true,
throwOnCallFailures: true,
accounts,
loggingEnabled: VERBOSE,
forking: buildForkConfig(),
allowUnlimitedContractSize: true,
},
parallel: {
url: NETWORKS_RPC_URL[eEthereumNetwork.parallel],
chainId: CHAINS_ID[eEthereumNetwork.parallel],
accounts: evmAccounts.map(({privateKey}) => privateKey),
gasPrice: 4e9,
gas: 4e6,
allowUnlimitedContractSize: true,
accounts: DEPLOYER,
},
moonbeam: {
chainId: CHAINS_ID[eEthereumNetwork.moonbeam],
Expand All @@ -172,24 +181,16 @@ const hardhatConfig: HardhatUserConfig = {
url: NETWORKS_RPC_URL[eEthereumNetwork.moonbase],
accounts: DEPLOYER,
},
hardhat: {
hardfork: HARDFORK,
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
gas: DEFAULT_BLOCK_GAS_LIMIT,
gasPrice: "auto",
chainId: CHAINS_ID[eEthereumNetwork.hardhat],
throwOnTransactionFailures: true,
throwOnCallFailures: true,
accounts,
loggingEnabled: VERBOSE,
forking: buildForkConfig(),
allowUnlimitedContractSize: true,
},
goerli: {
chainId: CHAINS_ID[eEthereumNetwork.goerli],
url: NETWORKS_RPC_URL[eEthereumNetwork.goerli],
accounts: DEPLOYER,
},
sepolia: {
chainId: CHAINS_ID[eEthereumNetwork.sepolia],
url: NETWORKS_RPC_URL[eEthereumNetwork.sepolia],
accounts: DEPLOYER,
},
arbitrum: {
chainId: CHAINS_ID[eEthereumNetwork.arbitrum],
url: NETWORKS_RPC_URL[eEthereumNetwork.arbitrum],
Expand All @@ -200,6 +201,16 @@ const hardhatConfig: HardhatUserConfig = {
url: NETWORKS_RPC_URL[eEthereumNetwork.arbitrumGoerli],
accounts: DEPLOYER,
},
arbitrumSepolia: {
chainId: CHAINS_ID[eEthereumNetwork.arbitrumSepolia],
url: NETWORKS_RPC_URL[eEthereumNetwork.arbitrumSepolia],
accounts: DEPLOYER,
},
parallelDev: {
chainId: CHAINS_ID[eEthereumNetwork.parallelDev],
url: NETWORKS_RPC_URL[eEthereumNetwork.parallelDev],
accounts: DEPLOYER,
},
polygon: {
chainId: CHAINS_ID[eEthereumNetwork.polygon],
url: NETWORKS_RPC_URL[eEthereumNetwork.polygon],
Expand Down Expand Up @@ -246,6 +257,11 @@ const hardhatConfig: HardhatUserConfig = {
url: NETWORKS_RPC_URL[eEthereumNetwork.lineaGoerli],
accounts: DEPLOYER,
},
neon: {
chainId: CHAINS_ID[eEthereumNetwork.neon],
url: NETWORKS_RPC_URL[eEthereumNetwork.neon],
accounts: DEPLOYER,
},
mainnet: {
chainId: CHAINS_ID[eEthereumNetwork.mainnet],
url: NETWORKS_RPC_URL[eEthereumNetwork.mainnet],
Expand All @@ -267,8 +283,11 @@ const hardhatConfig: HardhatUserConfig = {
localhost: ETHERSCAN_KEY,
mainnet: ETHERSCAN_KEY,
goerli: GOERLI_ETHERSCAN_KEY,
sepolia: SEPOLIA_ETHERSCAN_KEY,
arbitrum: ARBITRUM_ETHERSCAN_KEY,
arbitrumGoerli: ARBITRUM_GOERLI_ETHERSCAN_KEY,
arbitrumSepolia: ARBITRUM_SEPOLIA_ETHERSCAN_KEY,
parallelDev: PARALLEL_DEV_ETHERSCAN_KEY,
polygon: POLYGON_ETHERSCAN_KEY,
polygonMumbai: POLYGON_MUMBAI_ETHERSCAN_KEY,
polygonZkevm: POLYGON_ZKEVM_ETHERSCAN_KEY,
Expand All @@ -277,12 +296,17 @@ const hardhatConfig: HardhatUserConfig = {
moonbase: MOONBASE_ETHERSCAN_KEY,
linea: LINEA_ETHERSCAN_KEY,
lineaGoerli: LINEA_GOERLI_ETHERSCAN_KEY,
neon: NEON_ETHERSCAN_KEY,
parallel: PARALLEL_ETHERSCAN_KEY,
},
customChains: [
eEthereumNetwork.localhost,
eEthereumNetwork.goerli,
eEthereumNetwork.sepolia,
eEthereumNetwork.arbitrum,
eEthereumNetwork.arbitrumGoerli,
eEthereumNetwork.arbitrumSepolia,
eEthereumNetwork.parallelDev,
eEthereumNetwork.polygon,
eEthereumNetwork.polygonZkevm,
eEthereumNetwork.polygonMumbai,
Expand All @@ -293,6 +317,8 @@ const hardhatConfig: HardhatUserConfig = {
eEthereumNetwork.moonbase,
eEthereumNetwork.linea,
eEthereumNetwork.lineaGoerli,
eEthereumNetwork.neon,
eEthereumNetwork.parallel,
].map((network) => ({
network,
chainId: CHAINS_ID[network]!,
Expand Down
30 changes: 29 additions & 1 deletion helper-hardhat-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
FORK_BLOCK_NUMBER,
FORK_CHAINID,
GOERLI_CHAINID,
SEPOLIA_CHAINID,
HARDHAT_CHAINID,
INFURA_KEY,
L1_RPC_URL,
Expand All @@ -29,6 +30,9 @@ import {
TENDERLY_FORK_ID,
ZKSYNC_CHAINID,
ZKSYNC_GOERLI_CHAINID,
ARBITRUM_SEPOLIA_CHAINID,
PARALLEL_DEV_CHAINID,
NEON_CHAINID,
} from "./helpers/hardhat-constants";

dotenv.config();
Expand Down Expand Up @@ -57,6 +61,12 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
(ALCHEMY_KEY
? `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_KEY}`
: `https://goerli.infura.io/v3/${INFURA_KEY}`),
[eEthereumNetwork.sepolia]:
L1_RPC_URL ||
RPC_URL ||
(ALCHEMY_KEY
? `https://eth-sepolia.alchemyapi.io/v2/${ALCHEMY_KEY}`
: `https://sepolia.infura.io/v3/${INFURA_KEY}`),
[eEthereumNetwork.mainnet]:
L1_RPC_URL ||
RPC_URL ||
Expand All @@ -68,7 +78,7 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
[eEthereumNetwork.ganache]: RPC_URL || "http://localhost:8545",
[eEthereumNetwork.tenderlyMain]:
RPC_URL || `https://rpc.tenderly.co/fork/${TENDERLY_FORK_ID}`,
[eEthereumNetwork.parallel]: RPC_URL || "http://localhost:29933",
[eEthereumNetwork.parallel]: RPC_URL || "https://rpc.parallel.fi",
[eEthereumNetwork.moonbeam]: "https://rpc.api.moonbeam.network",
[eEthereumNetwork.moonbase]: "https://rpc.testnet.moonbeam.network",
[eEthereumNetwork.arbitrum]:
Expand All @@ -79,6 +89,14 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
L2_RPC_URL ||
RPC_URL ||
`https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}`,
[eEthereumNetwork.arbitrumSepolia]:
L2_RPC_URL ||
RPC_URL ||
`https://arb-sepolia.g.alchemy.com/v2/${ALCHEMY_KEY}`,
[eEthereumNetwork.parallelDev]:
L2_RPC_URL ||
RPC_URL ||
`https://rpc-surprised-harlequin-bonobo-fvcy2k9oqh.t.conduit.xyz`,
[eEthereumNetwork.polygon]:
RPC_URL || `https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`,
[eEthereumNetwork.polygonMumbai]:
Expand Down Expand Up @@ -110,11 +128,14 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
[eEthereumNetwork.manta]: "https://pacific-rpc.manta.network/http",
[eEthereumNetwork.mantaTest]:
"https://pacific-rpc.testnet.manta.network/http",
[eEthereumNetwork.neon]:
RPC_URL || `https://neon-proxy-mainnet.solana.p2p.org`,
};

export const CHAINS_ID: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.mainnet]: MAINNET_CHAINID,
[eEthereumNetwork.goerli]: GOERLI_CHAINID,
[eEthereumNetwork.sepolia]: SEPOLIA_CHAINID,
[eEthereumNetwork.hardhat]: FORK ? FORK_CHAINID : HARDHAT_CHAINID,
[eEthereumNetwork.anvil]: HARDHAT_CHAINID,
[eEthereumNetwork.ganache]: undefined,
Expand All @@ -124,6 +145,8 @@ export const CHAINS_ID: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.moonbase]: MOONBASE_CHAINID,
[eEthereumNetwork.arbitrum]: ARBITRUM_ONE_CHAINID,
[eEthereumNetwork.arbitrumGoerli]: ARBITRUM_GOERLI_CHAINID,
[eEthereumNetwork.arbitrumSepolia]: ARBITRUM_SEPOLIA_CHAINID,
[eEthereumNetwork.parallelDev]: PARALLEL_DEV_CHAINID,
[eEthereumNetwork.polygon]: POLYGON_CHAINID,
[eEthereumNetwork.polygonMumbai]: POLYGON_MUMBAI_CHAINID,
[eEthereumNetwork.polygonZkevm]: POLYGON_ZKEVM_CHAINID,
Expand All @@ -134,11 +157,13 @@ export const CHAINS_ID: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.lineaGoerli]: LINEA_GOERLI_CHAINID,
[eEthereumNetwork.manta]: MANTA_CHAINID,
[eEthereumNetwork.mantaTest]: MANTA_TEST_CHAINID,
[eEthereumNetwork.neon]: NEON_CHAINID,
};

export const BLOCK_TO_FORK: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.mainnet]: undefined,
[eEthereumNetwork.goerli]: undefined,
[eEthereumNetwork.sepolia]: undefined,
[eEthereumNetwork.hardhat]: undefined,
[eEthereumNetwork.anvil]: undefined,
[eEthereumNetwork.ganache]: undefined,
Expand All @@ -148,6 +173,8 @@ export const BLOCK_TO_FORK: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.moonbase]: undefined,
[eEthereumNetwork.arbitrum]: undefined,
[eEthereumNetwork.arbitrumGoerli]: undefined,
[eEthereumNetwork.arbitrumSepolia]: undefined,
[eEthereumNetwork.parallelDev]: undefined,
[eEthereumNetwork.polygon]: undefined,
[eEthereumNetwork.polygonMumbai]: undefined,
[eEthereumNetwork.polygonZkevm]: undefined,
Expand All @@ -158,4 +185,5 @@ export const BLOCK_TO_FORK: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.lineaGoerli]: undefined,
[eEthereumNetwork.manta]: undefined,
[eEthereumNetwork.mantaTest]: undefined,
[eEthereumNetwork.neon]: undefined,
};
Loading

0 comments on commit 09829e9

Please sign in to comment.