From 437be00b9258da4e349317374839a2e2d94e1c18 Mon Sep 17 00:00:00 2001 From: speedx <807088414@qq.com> Date: Thu, 18 Apr 2024 10:48:24 +0800 Subject: [PATCH] hardhat ignition create2 config --- basic/21-aave-uni-loan/hardhat.config.js | 12 +++++++++++- basic/21-aave-uni-loan/scripts/query.js | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/basic/21-aave-uni-loan/hardhat.config.js b/basic/21-aave-uni-loan/hardhat.config.js index d2ff3ea45..c4b6a984f 100644 --- a/basic/21-aave-uni-loan/hardhat.config.js +++ b/basic/21-aave-uni-loan/hardhat.config.js @@ -97,6 +97,16 @@ module.exports = { timeout: 80000 }, + ignition: { + strategyConfig: { + create2: { + // To learn more about salts, see the CreateX documentation + // generate via ethers.keccak256(ethers.toUtf8Bytes("dapp-learning")) + salt: "0x262a460790f6b524b7fa041acd8d42a64d405de6fcf470a86d8b706fc6d18dd7", + }, + }, + }, + networkAddressMapping: { matic: { daiAddress: '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063', @@ -118,7 +128,7 @@ module.exports = { wethGatewayAddress: '0xe9E52021f4e11DEAD8661812A0A6c8627abA2a54', aaveApeAddress: '0x4699f609F4FD97A3cf74CB63EFf5cd1200Dfe3dA', }, - mainnet: { + main: { daiAddress: '0x6B175474E89094C44Da98b954EedeAC495271d0F', wmaticAddress: '', wethAddress: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', diff --git a/basic/21-aave-uni-loan/scripts/query.js b/basic/21-aave-uni-loan/scripts/query.js index 79d5127b6..e5983dd7a 100644 --- a/basic/21-aave-uni-loan/scripts/query.js +++ b/basic/21-aave-uni-loan/scripts/query.js @@ -92,7 +92,7 @@ const querySql = ` const url = { matic: 'https://api.thegraph.com/subgraphs/name/aave/protocol-v3-polygon', - mainnet: 'https://api.thegraph.com/subgraphs/name/aave/protocol-v3', + main: 'https://api.thegraph.com/subgraphs/name/aave/protocol-v3', optimism: 'https://api.thegraph.com/subgraphs/name/aave/protocol-v3-optimism' } @@ -231,7 +231,7 @@ main = async () => { 'id': fish }; - let interest = await getInterest(url.matic,querySql,variables) + let interest = await getInterest(url[network.name],querySql,variables) console.log("current total interest: ",interest) };