diff --git a/scripts/config.ts b/scripts/config.ts index 2dca82c8..51444ea2 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -244,7 +244,7 @@ export const pools: Pool[] = [ version: 3, additionalAddresses: { WETH_GATEWAY: "0x1DcDA4de2Bf6c7AD9a34788D22aE6b7d55016e1f", - SWAP_COLLATERAL_ADAPTER: "0xe387c6053ce8ec9f8c3fa5ce085af73114a695d3", + SWAP_COLLATERAL_ADAPTER: "0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3", REPAY_WITH_COLLATERAL_ADAPTER: "0x1408401B2A7E28cB747b3e258D0831Fc926bAC51", }, @@ -289,6 +289,23 @@ export const pools: Pool[] = [ FAUCET: "0xC52eA1F19C22E5a3725105BC0cf4988614e84D98", }, }, + { + name: "AaveV3Ethereum", + chainId: ChainId.mainnet, + addressProvider: "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e", + version: 3, + additionalAddresses: { + WETH_GATEWAY: "0x694d4cFdaeE639239df949b6E24Ff8576A00d1f2", + EMISSION_MANAGER: "0xcAA448c8066f741C3137cEa9758dF3fB377CBF4E", + COLLECTOR_CONTROLLER: "0x3d569673dAa0575c936c7c67c4E6AedA69CC630C", + COLLECTOR: "0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c", + DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1: "0x801934c604aBA0C8C46454c67F88A4a45a766a91", + DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1: "0x2688a209086Ae56e7b3598Ec68A0Cba3B965CD06", + DEFAULT_A_TOKEN_IMPL_REV_1: "0xca21517bac12053E7fD6C326EDF89C5cc60d813f", + DEFAULT_INCENTIVES_CONTROLLER: "0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb" + + }, + }, ].map((m) => ({ ...m, // fix checksum diff --git a/scripts/generator_v2.ts b/scripts/generator_v2.ts index 8bae1543..8693cc86 100644 --- a/scripts/generator_v2.ts +++ b/scripts/generator_v2.ts @@ -6,7 +6,7 @@ import lendingPoolV2ABI from "./abi/lending_pool_v2_abi.json"; import aTokenV2ABI from "./abi/aToken_v2_abi.json"; import collectorV2ABI from "./abi/collector_v2_abi.json"; import prettier from "prettier"; -import { generateAdditionalAddresses } from "./helpers"; +import {generateAdditionalAddresses, generateAdditionalAddressesSol} from "./helpers"; export interface PoolV2WithAddresses extends Pool { lendingPool: string; @@ -106,6 +106,9 @@ export async function generatePoolV2(pool: Pool): Promise { address internal constant COLLECTOR = ${collector}; address internal constant COLLECTOR_CONTROLLER = ${collectorController}; + + ${generateAdditionalAddressesSol(pool)} + }\r\n`; fs.writeFileSync( `./src/${pool.name}.sol`, diff --git a/scripts/generator_v3.ts b/scripts/generator_v3.ts index 2e6cb0ef..5c5fe2ef 100644 --- a/scripts/generator_v3.ts +++ b/scripts/generator_v3.ts @@ -11,7 +11,7 @@ import rewardsControllerABI from "./abi/rewardsController_v3_abi.json"; import prettier from "prettier"; import { bytes32toAddress, - generateAdditionalAddresses, + generateAdditionalAddresses, generateAdditionalAddressesSol, getImplementationStorageSlot, sleep, } from "./helpers"; @@ -51,80 +51,84 @@ export async function generatePoolV3(pool: Pool): Promise { pool.provider ); const reserves: string[] = await lendingPoolContract.getReservesList(); - const data = await lendingPoolContract.getReserveData(reserves[0]); - - /** - * While the reserve treasury address is per token in most cases it will be the same address, so for the sake of the address-book we assume it always is. - */ - const aTokenContract = new ethers.Contract( - data.aTokenAddress, - aTokenV3ABI, - pool.provider - ); + if (reserves.length > 0) { + const data = await lendingPoolContract.getReserveData(reserves[0]); + + /** + * While the reserve treasury address is per token in most cases it will be the same address, so for the sake of the address-book we assume it always is. + */ + const aTokenContract = new ethers.Contract( + data.aTokenAddress, + aTokenV3ABI, + pool.provider + ); - const collector = await aTokenContract.RESERVE_TREASURY_ADDRESS(); + const collector = await aTokenContract.RESERVE_TREASURY_ADDRESS(); - const defaultIncentivesController = - await aTokenContract.getIncentivesController(); + const defaultIncentivesController = + await aTokenContract.getIncentivesController(); - const defaultATokenImplementation = bytes32toAddress( - await getImplementationStorageSlot(pool.provider, data.aTokenAddress) - ); - - const aTokenRevision = await aTokenContract.ATOKEN_REVISION(); + const defaultATokenImplementation = bytes32toAddress( + await getImplementationStorageSlot(pool.provider, data.aTokenAddress) + ); - await sleep(1000); + const aTokenRevision = await aTokenContract.ATOKEN_REVISION(); - const defaultVariableDebtTokenImplementation = bytes32toAddress( - await getImplementationStorageSlot( - pool.provider, - data.variableDebtTokenAddress - ) - ); + await sleep(1000); - const variableDebtTokenRevision = await new ethers.Contract( - data.variableDebtTokenAddress, - variableDebtTokenV3ABI, - pool.provider - ).DEBT_TOKEN_REVISION(); + const defaultVariableDebtTokenImplementation = bytes32toAddress( + await getImplementationStorageSlot( + pool.provider, + data.variableDebtTokenAddress + ) + ); - const defaultStableDebtTokenImplementation = bytes32toAddress( - await getImplementationStorageSlot( - pool.provider, - data.stableDebtTokenAddress - ) - ); + const variableDebtTokenRevision = await new ethers.Contract( + data.variableDebtTokenAddress, + variableDebtTokenV3ABI, + pool.provider + ).DEBT_TOKEN_REVISION(); - const stableDebtTokenRevision = await new ethers.Contract( - data.stableDebtTokenAddress, - stableDebtTokenV3ABI, - pool.provider - ).DEBT_TOKEN_REVISION(); + const defaultStableDebtTokenImplementation = bytes32toAddress( + await getImplementationStorageSlot( + pool.provider, + data.stableDebtTokenAddress + ) + ); - const collectorContract = new ethers.Contract( - collector, - collectorV3ABI, - pool.provider - ); + const stableDebtTokenRevision = await new ethers.Contract( + data.stableDebtTokenAddress, + stableDebtTokenV3ABI, + pool.provider + ).DEBT_TOKEN_REVISION(); - let emissionManager = "0x0000000000000000000000000000000000000000"; - try { - const incentivesControllerContract = await new ethers.Contract( - defaultIncentivesController, - rewardsControllerABI, + const collectorContract = new ethers.Contract( + collector, + collectorV3ABI, pool.provider ); - emissionManager = await incentivesControllerContract.getEmissionManager(); - } catch (e) { - console.log( - `old version of incentives controller deployed on ${pool.name}` - ); - } - const collectorController = await collectorContract.getFundsAdmin(); - console.timeEnd(pool.name); + let emissionManager = "0x0000000000000000000000000000000000000000"; + try { + const incentivesControllerContract = await new ethers.Contract( + defaultIncentivesController, + rewardsControllerABI, + pool.provider + ); + emissionManager = await incentivesControllerContract.getEmissionManager(); + } catch (e) { + console.log( + `old version of incentives controller deployed on ${pool.name}` + ); + } + + const collectorController = await collectorContract.getFundsAdmin(); + + + console.timeEnd(pool.name); - const templateV3 = `// SPDX-License-Identifier: MIT + + const templateV3 = `// SPDX-License-Identifier: MIT // AUTOGENERATED - DON'T MANUALLY CHANGE pragma solidity >=0.6.0; @@ -164,13 +168,16 @@ export async function generatePoolV3(pool: Pool): Promise { address internal constant DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_${stableDebtTokenRevision} = ${defaultStableDebtTokenImplementation}; address internal constant EMISSION_MANAGER = ${emissionManager}; + + ${generateAdditionalAddressesSol(pool)} + }\r\n`; - fs.writeFileSync( - `./src/${pool.name}.sol`, - prettier.format(templateV3, { filepath: `./src/${pool.name}.sol` }) - ); + fs.writeFileSync( + `./src/${pool.name}.sol`, + prettier.format(templateV3, {filepath: `./src/${pool.name}.sol`}) + ); - const templateV3Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE + const templateV3Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE export const POOL_ADDRESSES_PROVIDER = "${addressProvider}"; export const POOL = "${poolAddress}"; export const POOL_CONFIGURATOR = "${poolConfigurator}"; @@ -187,24 +194,91 @@ export const DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_${stableDebtTokenRevision} = "${ export const CHAIN_ID = ${pool.chainId}; export const EMISSION_MANAGER = "${emissionManager}"; ${generateAdditionalAddresses(pool)}`; - fs.writeFileSync( - `./src/ts/${pool.name}.ts`, - prettier.format(templateV3Js, { - filepath: `./src/ts/${pool.name}.ts`, - }) - ); + fs.writeFileSync( + `./src/ts/${pool.name}.ts`, + prettier.format(templateV3Js, { + filepath: `./src/ts/${pool.name}.ts`, + }) + ); + + return { + pool: poolAddress, + poolConfigurator, + oracle, + aclAdmin, + aclManager, + poolDataProvider, + collectorController, + collector, + ...pool, + }; + } else { + console.timeEnd(pool.name); + + const templateV3 = `// SPDX-License-Identifier: MIT + // AUTOGENERATED - DON'T MANUALLY CHANGE + pragma solidity >=0.6.0; + + import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; + + library ${pool.name} { + IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = + IPoolAddressesProvider( + ${addressProvider} + ); + + IPool internal constant POOL = + IPool(${poolAddress}); + + IPoolConfigurator internal constant POOL_CONFIGURATOR = + IPoolConfigurator(${poolConfigurator}); + + IAaveOracle internal constant ORACLE = + IAaveOracle(${oracle}); + + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = IPoolDataProvider(${poolDataProvider}); + + IACLManager internal constant ACL_MANAGER = IACLManager(${aclManager}); - return { - pool: poolAddress, - poolConfigurator, - oracle, - aclAdmin, - aclManager, - poolDataProvider, - collectorController, - collector, - ...pool, - }; + address internal constant ACL_ADMIN = ${aclAdmin}; + + ${generateAdditionalAddressesSol(pool)} + + }\r\n`; + fs.writeFileSync( + `./src/${pool.name}.sol`, + prettier.format(templateV3, {filepath: `./src/${pool.name}.sol`}) + ); + + const templateV3Js = `// AUTOGENERATED - DON'T MANUALLY CHANGE +export const POOL_ADDRESSES_PROVIDER = "${addressProvider}"; +export const POOL = "${poolAddress}"; +export const POOL_CONFIGURATOR = "${poolConfigurator}"; +export const ORACLE = "${oracle}"; +export const AAVE_PROTOCOL_DATA_PROVIDER = "${poolDataProvider}"; +export const ACL_MANAGER = "${aclManager}"; +export const ACL_ADMIN = "${aclAdmin}"; +export const CHAIN_ID = ${pool.chainId}; +${generateAdditionalAddresses(pool)}`; + fs.writeFileSync( + `./src/ts/${pool.name}.ts`, + prettier.format(templateV3Js, { + filepath: `./src/ts/${pool.name}.ts`, + }) + ); + + return { + pool: poolAddress, + poolConfigurator, + oracle, + aclAdmin, + aclManager, + poolDataProvider, + collectorController: '', + collector: '', + ...pool, + }; + } } catch (error: any) { throw new Error( JSON.stringify({ message: error.message, pool, stack: error.stack }) diff --git a/scripts/helpers.ts b/scripts/helpers.ts index 60ea46ac..c3287a23 100644 --- a/scripts/helpers.ts +++ b/scripts/helpers.ts @@ -27,6 +27,18 @@ export const generateAdditionalAddresses = (pool: Pool): string => { return ""; }; +export const generateAdditionalAddressesSol = (pool: Pool): string => { + if (pool.additionalAddresses) { + return Object.keys(pool.additionalAddresses).reduce((acc, key) => { + acc += `address internal constant ${key} = ${ + pool.additionalAddresses![key as keyof typeof pool.additionalAddresses] + };\r\n`; + return acc; + }, ""); + } + return ""; +}; + export async function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); } diff --git a/src/AaveAddressBook.sol b/src/AaveAddressBook.sol index 05c40398..2829e637 100644 --- a/src/AaveAddressBook.sol +++ b/src/AaveAddressBook.sol @@ -21,6 +21,7 @@ import {AaveV3Fantom} from "./AaveV3Fantom.sol"; import {AaveV3Harmony} from "./AaveV3Harmony.sol"; import {AaveV3Optimism} from "./AaveV3Optimism.sol"; import {AaveV3OptimismGoerli} from "./AaveV3OptimismGoerli.sol"; +import {AaveV3Ethereum} from "./AaveV3Ethereum.sol"; import {AaveGovernanceV2, IGovernanceStrategy} from "./AaveGovernanceV2.sol"; import {IAaveEcosystemReserveController, AaveMisc} from "./AaveMisc.sol"; diff --git a/src/AaveV2Avalanche.sol b/src/AaveV2Avalanche.sol index 87782efd..fee85d5c 100644 --- a/src/AaveV2Avalanche.sol +++ b/src/AaveV2Avalanche.sol @@ -32,4 +32,11 @@ library AaveV2Avalanche { 0x467b92aF281d14cB6809913AD016a607b5ba8A36; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0xC27d4dBefc2C0CE57916a699971b58a3BD9C7d5b; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x2EcF2a2e74B19Aab2a62312167aFF4B78E93B6C5; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x935b362EE3E1f342cc48118C528AAbee5118F6e6; } diff --git a/src/AaveV2Ethereum.sol b/src/AaveV2Ethereum.sol index a43d918a..64f82067 100644 --- a/src/AaveV2Ethereum.sol +++ b/src/AaveV2Ethereum.sol @@ -33,4 +33,11 @@ library AaveV2Ethereum { address internal constant COLLECTOR_CONTROLLER = 0x3d569673dAa0575c936c7c67c4E6AedA69CC630C; + + address internal constant WETH_GATEWAY = + 0xEFFC18fC3b7eb8E676dac549E0c693ad50D1Ce31; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x80Aca0C645fEdABaa20fd2Bf0Daf57885A309FE6; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x135896DE8421be2ec868E0b811006171D9df802A; } diff --git a/src/AaveV2EthereumAMM.sol b/src/AaveV2EthereumAMM.sol index fcf3733c..a625c6a1 100644 --- a/src/AaveV2EthereumAMM.sol +++ b/src/AaveV2EthereumAMM.sol @@ -33,4 +33,11 @@ library AaveV2EthereumAMM { address internal constant COLLECTOR_CONTROLLER = 0x3d569673dAa0575c936c7c67c4E6AedA69CC630C; + + address internal constant WETH_GATEWAY = + 0x1C4a4e31231F71Fc34867D034a9E68f6fC798249; + address internal constant WALLET_BALANCE_PROVIDER = + 0x8E8dAd5409E0263a51C0aB5055dA66Be28cFF922; + address internal constant UI_POOL_DATA_PROVIDER = + 0x30375522F67a6308630d49A694ca1491fA2D3BC6; } diff --git a/src/AaveV2Fuji.sol b/src/AaveV2Fuji.sol index 95f2b39d..2e361800 100644 --- a/src/AaveV2Fuji.sol +++ b/src/AaveV2Fuji.sol @@ -32,4 +32,9 @@ library AaveV2Fuji { 0xB45F5C501A22288dfdb897e5f73E189597e09288; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0x1648C14DbB6ccdd5846969cE23DeEC4C66a03335; + address internal constant FAUCET = + 0x90E5BAc5A98fff59617080848959f44eACB4Cd7B; } diff --git a/src/AaveV2Goerli.sol b/src/AaveV2Goerli.sol index 06029bfa..da83a64e 100644 --- a/src/AaveV2Goerli.sol +++ b/src/AaveV2Goerli.sol @@ -32,4 +32,9 @@ library AaveV2Goerli { 0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0x3bd3a20Ac9Ff1dda1D99C0dFCE6D65C4960B3627; + address internal constant FAUCET = + 0x681860075529352da2C94082Eb66c59dF958e89C; } diff --git a/src/AaveV2Mumbai.sol b/src/AaveV2Mumbai.sol index 4cc6c46c..512535d3 100644 --- a/src/AaveV2Mumbai.sol +++ b/src/AaveV2Mumbai.sol @@ -32,4 +32,9 @@ library AaveV2Mumbai { 0x943E44157dC0302a5CEb172374d1749018a00994; address internal constant COLLECTOR_CONTROLLER = address(0); + + address internal constant WETH_GATEWAY = + 0xee9eE614Ad26963bEc1Bec0D2c92879ae1F209fA; + address internal constant FAUCET = + 0x0b3C23243106A69449e79C14c58BB49E358f9B10; } diff --git a/src/AaveV2Polygon.sol b/src/AaveV2Polygon.sol index e88bae77..73c46101 100644 --- a/src/AaveV2Polygon.sol +++ b/src/AaveV2Polygon.sol @@ -33,4 +33,11 @@ library AaveV2Polygon { address internal constant COLLECTOR_CONTROLLER = 0xDB89487A449274478e984665b8692AfC67459deF; + + address internal constant WETH_GATEWAY = + 0xAeBF56223F044a73A513FAD7E148A9075227eD9b; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x35784a624D4FfBC3594f4d16fA3801FeF063241c; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0xE84cF064a0a65290Ae5673b500699f3753063936; } diff --git a/src/AaveV3Arbitrum.sol b/src/AaveV3Arbitrum.sol index 682faf3f..e566b355 100644 --- a/src/AaveV3Arbitrum.sol +++ b/src/AaveV3Arbitrum.sol @@ -46,4 +46,11 @@ library AaveV3Arbitrum { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0xB5Ee21786D28c5Ba61661550879475976B707099; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xAE9f94BD98eC2831a1330e0418bE0fDb5C95C2B9; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x32FdC26aFFA1eB331263Bcdd59F2e46eCbCC2E24; } diff --git a/src/AaveV3ArbitrumGoerli.sol b/src/AaveV3ArbitrumGoerli.sol index 52f20333..cc25600d 100644 --- a/src/AaveV3ArbitrumGoerli.sol +++ b/src/AaveV3ArbitrumGoerli.sol @@ -46,4 +46,9 @@ library AaveV3ArbitrumGoerli { address internal constant EMISSION_MANAGER = 0xb023e699F5a33916Ea823A16485e259257cA8Bd1; + + address internal constant WETH_GATEWAY = + 0xBCca2fc5F30A65cE2155d739364f3fc8F57E6999; + address internal constant FAUCET = + 0x98256500C9f1CE77e4C925b7bbF1588515E34422; } diff --git a/src/AaveV3Avalanche.sol b/src/AaveV3Avalanche.sol index 4ca52401..8a08c08b 100644 --- a/src/AaveV3Avalanche.sol +++ b/src/AaveV3Avalanche.sol @@ -46,4 +46,11 @@ library AaveV3Avalanche { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x6F143FE2F7B02424ad3CaD1593D6f36c0Aab69d7; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x8a743090e9759E758d15a4CFd18408fb6332c625; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xF7fC20D9D1D8DFE55F5F2c3180272a5747dD327F; } diff --git a/src/AaveV3Ethereum.sol b/src/AaveV3Ethereum.sol new file mode 100644 index 00000000..1136315c --- /dev/null +++ b/src/AaveV3Ethereum.sol @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: MIT +// AUTOGENERATED - DON'T MANUALLY CHANGE +pragma solidity >=0.6.0; + +import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager, ICollector} from "./AaveV3.sol"; + +library AaveV3Ethereum { + IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = + IPoolAddressesProvider(0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e); + + IPool internal constant POOL = + IPool(0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2); + + IPoolConfigurator internal constant POOL_CONFIGURATOR = + IPoolConfigurator(0x64b761D848206f447Fe2dd461b0c635Ec39EbB27); + + IAaveOracle internal constant ORACLE = + IAaveOracle(0x54586bE62E3c3580375aE3723C145253060Ca0C2); + + IPoolDataProvider internal constant AAVE_PROTOCOL_DATA_PROVIDER = + IPoolDataProvider(0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3); + + IACLManager internal constant ACL_MANAGER = + IACLManager(0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0); + + address internal constant ACL_ADMIN = + 0xEE56e2B3D491590B5b31738cC34d5232F378a8D5; + + address internal constant WETH_GATEWAY = + 0x694d4cFdaeE639239df949b6E24Ff8576A00d1f2; + address internal constant EMISSION_MANAGER = + 0xcAA448c8066f741C3137cEa9758dF3fB377CBF4E; + address internal constant COLLECTOR_CONTROLLER = + 0x3d569673dAa0575c936c7c67c4E6AedA69CC630C; + address internal constant COLLECTOR = + 0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c; + address internal constant DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1 = + 0x801934c604aBA0C8C46454c67F88A4a45a766a91; + address internal constant DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1 = + 0x2688a209086Ae56e7b3598Ec68A0Cba3B965CD06; + address internal constant DEFAULT_A_TOKEN_IMPL_REV_1 = + 0xca21517bac12053E7fD6C326EDF89C5cc60d813f; + address internal constant DEFAULT_INCENTIVES_CONTROLLER = + 0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb; +} diff --git a/src/AaveV3Fantom.sol b/src/AaveV3Fantom.sol index d7d8b28c..dc0d2c1d 100644 --- a/src/AaveV3Fantom.sol +++ b/src/AaveV3Fantom.sol @@ -46,4 +46,11 @@ library AaveV3Fantom { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x1DcDA4de2Bf6c7AD9a34788D22aE6b7d55016e1f; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x1408401B2A7E28cB747b3e258D0831Fc926bAC51; } diff --git a/src/AaveV3FantomTestnet.sol b/src/AaveV3FantomTestnet.sol index 77338257..67c442f5 100644 --- a/src/AaveV3FantomTestnet.sol +++ b/src/AaveV3FantomTestnet.sol @@ -46,4 +46,9 @@ library AaveV3FantomTestnet { address internal constant EMISSION_MANAGER = 0x0000000000000000000000000000000000000000; + + address internal constant WETH_GATEWAY = + 0x87770f04Bbece8092d777860907798138825f303; + address internal constant FAUCET = + 0x02D538e56A729C535F83b2DA20Ddf9AD7281FE6c; } diff --git a/src/AaveV3Fuji.sol b/src/AaveV3Fuji.sol index b8b5b050..9b10bc18 100644 --- a/src/AaveV3Fuji.sol +++ b/src/AaveV3Fuji.sol @@ -46,4 +46,9 @@ library AaveV3Fuji { address internal constant EMISSION_MANAGER = 0x0000000000000000000000000000000000000000; + + address internal constant WETH_GATEWAY = + 0x8f57153F18b7273f9A814b93b31Cb3f9b035e7C2; + address internal constant FAUCET = + 0x127277bF2F5fA186bfC6b3a0ca00baefB5472d3a; } diff --git a/src/AaveV3Goerli.sol b/src/AaveV3Goerli.sol index 4ee0f0d9..f0f1bb1b 100644 --- a/src/AaveV3Goerli.sol +++ b/src/AaveV3Goerli.sol @@ -46,4 +46,9 @@ library AaveV3Goerli { address internal constant EMISSION_MANAGER = 0xefF40A6d9De203A8806F4F62D86d5C4c5856965E; + + address internal constant WETH_GATEWAY = + 0xd5B55D3Ed89FDa19124ceB5baB620328287b915d; + address internal constant FAUCET = + 0x1ca525Cd5Cb77DB5Fa9cBbA02A0824e283469DBe; } diff --git a/src/AaveV3Harmony.sol b/src/AaveV3Harmony.sol index 6892139b..e8f68cb4 100644 --- a/src/AaveV3Harmony.sol +++ b/src/AaveV3Harmony.sol @@ -46,4 +46,7 @@ library AaveV3Harmony { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3; } diff --git a/src/AaveV3Mumbai.sol b/src/AaveV3Mumbai.sol index 43efc504..f769c4e5 100644 --- a/src/AaveV3Mumbai.sol +++ b/src/AaveV3Mumbai.sol @@ -46,4 +46,9 @@ library AaveV3Mumbai { address internal constant EMISSION_MANAGER = 0x0000000000000000000000000000000000000000; + + address internal constant WETH_GATEWAY = + 0x2a58E9bbb5434FdA7FF78051a4B82cb0EF669C17; + address internal constant FAUCET = + 0xc1eB89DA925cc2Ae8B36818d26E12DDF8F8601b0; } diff --git a/src/AaveV3Optimism.sol b/src/AaveV3Optimism.sol index 62fe6c51..4ae7a0f1 100644 --- a/src/AaveV3Optimism.sol +++ b/src/AaveV3Optimism.sol @@ -46,4 +46,11 @@ library AaveV3Optimism { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x76D3030728e52DEB8848d5613aBaDE88441cbc59; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0xC7524B08101dBe695d7ad671a332760b5d967Cbd; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0x70371a494f73A8Df658C5cd29E2C1601787e1009; } diff --git a/src/AaveV3OptimismGoerli.sol b/src/AaveV3OptimismGoerli.sol index 1dc8da3b..9d73814f 100644 --- a/src/AaveV3OptimismGoerli.sol +++ b/src/AaveV3OptimismGoerli.sol @@ -46,4 +46,9 @@ library AaveV3OptimismGoerli { address internal constant EMISSION_MANAGER = 0x46382F2A0E5BF6cbBa72821DFfe3b1CB9630C6E6; + + address internal constant WETH_GATEWAY = + 0x6f7f2440006221F893c587b88f01afc42B6F8d2e; + address internal constant FAUCET = + 0xC52eA1F19C22E5a3725105BC0cf4988614e84D98; } diff --git a/src/AaveV3Polygon.sol b/src/AaveV3Polygon.sol index b51e346b..163d67d2 100644 --- a/src/AaveV3Polygon.sol +++ b/src/AaveV3Polygon.sol @@ -46,4 +46,11 @@ library AaveV3Polygon { address internal constant EMISSION_MANAGER = 0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73; + + address internal constant WETH_GATEWAY = + 0x1e4b7A6b903680eab0c5dAbcb8fD429cD2a9598c; + address internal constant REPAY_WITH_COLLATERAL_ADAPTER = + 0xA125561fca253f19eA93970534Bb0364ea74187a; + address internal constant SWAP_COLLATERAL_ADAPTER = + 0x301F221bc732907E2da2dbBFaA8F8F6847c170c3; } diff --git a/src/ts/AaveAddressBook.ts b/src/ts/AaveAddressBook.ts index 41c1df53..fccc6813 100644 --- a/src/ts/AaveAddressBook.ts +++ b/src/ts/AaveAddressBook.ts @@ -21,3 +21,4 @@ export * as AaveV3Fantom from "./AaveV3Fantom"; export * as AaveV3Harmony from "./AaveV3Harmony"; export * as AaveV3Optimism from "./AaveV3Optimism"; export * as AaveV3OptimismGoerli from "./AaveV3OptimismGoerli"; +export * as AaveV3Ethereum from "./AaveV3Ethereum"; diff --git a/src/ts/AaveV3Ethereum.ts b/src/ts/AaveV3Ethereum.ts new file mode 100644 index 00000000..3d59855d --- /dev/null +++ b/src/ts/AaveV3Ethereum.ts @@ -0,0 +1,24 @@ +// AUTOGENERATED - DON'T MANUALLY CHANGE +export const POOL_ADDRESSES_PROVIDER = + "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e"; +export const POOL = "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2"; +export const POOL_CONFIGURATOR = "0x64b761D848206f447Fe2dd461b0c635Ec39EbB27"; +export const ORACLE = "0x54586bE62E3c3580375aE3723C145253060Ca0C2"; +export const AAVE_PROTOCOL_DATA_PROVIDER = + "0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3"; +export const ACL_MANAGER = "0xc2aaCf6553D20d1e9d78E365AAba8032af9c85b0"; +export const ACL_ADMIN = "0xEE56e2B3D491590B5b31738cC34d5232F378a8D5"; +export const CHAIN_ID = 1; +export const WETH_GATEWAY = "0x694d4cFdaeE639239df949b6E24Ff8576A00d1f2"; +export const EMISSION_MANAGER = "0xcAA448c8066f741C3137cEa9758dF3fB377CBF4E"; +export const COLLECTOR_CONTROLLER = + "0x3d569673dAa0575c936c7c67c4E6AedA69CC630C"; +export const COLLECTOR = "0x464C71f6c2F760DdA6093dCB91C24c39e5d6e18c"; +export const DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1 = + "0x801934c604aBA0C8C46454c67F88A4a45a766a91"; +export const DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1 = + "0x2688a209086Ae56e7b3598Ec68A0Cba3B965CD06"; +export const DEFAULT_A_TOKEN_IMPL_REV_1 = + "0xca21517bac12053E7fD6C326EDF89C5cc60d813f"; +export const DEFAULT_INCENTIVES_CONTROLLER = + "0x8164Cc65827dcFe994AB23944CBC90e0aa80bFcb"; diff --git a/src/ts/AaveV3Fantom.ts b/src/ts/AaveV3Fantom.ts index 297f31dc..b0faf698 100644 --- a/src/ts/AaveV3Fantom.ts +++ b/src/ts/AaveV3Fantom.ts @@ -23,6 +23,6 @@ export const CHAIN_ID = 250; export const EMISSION_MANAGER = "0x048f2228D7Bf6776f99aB50cB1b1eaB4D1d4cA73"; export const WETH_GATEWAY = "0x1DcDA4de2Bf6c7AD9a34788D22aE6b7d55016e1f"; export const SWAP_COLLATERAL_ADAPTER = - "0xe387c6053ce8ec9f8c3fa5ce085af73114a695d3"; + "0xE387c6053CE8EC9f8C3fa5cE085Af73114a695d3"; export const REPAY_WITH_COLLATERAL_ADAPTER = "0x1408401B2A7E28cB747b3e258D0831Fc926bAC51";