From fe0e4c0bfb7797434f5a28285be2300d677a06cc Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 2 Dec 2024 12:53:51 +0100 Subject: [PATCH] feat: add avara addresses --- scripts/configs/pools/base.ts | 2 +- src/AaveV3BaseSepolia.sol | 14 +++---- src/ts/AaveV3BaseSepolia.ts | 12 +++--- src/ts/AaveV3Ethereum.ts | 3 +- tests/__snapshots__/verification.spec.ts.snap | 20 --------- tests/cache/verified.json | 12 ++++++ tests/generators/umbrella.spec.ts | 42 +++++++++++++++++++ tests/verification.spec.ts | 3 +- 8 files changed, 72 insertions(+), 36 deletions(-) diff --git a/scripts/configs/pools/base.ts b/scripts/configs/pools/base.ts index 064ca6ba..013a1533 100644 --- a/scripts/configs/pools/base.ts +++ b/scripts/configs/pools/base.ts @@ -38,7 +38,7 @@ export const baseSepoliaProtoV3: PoolConfig = { UI_POOL_DATA_PROVIDER: '0x6a9D64f93DB660EaCB2b6E9424792c630CdA87d8', WALLET_BALANCE_PROVIDER: '0x2c4D1F4EC7F4FfA09a5E1C9e74fD3A10f21Bd811', WETH_GATEWAY: '0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6', - UMBRELLA: '0xb939e96168a3953697B64DA8055570dee8735829', + UMBRELLA: '0x710ebb9F848f725a47F39ce03Bd79Be6340e63dA', }, }; diff --git a/src/AaveV3BaseSepolia.sol b/src/AaveV3BaseSepolia.sol index b34aae60..baf3749d 100644 --- a/src/AaveV3BaseSepolia.sol +++ b/src/AaveV3BaseSepolia.sol @@ -46,12 +46,12 @@ library AaveV3BaseSepolia { // https://sepolia.basescan.org/address/0x6414DE3F58d54Fb90636e8393F065fDFe34Da420 ICollector internal constant COLLECTOR = ICollector(0x6414DE3F58d54Fb90636e8393F065fDFe34Da420); - // https://sepolia.basescan.org/address/0x3012CaC83a1286D0014aA9BB0461b80eb9c8e1b1 - address internal constant DEFAULT_A_TOKEN_IMPL_REV_1 = 0x3012CaC83a1286D0014aA9BB0461b80eb9c8e1b1; + // https://sepolia.basescan.org/address/0xfa3BE9b886fb9E4909040a7AE01eeD47fd96A075 + address internal constant DEFAULT_A_TOKEN_IMPL_REV_2 = 0xfa3BE9b886fb9E4909040a7AE01eeD47fd96A075; - // https://sepolia.basescan.org/address/0x9B928e20ECD8d2bA6444B307F4B5127A41d6e19C - address internal constant DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1 = - 0x9B928e20ECD8d2bA6444B307F4B5127A41d6e19C; + // https://sepolia.basescan.org/address/0x2B218FFE3C1272Da2F95cb0d09Ff346a861E04b7 + address internal constant DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_2 = + 0x2B218FFE3C1272Da2F95cb0d09Ff346a861E04b7; // https://sepolia.basescan.org/address/0x4Afb5ADe7Bd7a670B61f303ab0C740eE8350918f address internal constant STATA_FACTORY = 0x4Afb5ADe7Bd7a670B61f303ab0C740eE8350918f; @@ -78,8 +78,8 @@ library AaveV3BaseSepolia { // https://sepolia.basescan.org/address/0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6 address internal constant WETH_GATEWAY = 0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6; - // https://sepolia.basescan.org/address/0xb939e96168a3953697B64DA8055570dee8735829 - address internal constant UMBRELLA = 0xb939e96168a3953697B64DA8055570dee8735829; + // https://sepolia.basescan.org/address/0x710ebb9F848f725a47F39ce03Bd79Be6340e63dA + address internal constant UMBRELLA = 0x710ebb9F848f725a47F39ce03Bd79Be6340e63dA; } library AaveV3BaseSepoliaAssets { // https://sepolia.basescan.org/address/0xba50Cd2A20f6DA35D788639E581bca8d0B5d4D5f diff --git a/src/ts/AaveV3BaseSepolia.ts b/src/ts/AaveV3BaseSepolia.ts index a105137b..506a04ba 100644 --- a/src/ts/AaveV3BaseSepolia.ts +++ b/src/ts/AaveV3BaseSepolia.ts @@ -35,11 +35,11 @@ export const EMISSION_MANAGER = '0x49ECA4d8e7EaE6a1e7c02516851fF9038b277e96'; // ICollector https://sepolia.basescan.org/address/0x6414DE3F58d54Fb90636e8393F065fDFe34Da420 export const COLLECTOR = '0x6414DE3F58d54Fb90636e8393F065fDFe34Da420'; -// https://sepolia.basescan.org/address/0x3012CaC83a1286D0014aA9BB0461b80eb9c8e1b1 -export const DEFAULT_A_TOKEN_IMPL_REV_1 = '0x3012CaC83a1286D0014aA9BB0461b80eb9c8e1b1'; +// https://sepolia.basescan.org/address/0xfa3BE9b886fb9E4909040a7AE01eeD47fd96A075 +export const DEFAULT_A_TOKEN_IMPL_REV_2 = '0xfa3BE9b886fb9E4909040a7AE01eeD47fd96A075'; -// https://sepolia.basescan.org/address/0x9B928e20ECD8d2bA6444B307F4B5127A41d6e19C -export const DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1 = '0x9B928e20ECD8d2bA6444B307F4B5127A41d6e19C'; +// https://sepolia.basescan.org/address/0x2B218FFE3C1272Da2F95cb0d09Ff346a861E04b7 +export const DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_2 = '0x2B218FFE3C1272Da2F95cb0d09Ff346a861E04b7'; // https://sepolia.basescan.org/address/0x4Afb5ADe7Bd7a670B61f303ab0C740eE8350918f export const STATA_FACTORY = '0x4Afb5ADe7Bd7a670B61f303ab0C740eE8350918f'; @@ -65,8 +65,8 @@ export const WALLET_BALANCE_PROVIDER = '0x2c4D1F4EC7F4FfA09a5E1C9e74fD3A10f21Bd8 // https://sepolia.basescan.org/address/0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6 export const WETH_GATEWAY = '0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6'; -// https://sepolia.basescan.org/address/0xb939e96168a3953697B64DA8055570dee8735829 -export const UMBRELLA = '0xb939e96168a3953697B64DA8055570dee8735829'; +// https://sepolia.basescan.org/address/0x710ebb9F848f725a47F39ce03Bd79Be6340e63dA +export const UMBRELLA = '0x710ebb9F848f725a47F39ce03Bd79Be6340e63dA'; export const CHAIN_ID = 84532; export const ASSETS = { diff --git a/src/ts/AaveV3Ethereum.ts b/src/ts/AaveV3Ethereum.ts index 2f1bc3dc..c2439f78 100644 --- a/src/ts/AaveV3Ethereum.ts +++ b/src/ts/AaveV3Ethereum.ts @@ -486,9 +486,10 @@ export const E_MODES = { label: 'sUSDe Stablecoins', collateralBitmap: '4294967296', collateralAssets: ['0x9D39A5DE30e57443BfF2A8307A4256c8797A3497'], - borrowableBitmap: '34359738376', + borrowableBitmap: '34359738632', borrowableAssets: [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + '0xdAC17F958D2ee523a2206206994597C13D831ec7', '0xdC035D45d973E3EC169d2276DDab16f1e407384F', ], ltv: 9000, diff --git a/tests/__snapshots__/verification.spec.ts.snap b/tests/__snapshots__/verification.spec.ts.snap index 28465e46..24591dfb 100644 --- a/tests/__snapshots__/verification.spec.ts.snap +++ b/tests/__snapshots__/verification.spec.ts.snap @@ -102,26 +102,6 @@ exports[`verification > should have all contracts verified except for the known "value": "0x11979886A6dBAE27D7a72c49fCF3F23240D647bF", }, }, - { - "item": { - "chainId": 84532, - "path": [ - "AaveV3BaseSepolia", - "COLLECTOR", - ], - "value": "0x6414DE3F58d54Fb90636e8393F065fDFe34Da420", - }, - }, - { - "item": { - "chainId": 84532, - "path": [ - "AaveV3BaseSepolia", - "UMBRELLA", - ], - "value": "0xb939e96168a3953697B64DA8055570dee8735829", - }, - }, { "item": { "chainId": 421614, diff --git a/tests/cache/verified.json b/tests/cache/verified.json index bd6dfa68..39cc0fd5 100644 --- a/tests/cache/verified.json +++ b/tests/cache/verified.json @@ -7027,6 +7027,18 @@ }, "0xD9145b5F45Ad4519c7ACcD6E0A4A82e83bB8A6Dc": { "name": "Faucet" + }, + "0x6414DE3F58d54Fb90636e8393F065fDFe34Da420": { + "name": "TransparentUpgradeableProxy" + }, + "0xfa3BE9b886fb9E4909040a7AE01eeD47fd96A075": { + "name": "ATokenInstance" + }, + "0x2B218FFE3C1272Da2F95cb0d09Ff346a861E04b7": { + "name": "VariableDebtTokenInstance" + }, + "0x710ebb9F848f725a47F39ce03Bd79Be6340e63dA": { + "name": "TransparentUpgradeableProxy" } }, "421614": { diff --git a/tests/generators/umbrella.spec.ts b/tests/generators/umbrella.spec.ts index 7c63ee80..820179ba 100644 --- a/tests/generators/umbrella.spec.ts +++ b/tests/generators/umbrella.spec.ts @@ -16,6 +16,12 @@ describe('umbrellaGenerator', () => { "oracle": "0x0000000000000000000000000000000000000000", "stakeToken": "0xFCf0DbDE4a68C95EeE14dD7f2FE61e09F9Fb5433", }, + { + "isReserveStataToken": true, + "liquidationBonus": 10000n, + "oracle": "0x7c743cCAE301b558D2DB0c72D6d69C792AA2E4c9", + "stakeToken": "0x7c743cCAE301b558D2DB0c72D6d69C792AA2E4c9", + }, ], "reserve": "0xba50Cd2A20f6DA35D788639E581bca8d0B5d4D5f", }, @@ -27,6 +33,12 @@ describe('umbrellaGenerator', () => { "oracle": "0x0000000000000000000000000000000000000000", "stakeToken": "0xE9bd69a6d6bE3A18017b29db0Bc771e98de67642", }, + { + "isReserveStataToken": true, + "liquidationBonus": 10000n, + "oracle": "0x4Dc9749D5FF960e92b21800CC0a6fC7A2aD606f8", + "stakeToken": "0x4Dc9749D5FF960e92b21800CC0a6fC7A2aD606f8", + }, ], "reserve": "0x0a215D8ba66387DCA84B284D18c3B4ec3de6E54a", }, @@ -38,6 +50,12 @@ describe('umbrellaGenerator', () => { "oracle": "0x0000000000000000000000000000000000000000", "stakeToken": "0xbAF767aF5e31b13aCAeFFE1db94f76B5026f9b54", }, + { + "isReserveStataToken": true, + "liquidationBonus": 10000n, + "oracle": "0x8d1dF6F3602f1Ca01f01F6e6d1071B205FbB0026", + "stakeToken": "0x8d1dF6F3602f1Ca01f01F6e6d1071B205FbB0026", + }, ], "reserve": "0x54114591963CF60EF3aA63bEfD6eC263D98145a4", }, @@ -49,6 +67,12 @@ describe('umbrellaGenerator', () => { "oracle": "0x0000000000000000000000000000000000000000", "stakeToken": "0xA8EB382804BEE84985053C4ce5F94E9e91593042", }, + { + "isReserveStataToken": true, + "liquidationBonus": 10000n, + "oracle": "0xF2176ACe5DA79291D176C645a725eBa96A8f246D", + "stakeToken": "0xF2176ACe5DA79291D176C645a725eBa96A8f246D", + }, ], "reserve": "0x4200000000000000000000000000000000000006", }, @@ -60,6 +84,12 @@ describe('umbrellaGenerator', () => { "oracle": "0x0000000000000000000000000000000000000000", "stakeToken": "0x98297F8CE8fBE6Ac21Baa23549389852D28715C4", }, + { + "isReserveStataToken": true, + "liquidationBonus": 10000n, + "oracle": "0xC550C904e04C6046122C0271A5D90891870f8824", + "stakeToken": "0xC550C904e04C6046122C0271A5D90891870f8824", + }, ], "reserve": "0xD171b9694f7A2597Ed006D41f7509aaD4B485c4B", }, @@ -71,6 +101,12 @@ describe('umbrellaGenerator', () => { "oracle": "0x0000000000000000000000000000000000000000", "stakeToken": "0xF045cAB6235e10116319D94B1c5970DAAe9b7136", }, + { + "isReserveStataToken": true, + "liquidationBonus": 10000n, + "oracle": "0xA821016E5A282676c07FeC5217016e229B518dE0", + "stakeToken": "0xA821016E5A282676c07FeC5217016e229B518dE0", + }, ], "reserve": "0x810D46F9a9027E28F9B01F75E2bdde839dA61115", }, @@ -89,6 +125,12 @@ describe('umbrellaGenerator', () => { "0x98297F8CE8fBE6Ac21Baa23549389852D28715C4", "0xF045cAB6235e10116319D94B1c5970DAAe9b7136", "0x32735b634571904008D29086C95e90b558758F9f", + "0x7c743cCAE301b558D2DB0c72D6d69C792AA2E4c9", + "0x4Dc9749D5FF960e92b21800CC0a6fC7A2aD606f8", + "0x8d1dF6F3602f1Ca01f01F6e6d1071B205FbB0026", + "0xF2176ACe5DA79291D176C645a725eBa96A8f246D", + "0xC550C904e04C6046122C0271A5D90891870f8824", + "0xA821016E5A282676c07FeC5217016e229B518dE0", ], } `); diff --git a/tests/verification.spec.ts b/tests/verification.spec.ts index c8d46e73..eea069d9 100644 --- a/tests/verification.spec.ts +++ b/tests/verification.spec.ts @@ -4,6 +4,7 @@ import {flattenedAddresses, ListItem} from '../ui/src/utils/getAddresses'; import verified from './cache/verified.json'; import {writeFileSync} from 'fs'; import {Hex, PublicClient, zeroAddress} from 'viem'; +import {getCode} from 'viem/actions'; import {getClient} from '../scripts/clients'; const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY as string; @@ -112,7 +113,7 @@ describe( if (checked.has(key)) continue; checked.add(key); const client = getClient(item.chainId) as PublicClient; - const hasCode = await client.getCode({address: item.value as Hex}); + const hasCode = await getCode(client, {address: item.value as Hex}); if (hasCode) { const {status, result} = (await checkVerified(item)) as { status: string;