From 19649cad1cbf51d22a978770e03aac99721b0cfa Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 31 Jul 2024 10:14:55 +0200 Subject: [PATCH] fix: always set eMode NONE, trigger release for address changes, export external libraries library (#508) * fix: always set eMode NONE * fix: simpler appraoch * fix: make address changes a fix * fix: remove duplicate interfaces * fix: update scripts * fix: add some docs * feat: add libraries export * fix: remove abis * fix: update origin --- .github/workflows/cron.yml | 4 +- lib/aave-v3-origin | 2 +- lib/forge-std | 2 +- remappings.txt | 1 + scripts/abi/aToken_v3_abi.ts | 553 --------------- scripts/abi/address_provider_v3_abi.ts | 444 ------------ scripts/abi/stableDebtToken_v3_abi.ts | 554 --------------- scripts/abi/static_a_token_factory_abi.ts | 81 --- scripts/abi/uiPoolData_provider_v2_abi.ts | 170 +++++ scripts/abi/variableDebtToken_v3_abi.ts | 501 -------------- scripts/configs/abis.ts | 14 +- scripts/generator/protocolV2Generator.ts | 4 +- scripts/generator/protocolV3Generator.ts | 121 +++- src/AaveV3Arbitrum.sol | 23 + src/AaveV3Avalanche.sol | 23 + src/AaveV3BNB.sol | 23 + src/AaveV3Base.sol | 23 + src/AaveV3Ethereum.sol | 23 + src/AaveV3EthereumLido.sol | 25 + src/AaveV3Gnosis.sol | 23 + src/AaveV3Metis.sol | 23 + src/AaveV3Optimism.sol | 23 + src/AaveV3Polygon.sol | 23 + src/AaveV3PolygonZkEvm.sol | 4 +- src/AaveV3Scroll.sol | 23 + src/common/ICrossChainController.sol | 2 +- src/common/IRescuable.sol | 52 -- src/common/IWithGuardian.sol | 22 - src/test/AaveV2Ethereum.t.sol | 5 +- src/ts/AaveAddressBook.ts | 4 +- src/ts/AaveV3Arbitrum.ts | 9 + src/ts/AaveV3Avalanche.ts | 9 + src/ts/AaveV3BNB.ts | 9 + src/ts/AaveV3Base.ts | 9 + src/ts/AaveV3Ethereum.ts | 9 + src/ts/AaveV3EthereumLido.ts | 10 + src/ts/AaveV3Gnosis.ts | 9 + src/ts/AaveV3Metis.ts | 9 + src/ts/AaveV3Optimism.ts | 9 + src/ts/AaveV3Polygon.ts | 9 + src/ts/AaveV3PolygonZkEvm.ts | 4 +- src/ts/AaveV3Scroll.ts | 9 + src/ts/abis/IERC20.ts | 6 +- src/ts/abis/IPool.ts | 14 +- src/ts/abis/IStaticATokenFactory.ts | 117 ---- src/ts/abis/IStaticATokenLM.ts | 808 +--------------------- 46 files changed, 678 insertions(+), 3166 deletions(-) delete mode 100644 scripts/abi/aToken_v3_abi.ts delete mode 100644 scripts/abi/address_provider_v3_abi.ts delete mode 100644 scripts/abi/stableDebtToken_v3_abi.ts delete mode 100644 scripts/abi/static_a_token_factory_abi.ts create mode 100644 scripts/abi/uiPoolData_provider_v2_abi.ts delete mode 100644 scripts/abi/variableDebtToken_v3_abi.ts delete mode 100644 src/common/IRescuable.sol delete mode 100644 src/common/IWithGuardian.sol diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 693e82f2..eaa6a9d7 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -60,9 +60,9 @@ jobs: uses: peter-evans/create-pull-request@712add83f26c1e359c046a6ca3dd677fb7017626 with: committer: Cache-bot - commit-message: "chore(cache): automated cache update" + commit-message: "fix(cache): automated cache update - updated addresses" delete-branch: true - title: "chore(cache): automated cache update" + title: "fix(cache): automated cache update - updated addresses" - name: Post to a Slack channel id: slack diff --git a/lib/aave-v3-origin b/lib/aave-v3-origin index 84e158c3..3b093775 160000 --- a/lib/aave-v3-origin +++ b/lib/aave-v3-origin @@ -1 +1 @@ -Subproject commit 84e158c3c80951ca2205f09beee5a52176da0088 +Subproject commit 3b093775a01ad29fe17dae5fb7b7a394efeb744b diff --git a/lib/forge-std b/lib/forge-std index 2cbff060..c28115db 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 2cbff0602d340503dba9828ab6981053704d1384 +Subproject commit c28115db8d90ebffb41953cf83aac63130f4bd40 diff --git a/remappings.txt b/remappings.txt index 995fe0c3..577560d1 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,2 +1,3 @@ forge-std/=lib/forge-std/src/ aave-v3-origin/=lib/aave-v3-origin/src/ +solidity-utils/=lib/aave-v3-origin/lib/solidity-utils/src/ diff --git a/scripts/abi/aToken_v3_abi.ts b/scripts/abi/aToken_v3_abi.ts deleted file mode 100644 index 2530d2ce..00000000 --- a/scripts/abi/aToken_v3_abi.ts +++ /dev/null @@ -1,553 +0,0 @@ -export const A_TOKEN_V3_ABI = [ - { - inputs: [{internalType: 'contract IPool', name: 'pool', type: 'address'}], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'BalanceTransfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'target', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'balanceIncrease', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'Burn', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'underlyingAsset', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'treasury', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'incentivesController', - type: 'address', - }, - { - indexed: false, - internalType: 'uint8', - name: 'aTokenDecimals', - type: 'uint8', - }, - { - indexed: false, - internalType: 'string', - name: 'aTokenName', - type: 'string', - }, - { - indexed: false, - internalType: 'string', - name: 'aTokenSymbol', - type: 'string', - }, - { - indexed: false, - internalType: 'bytes', - name: 'params', - type: 'bytes', - }, - ], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'onBehalfOf', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'balanceIncrease', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'Mint', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [], - name: 'ATOKEN_REVISION', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{internalType: 'bytes32', name: '', type: 'bytes32'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'EIP712_REVISION', - outputs: [{internalType: 'bytes', name: '', type: 'bytes'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'PERMIT_TYPEHASH', - outputs: [{internalType: 'bytes32', name: '', type: 'bytes32'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'POOL', - outputs: [{internalType: 'contract IPool', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'RESERVE_TREASURY_ADDRESS', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'UNDERLYING_ASSET_ADDRESS', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'owner', type: 'address'}, - {internalType: 'address', name: 'spender', type: 'address'}, - ], - name: 'allowance', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'spender', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'approve', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'balanceOf', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'from', type: 'address'}, - { - internalType: 'address', - name: 'receiverOfUnderlying', - type: 'address', - }, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - {internalType: 'uint256', name: 'index', type: 'uint256'}, - ], - name: 'burn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [{internalType: 'uint8', name: '', type: 'uint8'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'spender', type: 'address'}, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getIncentivesController', - outputs: [ - { - internalType: 'contract IAaveIncentivesController', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'getPreviousIndex', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'getScaledUserBalanceAndSupply', - outputs: [ - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'user', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'handleRepayment', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'spender', type: 'address'}, - {internalType: 'uint256', name: 'addedValue', type: 'uint256'}, - ], - name: 'increaseAllowance', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IPool', - name: 'initializingPool', - type: 'address', - }, - {internalType: 'address', name: 'treasury', type: 'address'}, - { - internalType: 'address', - name: 'underlyingAsset', - type: 'address', - }, - { - internalType: 'contract IAaveIncentivesController', - name: 'incentivesController', - type: 'address', - }, - {internalType: 'uint8', name: 'aTokenDecimals', type: 'uint8'}, - {internalType: 'string', name: 'aTokenName', type: 'string'}, - {internalType: 'string', name: 'aTokenSymbol', type: 'string'}, - {internalType: 'bytes', name: 'params', type: 'bytes'}, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'caller', type: 'address'}, - {internalType: 'address', name: 'onBehalfOf', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - {internalType: 'uint256', name: 'index', type: 'uint256'}, - ], - name: 'mint', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - {internalType: 'uint256', name: 'index', type: 'uint256'}, - ], - name: 'mintToTreasury', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [{internalType: 'string', name: '', type: 'string'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'owner', type: 'address'}], - name: 'nonces', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'owner', type: 'address'}, - {internalType: 'address', name: 'spender', type: 'address'}, - {internalType: 'uint256', name: 'value', type: 'uint256'}, - {internalType: 'uint256', name: 'deadline', type: 'uint256'}, - {internalType: 'uint8', name: 'v', type: 'uint8'}, - {internalType: 'bytes32', name: 'r', type: 'bytes32'}, - {internalType: 'bytes32', name: 's', type: 'bytes32'}, - ], - name: 'permit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'token', type: 'address'}, - {internalType: 'address', name: 'to', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'rescueTokens', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'scaledBalanceOf', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'scaledTotalSupply', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveIncentivesController', - name: 'controller', - type: 'address', - }, - ], - name: 'setIncentivesController', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [{internalType: 'string', name: '', type: 'string'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'recipient', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'transfer', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'sender', type: 'address'}, - {internalType: 'address', name: 'recipient', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'transferFrom', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'from', type: 'address'}, - {internalType: 'address', name: 'to', type: 'address'}, - {internalType: 'uint256', name: 'value', type: 'uint256'}, - ], - name: 'transferOnLiquidation', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'target', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'transferUnderlyingTo', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; diff --git a/scripts/abi/address_provider_v3_abi.ts b/scripts/abi/address_provider_v3_abi.ts deleted file mode 100644 index cd08db01..00000000 --- a/scripts/abi/address_provider_v3_abi.ts +++ /dev/null @@ -1,444 +0,0 @@ -export const ADDRESS_PROVIDER_V3_ABI = [ - { - inputs: [ - {internalType: 'string', name: 'marketId', type: 'string'}, - {internalType: 'address', name: 'owner', type: 'address'}, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'ACLAdminUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'ACLManagerUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'AddressSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'proxyAddress', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'oldImplementationAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newImplementationAddress', - type: 'address', - }, - ], - name: 'AddressSetAsProxy', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'string', - name: 'oldMarketId', - type: 'string', - }, - { - indexed: true, - internalType: 'string', - name: 'newMarketId', - type: 'string', - }, - ], - name: 'MarketIdSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'PoolConfiguratorUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'PoolDataProviderUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'PoolUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'PriceOracleSentinelUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'oldAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newAddress', - type: 'address', - }, - ], - name: 'PriceOracleUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'id', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'proxyAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'implementationAddress', - type: 'address', - }, - ], - name: 'ProxyCreated', - type: 'event', - }, - { - inputs: [], - name: 'getACLAdmin', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getACLManager', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'bytes32', name: 'id', type: 'bytes32'}], - name: 'getAddress', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getMarketId', - outputs: [{internalType: 'string', name: '', type: 'string'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPool', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPoolConfigurator', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPoolDataProvider', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPriceOracle', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPriceOracleSentinel', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'newAclAdmin', type: 'address'}], - name: 'setACLAdmin', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'newAclManager', type: 'address'}], - name: 'setACLManager', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'bytes32', name: 'id', type: 'bytes32'}, - {internalType: 'address', name: 'newAddress', type: 'address'}, - ], - name: 'setAddress', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'bytes32', name: 'id', type: 'bytes32'}, - { - internalType: 'address', - name: 'newImplementationAddress', - type: 'address', - }, - ], - name: 'setAddressAsProxy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'string', name: 'newMarketId', type: 'string'}], - name: 'setMarketId', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newPoolConfiguratorImpl', - type: 'address', - }, - ], - name: 'setPoolConfiguratorImpl', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newDataProvider', - type: 'address', - }, - ], - name: 'setPoolDataProvider', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'newPoolImpl', type: 'address'}], - name: 'setPoolImpl', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'newPriceOracle', type: 'address'}], - name: 'setPriceOracle', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newPriceOracleSentinel', - type: 'address', - }, - ], - name: 'setPriceOracleSentinel', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'newOwner', type: 'address'}], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; diff --git a/scripts/abi/stableDebtToken_v3_abi.ts b/scripts/abi/stableDebtToken_v3_abi.ts deleted file mode 100644 index d758f7fe..00000000 --- a/scripts/abi/stableDebtToken_v3_abi.ts +++ /dev/null @@ -1,554 +0,0 @@ -export const STABLE_DEBT_TOKEN_ABI = [ - { - inputs: [{internalType: 'contract IPool', name: 'pool', type: 'address'}], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'fromUser', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'toUser', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'asset', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'BorrowAllowanceDelegated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'currentBalance', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'balanceIncrease', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'avgStableRate', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newTotalSupply', - type: 'uint256', - }, - ], - name: 'Burn', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'underlyingAsset', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'incentivesController', - type: 'address', - }, - { - indexed: false, - internalType: 'uint8', - name: 'debtTokenDecimals', - type: 'uint8', - }, - { - indexed: false, - internalType: 'string', - name: 'debtTokenName', - type: 'string', - }, - { - indexed: false, - internalType: 'string', - name: 'debtTokenSymbol', - type: 'string', - }, - { - indexed: false, - internalType: 'bytes', - name: 'params', - type: 'bytes', - }, - ], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'onBehalfOf', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'currentBalance', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'balanceIncrease', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newRate', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'avgStableRate', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newTotalSupply', - type: 'uint256', - }, - ], - name: 'Mint', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [], - name: 'DEBT_TOKEN_REVISION', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DELEGATION_WITH_SIG_TYPEHASH', - outputs: [{internalType: 'bytes32', name: '', type: 'bytes32'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{internalType: 'bytes32', name: '', type: 'bytes32'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'EIP712_REVISION', - outputs: [{internalType: 'bytes', name: '', type: 'bytes'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'POOL', - outputs: [{internalType: 'contract IPool', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'UNDERLYING_ASSET_ADDRESS', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'address', name: '', type: 'address'}, - ], - name: 'allowance', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'approve', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'delegatee', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'approveDelegation', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'account', type: 'address'}], - name: 'balanceOf', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'fromUser', type: 'address'}, - {internalType: 'address', name: 'toUser', type: 'address'}, - ], - name: 'borrowAllowance', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'from', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'burn', - outputs: [ - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [{internalType: 'uint8', name: '', type: 'uint8'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'decreaseAllowance', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'delegator', type: 'address'}, - {internalType: 'address', name: 'delegatee', type: 'address'}, - {internalType: 'uint256', name: 'value', type: 'uint256'}, - {internalType: 'uint256', name: 'deadline', type: 'uint256'}, - {internalType: 'uint8', name: 'v', type: 'uint8'}, - {internalType: 'bytes32', name: 'r', type: 'bytes32'}, - {internalType: 'bytes32', name: 's', type: 'bytes32'}, - ], - name: 'delegationWithSig', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getAverageStableRate', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getIncentivesController', - outputs: [ - { - internalType: 'contract IAaveIncentivesController', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getSupplyData', - outputs: [ - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint40', name: '', type: 'uint40'}, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getTotalSupplyAndAvgRate', - outputs: [ - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getTotalSupplyLastUpdated', - outputs: [{internalType: 'uint40', name: '', type: 'uint40'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'getUserLastUpdated', - outputs: [{internalType: 'uint40', name: '', type: 'uint40'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'getUserStableRate', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'increaseAllowance', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IPool', - name: 'initializingPool', - type: 'address', - }, - { - internalType: 'address', - name: 'underlyingAsset', - type: 'address', - }, - { - internalType: 'contract IAaveIncentivesController', - name: 'incentivesController', - type: 'address', - }, - {internalType: 'uint8', name: 'debtTokenDecimals', type: 'uint8'}, - {internalType: 'string', name: 'debtTokenName', type: 'string'}, - {internalType: 'string', name: 'debtTokenSymbol', type: 'string'}, - {internalType: 'bytes', name: 'params', type: 'bytes'}, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'user', type: 'address'}, - {internalType: 'address', name: 'onBehalfOf', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - {internalType: 'uint256', name: 'rate', type: 'uint256'}, - ], - name: 'mint', - outputs: [ - {internalType: 'bool', name: '', type: 'bool'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [{internalType: 'string', name: '', type: 'string'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'owner', type: 'address'}], - name: 'nonces', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'principalBalanceOf', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveIncentivesController', - name: 'controller', - type: 'address', - }, - ], - name: 'setIncentivesController', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [{internalType: 'string', name: '', type: 'string'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'transfer', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'transferFrom', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; diff --git a/scripts/abi/static_a_token_factory_abi.ts b/scripts/abi/static_a_token_factory_abi.ts deleted file mode 100644 index f276d7dd..00000000 --- a/scripts/abi/static_a_token_factory_abi.ts +++ /dev/null @@ -1,81 +0,0 @@ -export const STATIC_A_TOKEN_FACTORY_ABI = [ - { - inputs: [ - {internalType: 'contract IPool', name: 'pool', type: 'address'}, - {internalType: 'address', name: 'proxyAdmin', type: 'address'}, - { - internalType: 'contract ITransparentProxyFactory', - name: 'transparentProxyFactory', - type: 'address', - }, - {internalType: 'address', name: 'staticATokenImpl', type: 'address'}, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [{indexed: false, internalType: 'uint8', name: 'version', type: 'uint8'}], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - {indexed: true, internalType: 'address', name: 'staticAToken', type: 'address'}, - {indexed: true, internalType: 'address', name: 'underlying', type: 'address'}, - ], - name: 'StaticTokenCreated', - type: 'event', - }, - { - inputs: [], - name: 'ADMIN', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'POOL', - outputs: [{internalType: 'contract IPool', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'STATIC_A_TOKEN_IMPL', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'TRANSPARENT_PROXY_FACTORY', - outputs: [{internalType: 'contract ITransparentProxyFactory', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address[]', name: 'underlyings', type: 'address[]'}], - name: 'createStaticATokens', - outputs: [{internalType: 'address[]', name: '', type: 'address[]'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'underlying', type: 'address'}], - name: 'getStaticAToken', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getStaticATokens', - outputs: [{internalType: 'address[]', name: '', type: 'address[]'}], - stateMutability: 'view', - type: 'function', - }, - {inputs: [], name: 'initialize', outputs: [], stateMutability: 'nonpayable', type: 'function'}, -] as const; diff --git a/scripts/abi/uiPoolData_provider_v2_abi.ts b/scripts/abi/uiPoolData_provider_v2_abi.ts new file mode 100644 index 00000000..5c5f5d9a --- /dev/null +++ b/scripts/abi/uiPoolData_provider_v2_abi.ts @@ -0,0 +1,170 @@ +export const UI_POOL_DATA_PROVIDER_V2_ABI = [ + { + inputs: [ + { + internalType: 'contract IChainlinkAggregator', + name: '_networkBaseTokenPriceInUsdProxyAggregator', + type: 'address', + }, + { + internalType: 'contract IChainlinkAggregator', + name: '_marketReferenceCurrencyPriceInUsdProxyAggregator', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'ETH_CURRENCY_UNIT', + outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MKRAddress', + outputs: [{internalType: 'address', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{internalType: 'bytes32', name: '_bytes32', type: 'bytes32'}], + name: 'bytes32ToString', + outputs: [{internalType: 'string', name: '', type: 'string'}], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + {internalType: 'contract ILendingPoolAddressesProvider', name: 'provider', type: 'address'}, + ], + name: 'getReservesData', + outputs: [ + { + components: [ + {internalType: 'address', name: 'underlyingAsset', type: 'address'}, + {internalType: 'string', name: 'name', type: 'string'}, + {internalType: 'string', name: 'symbol', type: 'string'}, + {internalType: 'uint256', name: 'decimals', type: 'uint256'}, + {internalType: 'uint256', name: 'baseLTVasCollateral', type: 'uint256'}, + {internalType: 'uint256', name: 'reserveLiquidationThreshold', type: 'uint256'}, + {internalType: 'uint256', name: 'reserveLiquidationBonus', type: 'uint256'}, + {internalType: 'uint256', name: 'reserveFactor', type: 'uint256'}, + {internalType: 'bool', name: 'usageAsCollateralEnabled', type: 'bool'}, + {internalType: 'bool', name: 'borrowingEnabled', type: 'bool'}, + {internalType: 'bool', name: 'stableBorrowRateEnabled', type: 'bool'}, + {internalType: 'bool', name: 'isActive', type: 'bool'}, + {internalType: 'bool', name: 'isFrozen', type: 'bool'}, + {internalType: 'uint128', name: 'liquidityIndex', type: 'uint128'}, + {internalType: 'uint128', name: 'variableBorrowIndex', type: 'uint128'}, + {internalType: 'uint128', name: 'liquidityRate', type: 'uint128'}, + {internalType: 'uint128', name: 'variableBorrowRate', type: 'uint128'}, + {internalType: 'uint128', name: 'stableBorrowRate', type: 'uint128'}, + {internalType: 'uint40', name: 'lastUpdateTimestamp', type: 'uint40'}, + {internalType: 'address', name: 'aTokenAddress', type: 'address'}, + {internalType: 'address', name: 'stableDebtTokenAddress', type: 'address'}, + {internalType: 'address', name: 'variableDebtTokenAddress', type: 'address'}, + {internalType: 'address', name: 'interestRateStrategyAddress', type: 'address'}, + {internalType: 'uint256', name: 'availableLiquidity', type: 'uint256'}, + {internalType: 'uint256', name: 'totalPrincipalStableDebt', type: 'uint256'}, + {internalType: 'uint256', name: 'averageStableRate', type: 'uint256'}, + {internalType: 'uint256', name: 'stableDebtLastUpdateTimestamp', type: 'uint256'}, + {internalType: 'uint256', name: 'totalScaledVariableDebt', type: 'uint256'}, + {internalType: 'uint256', name: 'priceInMarketReferenceCurrency', type: 'uint256'}, + {internalType: 'address', name: 'priceOracle', type: 'address'}, + {internalType: 'uint256', name: 'variableRateSlope1', type: 'uint256'}, + {internalType: 'uint256', name: 'variableRateSlope2', type: 'uint256'}, + {internalType: 'uint256', name: 'stableRateSlope1', type: 'uint256'}, + {internalType: 'uint256', name: 'stableRateSlope2', type: 'uint256'}, + {internalType: 'uint256', name: 'baseStableBorrowRate', type: 'uint256'}, + {internalType: 'uint256', name: 'baseVariableBorrowRate', type: 'uint256'}, + {internalType: 'uint256', name: 'optimalUsageRatio', type: 'uint256'}, + {internalType: 'bool', name: 'isPaused', type: 'bool'}, + {internalType: 'bool', name: 'isSiloedBorrowing', type: 'bool'}, + {internalType: 'uint128', name: 'accruedToTreasury', type: 'uint128'}, + {internalType: 'uint128', name: 'unbacked', type: 'uint128'}, + {internalType: 'uint128', name: 'isolationModeTotalDebt', type: 'uint128'}, + {internalType: 'bool', name: 'flashLoanEnabled', type: 'bool'}, + {internalType: 'uint256', name: 'debtCeiling', type: 'uint256'}, + {internalType: 'uint256', name: 'debtCeilingDecimals', type: 'uint256'}, + {internalType: 'uint8', name: 'eModeCategoryId', type: 'uint8'}, + {internalType: 'uint256', name: 'borrowCap', type: 'uint256'}, + {internalType: 'uint256', name: 'supplyCap', type: 'uint256'}, + {internalType: 'uint16', name: 'eModeLtv', type: 'uint16'}, + {internalType: 'uint16', name: 'eModeLiquidationThreshold', type: 'uint16'}, + {internalType: 'uint16', name: 'eModeLiquidationBonus', type: 'uint16'}, + {internalType: 'address', name: 'eModePriceSource', type: 'address'}, + {internalType: 'string', name: 'eModeLabel', type: 'string'}, + {internalType: 'bool', name: 'borrowableInIsolation', type: 'bool'}, + ], + internalType: 'struct IUiPoolDataProviderV3.AggregatedReserveData[]', + name: '', + type: 'tuple[]', + }, + { + components: [ + {internalType: 'uint256', name: 'marketReferenceCurrencyUnit', type: 'uint256'}, + {internalType: 'int256', name: 'marketReferenceCurrencyPriceInUsd', type: 'int256'}, + {internalType: 'int256', name: 'networkBaseTokenPriceInUsd', type: 'int256'}, + {internalType: 'uint8', name: 'networkBaseTokenPriceDecimals', type: 'uint8'}, + ], + internalType: 'struct IUiPoolDataProviderV3.BaseCurrencyInfo', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + {internalType: 'contract ILendingPoolAddressesProvider', name: 'provider', type: 'address'}, + ], + name: 'getReservesList', + outputs: [{internalType: 'address[]', name: '', type: 'address[]'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + {internalType: 'contract ILendingPoolAddressesProvider', name: 'provider', type: 'address'}, + {internalType: 'address', name: 'user', type: 'address'}, + ], + name: 'getUserReservesData', + outputs: [ + { + components: [ + {internalType: 'address', name: 'underlyingAsset', type: 'address'}, + {internalType: 'uint256', name: 'scaledATokenBalance', type: 'uint256'}, + {internalType: 'bool', name: 'usageAsCollateralEnabledOnUser', type: 'bool'}, + {internalType: 'uint256', name: 'stableBorrowRate', type: 'uint256'}, + {internalType: 'uint256', name: 'scaledVariableDebt', type: 'uint256'}, + {internalType: 'uint256', name: 'principalStableDebt', type: 'uint256'}, + {internalType: 'uint256', name: 'stableBorrowLastUpdateTimestamp', type: 'uint256'}, + ], + internalType: 'struct IUiPoolDataProviderV3.UserReserveData[]', + name: '', + type: 'tuple[]', + }, + {internalType: 'uint8', name: '', type: 'uint8'}, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'marketReferenceCurrencyPriceInUsdProxyAggregator', + outputs: [{internalType: 'contract IChainlinkAggregator', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'networkBaseTokenPriceInUsdProxyAggregator', + outputs: [{internalType: 'contract IChainlinkAggregator', name: '', type: 'address'}], + stateMutability: 'view', + type: 'function', + }, +] as const; diff --git a/scripts/abi/variableDebtToken_v3_abi.ts b/scripts/abi/variableDebtToken_v3_abi.ts deleted file mode 100644 index 944ee5b2..00000000 --- a/scripts/abi/variableDebtToken_v3_abi.ts +++ /dev/null @@ -1,501 +0,0 @@ -export const VARIABLE_DEBT_TOKEN_ABI = [ - { - inputs: [{internalType: 'contract IPool', name: 'pool', type: 'address'}], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'fromUser', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'toUser', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'asset', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'BorrowAllowanceDelegated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'target', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'balanceIncrease', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'Burn', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'underlyingAsset', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'pool', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'incentivesController', - type: 'address', - }, - { - indexed: false, - internalType: 'uint8', - name: 'debtTokenDecimals', - type: 'uint8', - }, - { - indexed: false, - internalType: 'string', - name: 'debtTokenName', - type: 'string', - }, - { - indexed: false, - internalType: 'string', - name: 'debtTokenSymbol', - type: 'string', - }, - { - indexed: false, - internalType: 'bytes', - name: 'params', - type: 'bytes', - }, - ], - name: 'Initialized', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'onBehalfOf', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'balanceIncrease', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'index', - type: 'uint256', - }, - ], - name: 'Mint', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [], - name: 'DEBT_TOKEN_REVISION', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DELEGATION_WITH_SIG_TYPEHASH', - outputs: [{internalType: 'bytes32', name: '', type: 'bytes32'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{internalType: 'bytes32', name: '', type: 'bytes32'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'EIP712_REVISION', - outputs: [{internalType: 'bytes', name: '', type: 'bytes'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'POOL', - outputs: [{internalType: 'contract IPool', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'UNDERLYING_ASSET_ADDRESS', - outputs: [{internalType: 'address', name: '', type: 'address'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'address', name: '', type: 'address'}, - ], - name: 'allowance', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'approve', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'delegatee', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - ], - name: 'approveDelegation', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'balanceOf', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'fromUser', type: 'address'}, - {internalType: 'address', name: 'toUser', type: 'address'}, - ], - name: 'borrowAllowance', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'from', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - {internalType: 'uint256', name: 'index', type: 'uint256'}, - ], - name: 'burn', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [{internalType: 'uint8', name: '', type: 'uint8'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'decreaseAllowance', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'delegator', type: 'address'}, - {internalType: 'address', name: 'delegatee', type: 'address'}, - {internalType: 'uint256', name: 'value', type: 'uint256'}, - {internalType: 'uint256', name: 'deadline', type: 'uint256'}, - {internalType: 'uint8', name: 'v', type: 'uint8'}, - {internalType: 'bytes32', name: 'r', type: 'bytes32'}, - {internalType: 'bytes32', name: 's', type: 'bytes32'}, - ], - name: 'delegationWithSig', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getIncentivesController', - outputs: [ - { - internalType: 'contract IAaveIncentivesController', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'getPreviousIndex', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'getScaledUserBalanceAndSupply', - outputs: [ - {internalType: 'uint256', name: '', type: 'uint256'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'increaseAllowance', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IPool', - name: 'initializingPool', - type: 'address', - }, - { - internalType: 'address', - name: 'underlyingAsset', - type: 'address', - }, - { - internalType: 'contract IAaveIncentivesController', - name: 'incentivesController', - type: 'address', - }, - {internalType: 'uint8', name: 'debtTokenDecimals', type: 'uint8'}, - {internalType: 'string', name: 'debtTokenName', type: 'string'}, - {internalType: 'string', name: 'debtTokenSymbol', type: 'string'}, - {internalType: 'bytes', name: 'params', type: 'bytes'}, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: 'user', type: 'address'}, - {internalType: 'address', name: 'onBehalfOf', type: 'address'}, - {internalType: 'uint256', name: 'amount', type: 'uint256'}, - {internalType: 'uint256', name: 'index', type: 'uint256'}, - ], - name: 'mint', - outputs: [ - {internalType: 'bool', name: '', type: 'bool'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [{internalType: 'string', name: '', type: 'string'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'owner', type: 'address'}], - name: 'nonces', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [{internalType: 'address', name: 'user', type: 'address'}], - name: 'scaledBalanceOf', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'scaledTotalSupply', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAaveIncentivesController', - name: 'controller', - type: 'address', - }, - ], - name: 'setIncentivesController', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [{internalType: 'string', name: '', type: 'string'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'transfer', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'address', name: '', type: 'address'}, - {internalType: 'uint256', name: '', type: 'uint256'}, - ], - name: 'transferFrom', - outputs: [{internalType: 'bool', name: '', type: 'bool'}], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; diff --git a/scripts/configs/abis.ts b/scripts/configs/abis.ts index 5881a96e..dc987214 100644 --- a/scripts/configs/abis.ts +++ b/scripts/configs/abis.ts @@ -1,6 +1,9 @@ import {governanceConfigMainnet} from './governance/ethereum'; import {mainnetProtoV3Pool} from './pools/ethereum'; +/** + * @dev These abis can be inferred directly from code as they exist as a dependency + */ export const ABI_INTERFACES = [ 'ICollector', 'AggregatorInterface', @@ -29,8 +32,14 @@ export const ABI_INTERFACES = [ 'IPoolAddressesProvider', 'IPoolConfigurator', 'IStakeToken', + 'IStaticATokenFactory', + 'IStaticATokenLM', ]; +/** + * @dev These abis cannot be inferred as they don't exist as a dependency on this repo. + * Therefore we use forge download & forge inspect to fetch them from on-chain contracts + */ export const DOWNLOAD_ABI_INTERFACES = [ { address: governanceConfigMainnet.ADDRESSES.PC_DATA_HELPER, @@ -64,9 +73,4 @@ export const DOWNLOAD_ABI_INTERFACES = [ address: '0x366AE337897223AEa70e3EBe1862219386f20593', name: 'IATokenWithDelegation', }, - { - address: '0x79b5e91037AE441dE0d9e6fd3Fd85b96B83d4E93', - name: 'IStaticATokenFactory', - }, - {address: '0xc026f5dd7869e0ddc44a759ea3dec6d5cd8d996b', name: 'IStaticATokenLM'}, ]; diff --git a/scripts/generator/protocolV2Generator.ts b/scripts/generator/protocolV2Generator.ts index 75e36336..6ccc399b 100644 --- a/scripts/generator/protocolV2Generator.ts +++ b/scripts/generator/protocolV2Generator.ts @@ -16,7 +16,7 @@ import {LENDING_POOL_V2_ABI} from '../abi/lending_pool_v2_abi'; import {A_TOKEN_V2_ABI} from '../abi/aToken_v2_abi'; import {INCENTIVES_CONTROLLER_ABI} from '../abi/incentivesController_abi'; import {generateAssetsLibrary} from './assetsLibraryGenerator'; -import {IUiPoolDataProvider_ABI} from '../../src/ts/abis/IUiPoolDataProvider'; +import {UI_POOL_DATA_PROVIDER_V2_ABI} from '../abi/uiPoolData_provider_v2_abi'; import {mainnetAmmV2Pool} from '../configs/pools/ethereum'; export interface PoolV2Addresses { @@ -121,7 +121,7 @@ export async function getPoolV2Addresses(pool: PoolConfig): Promise; } async function getAdditionalTokenInfo( @@ -48,24 +48,49 @@ async function getAdditionalTokenInfo( reservesData: PoolV3Addresses['reservesData'], ): Promise<{ COLLECTOR: AddressInfo; - [key: `DEFAULT_A_TOKEN_IMPL_REV_${number}`]: Hex; - [key: `DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_${number}`]: Hex; - [key: `DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_${number}`]: Hex; + [key: `DEFAULT_A_TOKEN_IMPL_REV_${number}`]: AddressInfo; + [key: `DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_${number}`]: AddressInfo; + [key: `DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_${number}`]: AddressInfo; }> { if (reservesData.length > 0) { const aTokenContract = getContract({ address: reservesData[0].A_TOKEN, - abi: A_TOKEN_V3_ABI, + abi: [ + { + inputs: [], + name: 'ATOKEN_REVISION', + outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], + stateMutability: 'view', + type: 'function', + }, + ...IAToken_ABI, + ] as const, client, }); const variableDebtTokenContract = getContract({ address: reservesData[0].V_TOKEN, - abi: VARIABLE_DEBT_TOKEN_ABI, + abi: [ + { + inputs: [], + name: 'DEBT_TOKEN_REVISION', + outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], + stateMutability: 'view', + type: 'function', + }, + ] as const, client, }); const stableDebtTokenContract = getContract({ address: reservesData[0].S_TOKEN, - abi: STABLE_DEBT_TOKEN_ABI, + abi: [ + { + inputs: [], + name: 'DEBT_TOKEN_REVISION', + outputs: [{internalType: 'uint256', name: '', type: 'uint256'}], + stateMutability: 'view', + type: 'function', + }, + ] as const, client, }); @@ -120,7 +145,7 @@ export async function getPoolV3Addresses( const client = CHAIN_ID_CLIENT_MAP[pool.chainId]; const addressProviderContract = getContract({ address: pool.POOL_ADDRESSES_PROVIDER, - abi: ADDRESS_PROVIDER_V3_ABI, + abi: IPoolAddressesProvider_ABI, client, }); if (!client) { @@ -179,7 +204,7 @@ export async function getPoolV3Addresses( const staticATokenFactoryContract = pool.additionalAddresses.STATIC_A_TOKEN_FACTORY ? getContract({ address: pool.additionalAddresses.STATIC_A_TOKEN_FACTORY, - abi: STATIC_A_TOKEN_FACTORY_ABI, + abi: IStaticATokenFactory_ABI, client, }) : null; @@ -210,8 +235,43 @@ export async function getPoolV3Addresses( const {COLLECTOR, ...rest} = await getAdditionalTokenInfo(client, pool, reservesData); + // fetching libraries on 3.1+ + let externalLibraries: null | Record = null; + try { + const poolContract = getContract({address: POOL, abi: IPool_ABI, client}); + const [ + FLASHLOAN_LOGIC, + BORROW_LOGIC, + BRIDGE_LOGIC, + E_MODE_LOGIC, + LIQUIDATION_LOGIC, + POOL_LOGIC, + SUPPLY_LOGIC, + ] = await Promise.all([ + poolContract.read.getFlashLoanLogic(), + poolContract.read.getBorrowLogic(), + poolContract.read.getBridgeLogic(), + poolContract.read.getEModeLogic(), + poolContract.read.getLiquidationLogic(), + poolContract.read.getPoolLogic(), + poolContract.read.getSupplyLogic(), + ]); + externalLibraries = { + FLASHLOAN_LOGIC, + BORROW_LOGIC, + BRIDGE_LOGIC, + E_MODE_LOGIC, + LIQUIDATION_LOGIC, + POOL_LOGIC, + SUPPLY_LOGIC, + }; + } catch (e) { + // might fail on fantom/harmony and testnets + } + return { eModes, + externalLibraries, POOL_ADDRESSES_PROVIDER: { value: pool.POOL_ADDRESSES_PROVIDER, type: 'IPoolAddressesProvider', @@ -243,9 +303,11 @@ export async function getPoolV3Addresses( } function generateEmodes(chainId: number, eModes: Map, libraryName: string) { + const eModeZero = eModes.get(0); + if (!eModeZero) eModes.set(0, 'NONE'); const sorted = Array.from(eModes).sort(([keyA], [keyB]) => keyA - keyB); const formatted = sorted.reduce((acc, [value, label]) => { - acc[`${label ? label.toUpperCase().replace('-', '_').replace(' ', '_') : 'NONE'}`] = { + acc[label.toUpperCase().replace('-', '_').replace(' ', '_')] = { value, type: 'uint8', }; @@ -263,8 +325,25 @@ function generateEmodes(chainId: number, eModes: Map, libraryNam }; } +function generateExternalLibraries( + chainId: number, + libraries: Record, + libraryName: string, +) { + return { + solidity: wrapIntoSolidityLibrary( + generateSolidityConstants({ + chainId, + addresses: libraries, + }), + libraryName, + ), + js: `export const EXTERNAL_LIBRARIES = ${generateJsObject({addresses: libraries})} as const;\n`, + }; +} + export async function generateProtocolV3Library(config: PoolConfig) { - const {reservesData, eModes, ...addresses} = await getPoolV3Addresses(config); + const {reservesData, eModes, externalLibraries, ...addresses} = await getPoolV3Addresses(config); const name = `AaveV3${config.name}`; // generate main library @@ -310,6 +389,18 @@ export async function generateProtocolV3Library(config: PoolConfig) { appendFileSync(`./src/${name}.sol`, eModesLibrary.solidity); appendFileSync(`./src/ts/${name}.ts`, eModesLibrary.js); + // generate externalLibraries library + if (externalLibraries) { + const externalLibraryName = name + 'ExternalLibraries'; + const externalLibrary = generateExternalLibraries( + config.chainId, + externalLibraries, + externalLibraryName, + ); + appendFileSync(`./src/${name}.sol`, externalLibrary.solidity); + appendFileSync(`./src/ts/${name}.ts`, externalLibrary.js); + } + return { pool: (addresses.POOL as any).value, name, diff --git a/src/AaveV3Arbitrum.sol b/src/AaveV3Arbitrum.sol index b8ab6931..d6cdc073 100644 --- a/src/AaveV3Arbitrum.sol +++ b/src/AaveV3Arbitrum.sol @@ -519,3 +519,26 @@ library AaveV3ArbitrumEModes { uint8 internal constant ETH_CORRELATED = 2; } + +library AaveV3ArbitrumExternalLibraries { + // https://arbiscan.io/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://arbiscan.io/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://arbiscan.io/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://arbiscan.io/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://arbiscan.io/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://arbiscan.io/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://arbiscan.io/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3Avalanche.sol b/src/AaveV3Avalanche.sol index 39931441..53269c9e 100644 --- a/src/AaveV3Avalanche.sol +++ b/src/AaveV3Avalanche.sol @@ -403,3 +403,26 @@ library AaveV3AvalancheEModes { uint8 internal constant AVAX_CORRELATED = 2; } + +library AaveV3AvalancheExternalLibraries { + // https://snowscan.xyz/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://snowscan.xyz/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://snowscan.xyz/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://snowscan.xyz/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://snowscan.xyz/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://snowscan.xyz/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://snowscan.xyz/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3BNB.sol b/src/AaveV3BNB.sol index 4bf108f7..eab430a0 100644 --- a/src/AaveV3BNB.sol +++ b/src/AaveV3BNB.sol @@ -272,3 +272,26 @@ library AaveV3BNBAssets { library AaveV3BNBEModes { uint8 internal constant NONE = 0; } + +library AaveV3BNBExternalLibraries { + // https://bscscan.com/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://bscscan.com/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://bscscan.com/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://bscscan.com/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://bscscan.com/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://bscscan.com/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://bscscan.com/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3Base.sol b/src/AaveV3Base.sol index 106b52c5..37b3905c 100644 --- a/src/AaveV3Base.sol +++ b/src/AaveV3Base.sol @@ -254,3 +254,26 @@ library AaveV3BaseEModes { uint8 internal constant ETH_CORRELATED = 1; } + +library AaveV3BaseExternalLibraries { + // https://basescan.org/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://basescan.org/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://basescan.org/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://basescan.org/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://basescan.org/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://basescan.org/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://basescan.org/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3Ethereum.sol b/src/AaveV3Ethereum.sol index c6270270..09fbb3a1 100644 --- a/src/AaveV3Ethereum.sol +++ b/src/AaveV3Ethereum.sol @@ -824,3 +824,26 @@ library AaveV3EthereumEModes { uint8 internal constant ETH_CORRELATED = 1; } + +library AaveV3EthereumExternalLibraries { + // https://etherscan.io/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://etherscan.io/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://etherscan.io/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://etherscan.io/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://etherscan.io/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://etherscan.io/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://etherscan.io/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3EthereumLido.sol b/src/AaveV3EthereumLido.sol index 14a67bf9..63499416 100644 --- a/src/AaveV3EthereumLido.sol +++ b/src/AaveV3EthereumLido.sol @@ -136,5 +136,30 @@ library AaveV3EthereumLidoAssets { } library AaveV3EthereumLidoEModes { + uint8 internal constant NONE = 0; + uint8 internal constant ETH_CORRELATED = 1; } + +library AaveV3EthereumLidoExternalLibraries { + // https://etherscan.io/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://etherscan.io/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://etherscan.io/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://etherscan.io/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://etherscan.io/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://etherscan.io/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://etherscan.io/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3Gnosis.sol b/src/AaveV3Gnosis.sol index 84fac790..9d99022f 100644 --- a/src/AaveV3Gnosis.sol +++ b/src/AaveV3Gnosis.sol @@ -261,3 +261,26 @@ library AaveV3GnosisEModes { uint8 internal constant ETH_CORRELATED = 1; } + +library AaveV3GnosisExternalLibraries { + // https://gnosisscan.io/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://gnosisscan.io/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://gnosisscan.io/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://gnosisscan.io/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://gnosisscan.io/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://gnosisscan.io/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://gnosisscan.io/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3Metis.sol b/src/AaveV3Metis.sol index f87b8746..00b007dd 100644 --- a/src/AaveV3Metis.sol +++ b/src/AaveV3Metis.sol @@ -215,3 +215,26 @@ library AaveV3MetisAssets { library AaveV3MetisEModes { uint8 internal constant NONE = 0; } + +library AaveV3MetisExternalLibraries { + // https://andromeda-explorer.metis.io/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://andromeda-explorer.metis.io/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://andromeda-explorer.metis.io/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://andromeda-explorer.metis.io/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://andromeda-explorer.metis.io/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://andromeda-explorer.metis.io/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://andromeda-explorer.metis.io/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3Optimism.sol b/src/AaveV3Optimism.sol index 1a4077c9..1f95a8f7 100644 --- a/src/AaveV3Optimism.sol +++ b/src/AaveV3Optimism.sol @@ -448,3 +448,26 @@ library AaveV3OptimismEModes { uint8 internal constant ETH_CORRELATED = 2; } + +library AaveV3OptimismExternalLibraries { + // https://optimistic.etherscan.io/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://optimistic.etherscan.io/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://optimistic.etherscan.io/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://optimistic.etherscan.io/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://optimistic.etherscan.io/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://optimistic.etherscan.io/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://optimistic.etherscan.io/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3Polygon.sol b/src/AaveV3Polygon.sol index af634687..e11f3007 100644 --- a/src/AaveV3Polygon.sol +++ b/src/AaveV3Polygon.sol @@ -611,3 +611,26 @@ library AaveV3PolygonEModes { uint8 internal constant ETH_CORRELATED = 3; } + +library AaveV3PolygonExternalLibraries { + // https://polygonscan.com/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://polygonscan.com/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://polygonscan.com/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://polygonscan.com/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://polygonscan.com/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://polygonscan.com/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://polygonscan.com/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/AaveV3PolygonZkEvm.sol b/src/AaveV3PolygonZkEvm.sol index 7ab4ce0c..e5658a6b 100644 --- a/src/AaveV3PolygonZkEvm.sol +++ b/src/AaveV3PolygonZkEvm.sol @@ -105,4 +105,6 @@ library AaveV3PolygonZkEvm { library AaveV3PolygonZkEvmAssets {} -library AaveV3PolygonZkEvmEModes {} +library AaveV3PolygonZkEvmEModes { + uint8 internal constant NONE = 0; +} diff --git a/src/AaveV3Scroll.sol b/src/AaveV3Scroll.sol index 120cd88b..611da1e6 100644 --- a/src/AaveV3Scroll.sol +++ b/src/AaveV3Scroll.sol @@ -172,3 +172,26 @@ library AaveV3ScrollEModes { uint8 internal constant ETH_CORRELATED = 1; } + +library AaveV3ScrollExternalLibraries { + // https://scrollscan.com/address/0x6DA8d7EF0625e965dafc393793C048096392d4a5 + address internal constant FLASHLOAN_LOGIC = 0x6DA8d7EF0625e965dafc393793C048096392d4a5; + + // https://scrollscan.com/address/0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1 + address internal constant BORROW_LOGIC = 0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1; + + // https://scrollscan.com/address/0xca2385754bCa5d632F5160B560352aBd12029685 + address internal constant BRIDGE_LOGIC = 0xca2385754bCa5d632F5160B560352aBd12029685; + + // https://scrollscan.com/address/0x12959a64470Dd003590Bb1EcFC436dddE7608724 + address internal constant E_MODE_LOGIC = 0x12959a64470Dd003590Bb1EcFC436dddE7608724; + + // https://scrollscan.com/address/0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e + address internal constant LIQUIDATION_LOGIC = 0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e; + + // https://scrollscan.com/address/0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975 + address internal constant POOL_LOGIC = 0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975; + + // https://scrollscan.com/address/0x9336943ecd91C201D9ED5A21562b34Aef710052f + address internal constant SUPPLY_LOGIC = 0x9336943ecd91C201D9ED5A21562b34Aef710052f; +} diff --git a/src/common/ICrossChainController.sol b/src/common/ICrossChainController.sol index 0326e758..4cfa0c82 100644 --- a/src/common/ICrossChainController.sol +++ b/src/common/ICrossChainController.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IRescuable} from './IRescuable.sol'; +import {IRescuable} from 'solidity-utils/contracts/utils/interfaces/IRescuable.sol'; library EnumerableSet { // To implement this library for multiple types with as little code diff --git a/src/common/IRescuable.sol b/src/common/IRescuable.sol deleted file mode 100644 index 56c101fb..00000000 --- a/src/common/IRescuable.sol +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.8; - -/** - * @title IRescuable - * @author BGD Labs - * @notice interface containing the objects, events and methods definitions of the Rescuable contract - */ -interface IRescuable { - /** - * @notice emitted when erc20 tokens get rescued - * @param caller address that triggers the rescue - * @param token address of the rescued token - * @param to address that will receive the rescued tokens - * @param amount quantity of tokens rescued - */ - event ERC20Rescued( - address indexed caller, - address indexed token, - address indexed to, - uint256 amount - ); - - /** - * @notice emitted when native tokens get rescued - * @param caller address that triggers the rescue - * @param to address that will receive the rescued tokens - * @param amount quantity of tokens rescued - */ - event NativeTokensRescued(address indexed caller, address indexed to, uint256 amount); - - /** - * @notice method called to rescue tokens sent erroneously to the contract. Only callable by owner - * @param erc20Token address of the token to rescue - * @param to address to send the tokens - * @param amount of tokens to rescue - */ - function emergencyTokenTransfer(address erc20Token, address to, uint256 amount) external; - - /** - * @notice method called to rescue ether sent erroneously to the contract. Only callable by owner - * @param to address to send the eth - * @param amount of eth to rescue - */ - function emergencyEtherTransfer(address to, uint256 amount) external; - - /** - * @notice method that defines the address that is allowed to rescue tokens - * @return the allowed address - */ - function whoCanRescue() external view returns (address); -} diff --git a/src/common/IWithGuardian.sol b/src/common/IWithGuardian.sol deleted file mode 100644 index f2102dd2..00000000 --- a/src/common/IWithGuardian.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.7.0; - -interface IWithGuardian { - /** - * @dev Event emitted when guardian gets updated - * @param oldGuardian address of previous guardian - * @param newGuardian address of the new guardian - */ - event GuardianUpdated(address oldGuardian, address newGuardian); - - /** - * @dev get guardian address; - */ - function guardian() external view returns (address); - - /** - * @dev method to update the guardian - * @param newGuardian the new guardian address - */ - function updateGuardian(address newGuardian) external; -} diff --git a/src/test/AaveV2Ethereum.t.sol b/src/test/AaveV2Ethereum.t.sol index 74f94340..edcf191c 100644 --- a/src/test/AaveV2Ethereum.t.sol +++ b/src/test/AaveV2Ethereum.t.sol @@ -3,8 +3,11 @@ pragma solidity >=0.6.0; import 'forge-std/Test.sol'; import {AaveV2Ethereum} from '../AaveAddressBook.sol'; -// import is unnecessary here, but needed somewhere in the project so we can infer the abi from build artifacts +// imports are unused but required so forge inspect can find the source code import {IERC20Detailed} from 'aave-v3-origin/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol'; +import {IWithGuardian} from 'solidity-utils/contracts/access-control/interfaces/IWithGuardian.sol'; +import {IStaticATokenFactory} from 'aave-v3-origin/periphery/contracts/static-a-token/interfaces/IStaticATokenFactory.sol'; +import {IStaticATokenLM} from 'aave-v3-origin/periphery/contracts/static-a-token/interfaces/IStaticATokenLM.sol'; contract AaveAddressBookTest is Test { function setUp() public {} diff --git a/src/ts/AaveAddressBook.ts b/src/ts/AaveAddressBook.ts index ba71d937..0683edab 100644 --- a/src/ts/AaveAddressBook.ts +++ b/src/ts/AaveAddressBook.ts @@ -86,6 +86,8 @@ export {IPool_ABI} from './abis/IPool'; export {IPoolAddressesProvider_ABI} from './abis/IPoolAddressesProvider'; export {IPoolConfigurator_ABI} from './abis/IPoolConfigurator'; export {IStakeToken_ABI} from './abis/IStakeToken'; +export {IStaticATokenFactory_ABI} from './abis/IStaticATokenFactory'; +export {IStaticATokenLM_ABI} from './abis/IStaticATokenLM'; export {IPayloadsControllerDataHelper_ABI} from './abis/IPayloadsControllerDataHelper'; export {IGovernanceDataHelper_ABI} from './abis/IGovernanceDataHelper'; export {IMetaDelegateHelper_ABI} from './abis/IMetaDelegateHelper'; @@ -94,5 +96,3 @@ export {IUiPoolDataProvider_ABI} from './abis/IUiPoolDataProvider'; export {IAaveToken_ABI} from './abis/IAaveToken'; export {IStkAaveToken_ABI} from './abis/IStkAaveToken'; export {IATokenWithDelegation_ABI} from './abis/IATokenWithDelegation'; -export {IStaticATokenFactory_ABI} from './abis/IStaticATokenFactory'; -export {IStaticATokenLM_ABI} from './abis/IStaticATokenLM'; diff --git a/src/ts/AaveV3Arbitrum.ts b/src/ts/AaveV3Arbitrum.ts index 9d34f108..b3afee8d 100644 --- a/src/ts/AaveV3Arbitrum.ts +++ b/src/ts/AaveV3Arbitrum.ts @@ -271,3 +271,12 @@ export const E_MODES = { STABLECOINS: 1, ETH_CORRELATED: 2, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3Avalanche.ts b/src/ts/AaveV3Avalanche.ts index 76ecfc8f..e87a0d12 100644 --- a/src/ts/AaveV3Avalanche.ts +++ b/src/ts/AaveV3Avalanche.ts @@ -217,3 +217,12 @@ export const E_MODES = { STABLECOINS: 1, AVAX_CORRELATED: 2, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3BNB.ts b/src/ts/AaveV3BNB.ts index a25d269b..82998607 100644 --- a/src/ts/AaveV3BNB.ts +++ b/src/ts/AaveV3BNB.ts @@ -159,3 +159,12 @@ export const ASSETS = { export const E_MODES = { NONE: 0, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3Base.ts b/src/ts/AaveV3Base.ts index 7644f090..3642766f 100644 --- a/src/ts/AaveV3Base.ts +++ b/src/ts/AaveV3Base.ts @@ -157,3 +157,12 @@ export const E_MODES = { NONE: 0, ETH_CORRELATED: 1, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3Ethereum.ts b/src/ts/AaveV3Ethereum.ts index f074a654..fad5e299 100644 --- a/src/ts/AaveV3Ethereum.ts +++ b/src/ts/AaveV3Ethereum.ts @@ -405,3 +405,12 @@ export const E_MODES = { NONE: 0, ETH_CORRELATED: 1, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3EthereumLido.ts b/src/ts/AaveV3EthereumLido.ts index f4d1d3e0..090856de 100644 --- a/src/ts/AaveV3EthereumLido.ts +++ b/src/ts/AaveV3EthereumLido.ts @@ -96,5 +96,15 @@ export const ASSETS = { }, } as const; export const E_MODES = { + NONE: 0, ETH_CORRELATED: 1, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3Gnosis.ts b/src/ts/AaveV3Gnosis.ts index 0e51d791..b3fdb97d 100644 --- a/src/ts/AaveV3Gnosis.ts +++ b/src/ts/AaveV3Gnosis.ts @@ -148,3 +148,12 @@ export const E_MODES = { NONE: 0, ETH_CORRELATED: 1, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3Metis.ts b/src/ts/AaveV3Metis.ts index c462a279..d71355fd 100644 --- a/src/ts/AaveV3Metis.ts +++ b/src/ts/AaveV3Metis.ts @@ -130,3 +130,12 @@ export const ASSETS = { export const E_MODES = { NONE: 0, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3Optimism.ts b/src/ts/AaveV3Optimism.ts index b9b93bdc..080ad546 100644 --- a/src/ts/AaveV3Optimism.ts +++ b/src/ts/AaveV3Optimism.ts @@ -237,3 +237,12 @@ export const E_MODES = { STABLECOINS: 1, ETH_CORRELATED: 2, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3Polygon.ts b/src/ts/AaveV3Polygon.ts index 92f2ebc8..a52eaa96 100644 --- a/src/ts/AaveV3Polygon.ts +++ b/src/ts/AaveV3Polygon.ts @@ -302,3 +302,12 @@ export const E_MODES = { MATIC_CORRELATED: 2, ETH_CORRELATED: 3, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/AaveV3PolygonZkEvm.ts b/src/ts/AaveV3PolygonZkEvm.ts index 4e2ed811..3ec3c1d9 100644 --- a/src/ts/AaveV3PolygonZkEvm.ts +++ b/src/ts/AaveV3PolygonZkEvm.ts @@ -88,4 +88,6 @@ export const WITHDRAW_SWAP_ADAPTER = '0x06C35Cfd3FC61eC2aC437f0d08840d5776b945af export const CHAIN_ID = 1101; export const ASSETS = {} as const; -export const E_MODES = {} as const; +export const E_MODES = { + NONE: 0, +} as const; diff --git a/src/ts/AaveV3Scroll.ts b/src/ts/AaveV3Scroll.ts index 1f0e5ed1..071cf6a1 100644 --- a/src/ts/AaveV3Scroll.ts +++ b/src/ts/AaveV3Scroll.ts @@ -114,3 +114,12 @@ export const E_MODES = { NONE: 0, ETH_CORRELATED: 1, } as const; +export const EXTERNAL_LIBRARIES = { + FLASHLOAN_LOGIC: '0x6DA8d7EF0625e965dafc393793C048096392d4a5', + BORROW_LOGIC: '0x41717de714Db8630F02Dea8f6A39C73A5b5C7df1', + BRIDGE_LOGIC: '0xca2385754bCa5d632F5160B560352aBd12029685', + E_MODE_LOGIC: '0x12959a64470Dd003590Bb1EcFC436dddE7608724', + LIQUIDATION_LOGIC: '0x72c272aE914EC11AFe1e74A0016e0A91c1A6014e', + POOL_LOGIC: '0x55D552EFbc8aEB87AffCEa8630B43a33BA24D975', + SUPPLY_LOGIC: '0x9336943ecd91C201D9ED5A21562b34Aef710052f', +} as const; diff --git a/src/ts/abis/IERC20.ts b/src/ts/abis/IERC20.ts index 73358b27..b3d0c449 100644 --- a/src/ts/abis/IERC20.ts +++ b/src/ts/abis/IERC20.ts @@ -85,7 +85,7 @@ export const IERC20_ABI = [ name: 'transfer', inputs: [ { - name: 'recipient', + name: 'to', type: 'address', internalType: 'address', }, @@ -109,12 +109,12 @@ export const IERC20_ABI = [ name: 'transferFrom', inputs: [ { - name: 'sender', + name: 'from', type: 'address', internalType: 'address', }, { - name: 'recipient', + name: 'to', type: 'address', internalType: 'address', }, diff --git a/src/ts/abis/IPool.ts b/src/ts/abis/IPool.ts index e5f6a7a2..32dbf07e 100644 --- a/src/ts/abis/IPool.ts +++ b/src/ts/abis/IPool.ts @@ -351,7 +351,7 @@ export const IPool_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -364,7 +364,7 @@ export const IPool_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -449,7 +449,7 @@ export const IPool_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -462,7 +462,7 @@ export const IPool_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -494,7 +494,7 @@ export const IPool_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -507,7 +507,7 @@ export const IPool_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -819,7 +819,7 @@ export const IPool_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', diff --git a/src/ts/abis/IStaticATokenFactory.ts b/src/ts/abis/IStaticATokenFactory.ts index 518b6ecd..dbf87213 100644 --- a/src/ts/abis/IStaticATokenFactory.ts +++ b/src/ts/abis/IStaticATokenFactory.ts @@ -1,83 +1,5 @@ // AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR export const IStaticATokenFactory_ABI = [ - { - type: 'constructor', - inputs: [ - { - name: 'pool', - type: 'address', - internalType: 'contract IPool', - }, - { - name: 'proxyAdmin', - type: 'address', - internalType: 'address', - }, - { - name: 'transparentProxyFactory', - type: 'address', - internalType: 'contract ITransparentProxyFactory', - }, - { - name: 'staticATokenImpl', - type: 'address', - internalType: 'address', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - name: 'ADMIN', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'address', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'POOL', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'contract IPool', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'STATIC_A_TOKEN_IMPL', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'address', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'TRANSPARENT_PROXY_FACTORY', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'contract ITransparentProxyFactory', - }, - ], - stateMutability: 'view', - }, { type: 'function', name: 'createStaticATokens', @@ -129,43 +51,4 @@ export const IStaticATokenFactory_ABI = [ ], stateMutability: 'view', }, - { - type: 'function', - name: 'initialize', - inputs: [], - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'event', - name: 'Initialized', - inputs: [ - { - name: 'version', - type: 'uint8', - indexed: false, - internalType: 'uint8', - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'StaticTokenCreated', - inputs: [ - { - name: 'staticAToken', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - ], - anonymous: false, - }, ] as const; diff --git a/src/ts/abis/IStaticATokenLM.ts b/src/ts/abis/IStaticATokenLM.ts index 73fc6f7b..1d8562bf 100644 --- a/src/ts/abis/IStaticATokenLM.ts +++ b/src/ts/abis/IStaticATokenLM.ts @@ -1,99 +1,5 @@ // AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR export const IStaticATokenLM_ABI = [ - { - type: 'constructor', - inputs: [ - { - name: 'pool', - type: 'address', - internalType: 'contract IPool', - }, - { - name: 'rewardsController', - type: 'address', - internalType: 'contract IRewardsController', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - name: 'DOMAIN_SEPARATOR', - inputs: [], - outputs: [ - { - name: '', - type: 'bytes32', - internalType: 'bytes32', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'INCENTIVES_CONTROLLER', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'contract IRewardsController', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'METADEPOSIT_TYPEHASH', - inputs: [], - outputs: [ - { - name: '', - type: 'bytes32', - internalType: 'bytes32', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'METAWITHDRAWAL_TYPEHASH', - inputs: [], - outputs: [ - { - name: '', - type: 'bytes32', - internalType: 'bytes32', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'POOL', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'contract IPool', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'STATIC__ATOKEN_LM_REVISION', - inputs: [], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, { type: 'function', name: 'aToken', @@ -107,86 +13,6 @@ export const IStaticATokenLM_ABI = [ ], stateMutability: 'view', }, - { - type: 'function', - name: 'allowance', - inputs: [ - { - name: '', - type: 'address', - internalType: 'address', - }, - { - name: '', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'approve', - inputs: [ - { - name: 'spender', - type: 'address', - internalType: 'address', - }, - { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'bool', - internalType: 'bool', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - name: 'asset', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'address', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'balanceOf', - inputs: [ - { - name: '', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, { type: 'function', name: 'claimRewards', @@ -260,57 +86,6 @@ export const IStaticATokenLM_ABI = [ ], stateMutability: 'nonpayable', }, - { - type: 'function', - name: 'convertToAssets', - inputs: [ - { - name: 'shares', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'convertToShares', - inputs: [ - { - name: 'assets', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'decimals', - inputs: [], - outputs: [ - { - name: '', - type: 'uint8', - internalType: 'uint8', - }, - ], - stateMutability: 'view', - }, { type: 'function', name: 'deposit', @@ -345,30 +120,6 @@ export const IStaticATokenLM_ABI = [ ], stateMutability: 'nonpayable', }, - { - type: 'function', - name: 'deposit', - inputs: [ - { - name: 'assets', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'receiver', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'nonpayable', - }, { type: 'function', name: 'getClaimableRewards', @@ -460,7 +211,7 @@ export const IStaticATokenLM_ABI = [ name: 'initialize', inputs: [ { - name: 'newAToken', + name: 'aToken', type: 'address', internalType: 'address', }, @@ -499,103 +250,27 @@ export const IStaticATokenLM_ABI = [ }, { type: 'function', - name: 'maxDeposit', + name: 'metaDeposit', inputs: [ { - name: '', + name: 'depositor', type: 'address', internalType: 'address', }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'maxMint', - inputs: [ { - name: '', + name: 'receiver', type: 'address', internalType: 'address', }, - ], - outputs: [ { - name: '', + name: 'assets', type: 'uint256', internalType: 'uint256', }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'maxRedeem', - inputs: [ { - name: 'owner', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'maxWithdraw', - inputs: [ - { - name: 'owner', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'metaDeposit', - inputs: [ - { - name: 'depositor', - type: 'address', - internalType: 'address', - }, - { - name: 'receiver', - type: 'address', - internalType: 'address', - }, - { - name: 'assets', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'referralCode', - type: 'uint16', - internalType: 'uint16', + name: 'referralCode', + type: 'uint16', + internalType: 'uint16', }, { name: 'depositToAave', @@ -752,181 +427,6 @@ export const IStaticATokenLM_ABI = [ ], stateMutability: 'nonpayable', }, - { - type: 'function', - name: 'mint', - inputs: [ - { - name: 'shares', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'receiver', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - name: 'name', - inputs: [], - outputs: [ - { - name: '', - type: 'string', - internalType: 'string', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'nonces', - inputs: [ - { - name: '', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'permit', - inputs: [ - { - name: 'owner', - type: 'address', - internalType: 'address', - }, - { - name: 'spender', - type: 'address', - internalType: 'address', - }, - { - name: 'value', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'deadline', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'v', - type: 'uint8', - internalType: 'uint8', - }, - { - name: 'r', - type: 'bytes32', - internalType: 'bytes32', - }, - { - name: 's', - type: 'bytes32', - internalType: 'bytes32', - }, - ], - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - name: 'previewDeposit', - inputs: [ - { - name: 'assets', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'previewMint', - inputs: [ - { - name: 'shares', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'previewRedeem', - inputs: [ - { - name: 'shares', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'previewWithdraw', - inputs: [ - { - name: 'assets', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, { type: 'function', name: 'rate', @@ -940,35 +440,6 @@ export const IStaticATokenLM_ABI = [ ], stateMutability: 'view', }, - { - type: 'function', - name: 'redeem', - inputs: [ - { - name: 'shares', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'receiver', - type: 'address', - internalType: 'address', - }, - { - name: 'owner', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'nonpayable', - }, { type: 'function', name: 'redeem', @@ -1028,196 +499,6 @@ export const IStaticATokenLM_ABI = [ ], stateMutability: 'view', }, - { - type: 'function', - name: 'symbol', - inputs: [], - outputs: [ - { - name: '', - type: 'string', - internalType: 'string', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'totalAssets', - inputs: [], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'totalSupply', - inputs: [], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - name: 'transfer', - inputs: [ - { - name: 'to', - type: 'address', - internalType: 'address', - }, - { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'bool', - internalType: 'bool', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - name: 'transferFrom', - inputs: [ - { - name: 'from', - type: 'address', - internalType: 'address', - }, - { - name: 'to', - type: 'address', - internalType: 'address', - }, - { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - type: 'bool', - internalType: 'bool', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'function', - name: 'withdraw', - inputs: [ - { - name: 'assets', - type: 'uint256', - internalType: 'uint256', - }, - { - name: 'receiver', - type: 'address', - internalType: 'address', - }, - { - name: 'owner', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'nonpayable', - }, - { - type: 'event', - name: 'Approval', - inputs: [ - { - name: 'owner', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'spender', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Deposit', - inputs: [ - { - name: 'sender', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'owner', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'assets', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - { - name: 'shares', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Initialized', - inputs: [ - { - name: 'version', - type: 'uint8', - indexed: false, - internalType: 'uint8', - }, - ], - anonymous: false, - }, { type: 'event', name: 'Initialized', @@ -1262,77 +543,4 @@ export const IStaticATokenLM_ABI = [ ], anonymous: false, }, - { - type: 'event', - name: 'Transfer', - inputs: [ - { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Withdraw', - inputs: [ - { - name: 'sender', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'receiver', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'owner', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'assets', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - { - name: 'shares', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - anonymous: false, - }, - { - type: 'error', - name: 'SafeERC20FailedOperation', - inputs: [ - { - name: 'token', - type: 'address', - internalType: 'address', - }, - ], - }, ] as const;