Skip to content
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

feat: add sepolia & arbitrum sepolia #430

Merged
merged 14 commits into from
Jan 5, 2024
6 changes: 0 additions & 6 deletions .husky/pre-push

This file was deleted.

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 @@ -257,8 +273,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 @@ -267,12 +286,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 @@ -283,6 +307,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 @@ -27,6 +28,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 @@ -55,6 +59,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 @@ -66,7 +76,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 @@ -77,6 +87,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 @@ -105,11 +123,14 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = {
(INFURA_KEY
? `https://linea-goerli.infura.io/v3/${INFURA_KEY}`
: `https://rpc.goerli.linea.build`),
[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 @@ -119,6 +140,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 @@ -127,11 +150,13 @@ export const CHAINS_ID: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.zksyncGoerli]: ZKSYNC_GOERLI_CHAINID,
[eEthereumNetwork.linea]: LINEA_CHAINID,
[eEthereumNetwork.lineaGoerli]: LINEA_GOERLI_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 @@ -141,6 +166,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 @@ -149,4 +176,5 @@ export const BLOCK_TO_FORK: iParamsPerNetwork<number | undefined> = {
[eEthereumNetwork.zksyncGoerli]: undefined,
[eEthereumNetwork.linea]: undefined,
[eEthereumNetwork.lineaGoerli]: undefined,
[eEthereumNetwork.neon]: undefined,
};
5 changes: 2 additions & 3 deletions helpers/contracts-deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,14 +957,13 @@ export const deployPoolComponents = async (

const config = getParaSpaceConfig();
const treasuryAddress = config.Treasury;
const cApe = await getAutoCompoundApe();
const poolApeStaking = allTokens.APE
? ((await withSaveAndVerify(
await getContractFactory("PoolApeStaking", apeStakingLibraries),
eContractid.PoolApeStakingImpl,
[
provider,
cApe.address,
(await getAutoCompoundApe()).address,
allTokens.APE.address,
allTokens.USDC.address,
(await getUniswapV3SwapRouter()).address,
Expand All @@ -987,7 +986,7 @@ export const deployPoolComponents = async (
? ((await withSaveAndVerify(
await getContractFactory("PoolBorrowAndStake", BorrowAndStakeLibraries),
eContractid.PoolBorrowAndStakeImpl,
[provider, cApe.address, allTokens.APE.address],
[provider, (await getAutoCompoundApe()).address, allTokens.APE.address],
verify,
false,
BorrowAndStakeLibraries,
Expand Down
Loading
Loading