aave / aave-v3-deploy

Other
48 stars 77 forks source link

Error: ERROR processing /aave/deploy/02_market/09_init_reserves.ts: ProviderError: HttpProviderError #52

Open jkrcmar opened 10 months ago

jkrcmar commented 10 months ago

first of all you guys rock for putting this repo together. i am trying to deploy aave on an ethereum blockchain via ganache and here is how far i got. i have tried deploying this to a dockerized ganache instance and on my windows host and both give the same error. Many thanks for the assistance.:

Error Logs

[WARNING] Using latest deployed Treasury proxy instead of ReserveFactorTreasuryAddress from configuration file [WARNING] Using deployed Testnet tokens instead of ReserveAssets from configuration file Strategy address for asset DAI: 0xC0Be9B403FB1a5c44ba827Cea7065A2a5A2C909a Strategy address for asset LINK: 0x244f3105E140fF0938D0B1B3B3C312cCc098383D Strategy address for asset USDC: 0x3398bc7D3dc5A7E4818F88F8BFc82dBe40b03BD5 Strategy address for asset WBTC: 0x244f3105E140fF0938D0B1B3B3C312cCc098383D Strategy address for asset WETH: 0x244f3105E140fF0938D0B1B3B3C312cCc098383D Strategy address for asset USDT: 0x3398bc7D3dc5A7E4818F88F8BFc82dBe40b03BD5 Strategy address for asset AAVE: 0x244f3105E140fF0938D0B1B3B3C312cCc098383D Strategy address for asset EURS: 0x3398bc7D3dc5A7E4818F88F8BFc82dBe40b03BD5

Error: ERROR processing /mnt/c/Users/quark/OneDrive - KRCMAR/Desktop/Programming/LeverNet/supporting_apps/aave/deploy/02_market/09_init_reserves.ts: ProviderError: HttpProviderError at HttpProvider.request (/mnt/c/Users/quark/OneDrive - KRCMAR/Desktop/Programming/LeverNet/supporting_apps/aave/node_modules/hardhat/src/internal/core/providers/http.ts:78:19) at AutomaticSenderProvider.request (/mnt/c/Users/quark/OneDrive - KRCMAR/Desktop/Programming/LeverNet/supporting_apps/aave/node_modules/hardhat/src/internal/core/providers/accounts.ts:344:34)

hardhat.config.ts

import { DETERMINISTIC_DEPLOYMENT, DETERMINISTIC_FACTORIES, ETHERSCAN_KEY, getCommonNetworkConfig, hardhatNetworkSettings, loadTasks, } from "./helpers/hardhat-config-helpers"; import { eArbitrumNetwork, eAvalancheNetwork, eEthereumNetwork, eFantomNetwork, eHarmonyNetwork, eOptimismNetwork, ePolygonNetwork, eTenderly, } from "./helpers/types"; import { DEFAULT_NAMED_ACCOUNTS } from "./helpers/constants";

import "@nomicfoundation/hardhat-toolbox"; import "hardhat-deploy"; import "hardhat-contract-sizer"; import "hardhat-dependency-compiler"; import "@nomicfoundation/hardhat-chai-matchers";

const SKIP_LOAD = process.env.SKIP_LOAD === "true"; const TASK_FOLDERS = ["misc", "market-registry"];

// Prevent to load tasks before compilation and typechain if (!SKIP_LOAD) { loadTasks(TASK_FOLDERS); }

export default { contractSizer: { alphaSort: true, runOnCompile: false, disambiguatePaths: false, }, solidity: { compilers: [ { version: "0.8.10", settings: { optimizer: { enabled: true, runs: 100_000 }, evmVersion: "berlin", }, }, { version: "0.7.5", settings: { optimizer: { enabled: true, runs: 100_000 }, }, }, ], }, typechain: { outDir: "typechain", target: "ethers-v5", }, networks: { hardhat: hardhatNetworkSettings, localhost: { url: "http://192.168.0.11:7545", ...hardhatNetworkSettings, }, tenderly: getCommonNetworkConfig("tenderly", 3030), main: getCommonNetworkConfig(eEthereumNetwork.main, 1), kovan: getCommonNetworkConfig(eEthereumNetwork.kovan, 42), rinkeby: getCommonNetworkConfig(eEthereumNetwork.rinkeby, 4), ropsten: getCommonNetworkConfig(eEthereumNetwork.ropsten, 3),

  ePolygonNetwork.polygon,
  137
),
[ePolygonNetwork.mumbai]: getCommonNetworkConfig(
  ePolygonNetwork.mumbai,
  80001
),
arbitrum: getCommonNetworkConfig(eArbitrumNetwork.arbitrum, 42161),
[eArbitrumNetwork.arbitrumTestnet]: getCommonNetworkConfig(
  eArbitrumNetwork.arbitrumTestnet,
  421611
),
[eHarmonyNetwork.main]: getCommonNetworkConfig(
  eHarmonyNetwork.main,
  1666600000
),
[eHarmonyNetwork.testnet]: getCommonNetworkConfig(
  eHarmonyNetwork.testnet,
  1666700000
),
[eAvalancheNetwork.avalanche]: getCommonNetworkConfig(
  eAvalancheNetwork.avalanche,
  43114
),
[eAvalancheNetwork.fuji]: getCommonNetworkConfig(
  eAvalancheNetwork.fuji,
  43113
),
[eFantomNetwork.main]: getCommonNetworkConfig(eFantomNetwork.main, 250),
[eFantomNetwork.testnet]: getCommonNetworkConfig(
  eFantomNetwork.testnet,
  4002
),
[eOptimismNetwork.testnet]: getCommonNetworkConfig(
  eOptimismNetwork.testnet,
  420
),
[eOptimismNetwork.main]: getCommonNetworkConfig(eOptimismNetwork.main, 10),
[eEthereumNetwork.goerli]: getCommonNetworkConfig(
  eEthereumNetwork.goerli,
  5
),
[eEthereumNetwork.sepolia]: getCommonNetworkConfig(
  eEthereumNetwork.sepolia,
  11155111
),
[eArbitrumNetwork.goerliNitro]: getCommonNetworkConfig(
  eArbitrumNetwork.goerliNitro,
  421613
),

}, namedAccounts: { ...DEFAULT_NAMED_ACCOUNTS, }, mocha: { timeout: 0, }, dependencyCompiler: { paths: [ "@aave/core-v3/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol", "@aave/core-v3/contracts/protocol/configuration/PoolAddressesProvider.sol", "@aave/core-v3/contracts/misc/AaveOracle.sol", "@aave/core-v3/contracts/protocol/tokenization/AToken.sol", "@aave/core-v3/contracts/protocol/tokenization/DelegationAwareAToken.sol", "@aave/core-v3/contracts/protocol/tokenization/StableDebtToken.sol", "@aave/core-v3/contracts/protocol/tokenization/VariableDebtToken.sol", "@aave/core-v3/contracts/protocol/libraries/logic/GenericLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/ValidationLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/ReserveLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/SupplyLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/EModeLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/BorrowLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/BridgeLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/FlashLoanLogic.sol", "@aave/core-v3/contracts/protocol/libraries/logic/CalldataLogic.sol", "@aave/core-v3/contracts/protocol/pool/Pool.sol", "@aave/core-v3/contracts/protocol/pool/L2Pool.sol", "@aave/core-v3/contracts/protocol/pool/PoolConfigurator.sol", "@aave/core-v3/contracts/protocol/pool/DefaultReserveInterestRateStrategy.sol", "@aave/core-v3/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol", "@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol", "@aave/core-v3/contracts/deployments/ReservesSetupHelper.sol", "@aave/core-v3/contracts/misc/AaveProtocolDataProvider.sol", "@aave/core-v3/contracts/misc/L2Encoder.sol", "@aave/core-v3/contracts/protocol/configuration/ACLManager.sol", "@aave/core-v3/contracts/dependencies/weth/WETH9.sol", "@aave/core-v3/contracts/mocks/helpers/MockIncentivesController.sol", "@aave/core-v3/contracts/mocks/helpers/MockReserveConfiguration.sol", "@aave/core-v3/contracts/mocks/oracle/CLAggregators/MockAggregator.sol", "@aave/core-v3/contracts/mocks/tokens/MintableERC20.sol", "@aave/core-v3/contracts/mocks/flashloan/MockFlashLoanReceiver.sol", "@aave/core-v3/contracts/mocks/tokens/WETH9Mocked.sol", "@aave/core-v3/contracts/mocks/upgradeability/MockVariableDebtToken.sol", "@aave/core-v3/contracts/mocks/upgradeability/MockAToken.sol", "@aave/core-v3/contracts/mocks/upgradeability/MockStableDebtToken.sol", "@aave/core-v3/contracts/mocks/upgradeability/MockInitializableImplementation.sol", "@aave/core-v3/contracts/mocks/helpers/MockPool.sol", "@aave/core-v3/contracts/mocks/helpers/MockL2Pool.sol", "@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol", "@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol", "@aave/core-v3/contracts/mocks/oracle/PriceOracle.sol", "@aave/core-v3/contracts/mocks/tokens/MintableDelegationERC20.sol", "@aave/periphery-v3/contracts/misc/UiPoolDataProviderV3.sol", "@aave/periphery-v3/contracts/misc/WalletBalanceProvider.sol", "@aave/periphery-v3/contracts/misc/WrappedTokenGatewayV3.sol", "@aave/periphery-v3/contracts/misc/interfaces/IWETH.sol", "@aave/periphery-v3/contracts/misc/UiIncentiveDataProviderV3.sol", "@aave/periphery-v3/contracts/rewards/RewardsController.sol", "@aave/periphery-v3/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol", "@aave/periphery-v3/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol", "@aave/periphery-v3/contracts/rewards/EmissionManager.sol", "@aave/periphery-v3/contracts/mocks/WETH9Mock.sol", "@aave/periphery-v3/contracts/mocks/testnet-helpers/Faucet.sol", "@aave/periphery-v3/contracts/mocks/testnet-helpers/TestnetERC20.sol", "@aave/periphery-v3/contracts/treasury/Collector.sol", "@aave/periphery-v3/contracts/treasury/CollectorController.sol", "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol", "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveController.sol", "@aave/periphery-v3/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol", "@aave/periphery-v3/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol", "@aave/safety-module/contracts/stake/StakedAave.sol", "@aave/safety-module/contracts/stake/StakedAaveV2.sol", "@aave/safety-module/contracts/proposals/extend-stkaave-distribution/StakedTokenV2Rev3.sol", ], }, deterministicDeployment: DETERMINISTIC_DEPLOYMENT ? DETERMINISTIC_FACTORIES : undefined, etherscan: { apiKey: ETHERSCAN_KEY, }, };

hardhat-config-helpers.ts

import fs from "fs"; import path from "path"; import { HardhatNetworkForkingUserConfig } from "hardhat/types"; import { iParamsPerNetwork, eEthereumNetwork, eNetwork, ePolygonNetwork, eArbitrumNetwork, eHarmonyNetwork, eAvalancheNetwork, eFantomNetwork, eOptimismNetwork, } from "./types";

require("dotenv").config();

export const DEFAULT_BLOCK_GAS_LIMIT = 12450000; export const DEFAULT_GAS_PRICE = 8000000000; export const INFURA_KEY = process.env.INFURA_KEY || ""; export const ALCHEMY_KEY = process.env.ALCHEMY_KEY || ""; export const TENDERLY_FORK_ID = process.env.TENDERLY_FORK_ID || ""; export const FORK = (process.env.FORK || "") as eNetwork; export const FORK_BLOCK_NUMBER = process.env.FORK_BLOCK_NUMBER ? parseInt(process.env.FORK_BLOCK_NUMBER) : 0; const MNEMONIC_PATH = "m/44'/60'/0'/0"; const MNEMONIC = process.env.MNEMONIC || "";

export const getAlchemyKey = (net: eNetwork) => { switch (net) { case eEthereumNetwork.kovan: return process.env.KOVAN_ALCHEMY_KEY || ALCHEMY_KEY; case eEthereumNetwork.main: return process.env.MAIN_ALCHEMY_KEY || ALCHEMY_KEY; case eOptimismNetwork.main: return process.env.OPTIMISM_ALCHEMY_KEY || ALCHEMY_KEY; case eOptimismNetwork.testnet: return process.env.KOVAN_OPTIMISM_ALCHEMY_KEY || ALCHEMY_KEY; case eEthereumNetwork.rinkeby: return process.env.RINKEBY_ALCHEMY_KEY || ALCHEMY_KEY; case ePolygonNetwork.mumbai: return process.env.POLYGON_MUMBAI_ALCHEMY_KEY || ALCHEMY_KEY; case ePolygonNetwork.polygon: return process.env.POLYGON_ALCHEMY_KEY || ALCHEMY_KEY; case eEthereumNetwork.goerli: return process.env.GOERLI_ALCHEMY_KEY || ALCHEMY_KEY; case eEthereumNetwork.sepolia: return process.env.SEPOLIA_ALCHEMY_KEY || ALCHEMY_KEY; default: return ALCHEMY_KEY; } };

export const NETWORKS_RPC_URL: iParamsPerNetwork = {

eEthereumNetwork.kovan

)}`,

eEthereumNetwork.main

)}`,

ePolygonNetwork.mumbai

)}`,

ePolygonNetwork.polygon

)}`,

eEthereumNetwork.rinkeby

)}`,

eEthereumNetwork.ropsten

)}`,

tenderly: https://rpc.tenderly.co/fork/${TENDERLY_FORK_ID},

eEthereumNetwork.goerli

)}`,

eEthereumNetwork.sepolia

)}`,

};

export const LIVE_NETWORKS: iParamsPerNetwork = {

};

const GAS_PRICE_PER_NET: iParamsPerNetwork<string | number> = {

};

export const buildForkConfig = (): | HardhatNetworkForkingUserConfig | undefined => { let forkMode: HardhatNetworkForkingUserConfig | undefined; if (FORK && NETWORKS_RPC_URL[FORK]) { forkMode = { url: NETWORKS_RPC_URL[FORK] as string, }; if (FORK_BLOCK_NUMBER) { forkMode.blockNumber = FORK_BLOCK_NUMBER; } } return forkMode; };

export const loadTasks = (taskFolders: string[]): void => taskFolders.forEach((folder) => { const tasksPath = path.join(__dirname, "../tasks", folder); fs.readdirSync(tasksPath) .filter((pth) => pth.includes(".ts") || pth.includes(".js")) .forEach((task) => { require(${tasksPath}/${task}); }); });

export const getCommonNetworkConfig = ( networkName: eNetwork, chainId?: number ) => ({ url: NETWORKS_RPC_URL[networkName] || "", blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT, chainId, gasPrice: GAS_PRICE_PER_NET[networkName] || undefined, ...((!!MNEMONICS[networkName] || !!MNEMONIC) && { accounts: { mnemonic: MNEMONICS[networkName] || MNEMONIC, path: MNEMONIC_PATH, initialIndex: 0, count: 10, }, }), live: LIVE_NETWORKS[networkName] || false, });

const MNEMONICS: iParamsPerNetwork = {

};

export const hardhatNetworkSettings = { gasPrice: "auto", initialBaseFeePerGas: "0", blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT, throwOnTransactionFailures: true, throwOnCallFailures: true, chainId: 1337, forking: buildForkConfig(), saveDeployments: true, allowUnlimitedContractSize: true, tags: ["local"], accounts: FORK && !!MNEMONIC ? { mnemonic: MNEMONIC, path: MNEMONIC_PATH, initialIndex: 0, count: 10, } : undefined, };

export const DETERMINISTIC_FACTORIES = { "1": { funding: "2500000000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a5808505d21dba00830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf325a0efde12f74fb41030a44b3fd8df0f454770dfb43f6662ade8d2cfff27d33b7583a06d9897209d00096273b45caf45fd2b5f810f9532d6725833d7eeb330d906cee5", }, "10": { funding: "100000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a380830f4240830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf337a06b48dc85053031af9928fefeb04df16535baf75bf329dcde39b0626de9334891a0319974b3e9f246138213887ffbdf06fa5e6210696055cafe7f4e2811d9850ad8", }, "137": { funding: "7000000000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a78085104c533c00830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3820135a0b930ddeea99c27453b75662cc1d0ca48024d3ba2f430b0bb2a072b41c6e9be18a01983c4ca8005197daa1664cc2111267e1c2898ec830055f0c8031b669beabb75", }, "250": { funding: "150000000000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a88086015d3ef79800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3820217a0ca245f126ca3c4052a76c4a562d96f5290bfbe07dc110d1a072907bada8cda17a014a9d1fa421f5f7d4c51c01f11538a2dd641fa48dbb2b1eb3ca11a446a990c1e", }, "31337": { funding: "100000000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a680843b9aca00830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf382f4f6a0a306cd60a84b884af0d1040e7f00e694fba8e3d250d978422b8a3dccd40886b1a03a35469d022c4612457e7dc583cbaf698aa82d2e624e43e51deb2a3cb4612df1", }, "42161": { funding: "1000000000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a780843b9aca00830f42408080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf383014986a0a5e077f50f504d7f7b0770794dcab9f6cc0aac35923e612029b635d64b4d1d11a06e3b5b0e20f0b1478d53c7e9cb961787d4ca96a9d1b973c9b8424163c2ba66b9", }, "43114": { funding: "3500000000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a880850826299e00830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3830150f8a02fb12e72c3e25d707bc13df978921914d1e603da746d9251d65fa6e7457b15aaa06993c43ab3f581882dc5849489f6232c40c47210320e31f54263989f9e6ab180", }, "1666600000": { funding: "3000000000000000", deployer: "0xAE0b890a625A87C23A1fccDEFb4C26A798719f17", factory: "0x2401ae9bBeF67458362710f90302Eb52b5Ce835a", signedTx: "0xf8a9808506fc23ac00830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf384c6ac98a3a04ccc5a1ad667b68cdf1b43b3a5b82a25df1a4ac3c8fbac09950f888174c422bda0746ee83b93a6d1663b17829e4b817e92108985d0f58f781bcda7acdbe7b6b079", }, };

export const DETERMINISTIC_DEPLOYMENT = process.env.DETERMINISTIC_DEPLOYMENT ? process.env.DETERMINISTIC_DEPLOYMENT === "true" : null;

export const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY || "";

miguelmtzinf commented 8 months ago

@jkrcmar It's hard to asses what issue you are facing based on these details. Could you please provide steps to reproduce the error?