-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move network addresses to the hardhat config file and add optimism ne…
…twork config
- Loading branch information
Showing
7 changed files
with
104 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules"); | ||
const { network, config } = require("hardhat"); | ||
|
||
let maticConfig = { | ||
lendingPoolAddressesProvider: "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb", | ||
//uniswap | ||
uniswapRouterAddress: "0xE592427A0AEce92De3Edee1F18E0157C05861564" | ||
const networkAddressMapping = config.networkAddressMapping; | ||
|
||
// check addressMapping has the network | ||
if (!networkAddressMapping[network.name]) { | ||
throw new Error('network ' + network.name + ' dont config in the addressMapping, please add it'); | ||
} | ||
|
||
let contractParams = maticConfig; | ||
const { | ||
lendingPoolAddressesProviderAddress, | ||
uniswapRouterAddress | ||
} = networkAddressMapping[network.name]; | ||
|
||
module.exports = buildModule("AaveApe", (m) => { | ||
const lendingPoolAddressesProviderAddress = m.getParameter("lendingPoolAddressesProvider", contractParams.lendingPoolAddressesProvider); | ||
const uniswapRouterAddress = m.getParameter("uniswapRouterAddress", contractParams.uniswapRouterAddress); | ||
|
||
const aaveApe = m.contract("AaveApe", [lendingPoolAddressesProviderAddress, uniswapRouterAddress]); | ||
return { aaveApe }; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters