From c943505943cc55cd9fd2d981a27b17c595fb82b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 07:39:51 +0000 Subject: [PATCH 1/3] chore(deps): bump lib/aave-v3-origin from `6948864` to `105baaf` Bumps [lib/aave-v3-origin](https://github.com/aave-dao/aave-v3-origin) from `6948864` to `105baaf`. - [Commits](https://github.com/aave-dao/aave-v3-origin/compare/6948864fc7e74b2b29fadfe2007998992060f84b...105baafdb65ab700859b55f2280530cc767cc0dc) --- updated-dependencies: - dependency-name: lib/aave-v3-origin dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- lib/aave-v3-origin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aave-v3-origin b/lib/aave-v3-origin index 6948864f..105baafd 160000 --- a/lib/aave-v3-origin +++ b/lib/aave-v3-origin @@ -1 +1 @@ -Subproject commit 6948864fc7e74b2b29fadfe2007998992060f84b +Subproject commit 105baafdb65ab700859b55f2280530cc767cc0dc From 0f4ceffd97bf54e6b6fdeace58787af580f25628 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 17 Sep 2024 11:00:13 +0200 Subject: [PATCH 2/3] feat: add new abis --- scripts/configs/abis.ts | 9 +- scripts/generateABIs.ts | 6 +- src/AaveV2.sol | 2 - src/common/AggregatorInterface.sol | 18 - src/test/AaveV2Ethereum.t.sol | 4 +- src/ts/abis/ICrossChainController.ts | 19 + src/ts/abis/IERC20.ts | 6 +- src/ts/abis/IPoolConfigurator.ts | 6 +- src/ts/abis/IRescuable.ts | 19 + src/ts/abis/IStataTokenFactory.ts | 65 ++ src/ts/abis/IStataTokenV2.ts | 1136 ++++++++++++++++++++++++++ 11 files changed, 1256 insertions(+), 34 deletions(-) delete mode 100644 src/common/AggregatorInterface.sol create mode 100644 src/ts/abis/IStataTokenFactory.ts create mode 100644 src/ts/abis/IStataTokenV2.ts diff --git a/scripts/configs/abis.ts b/scripts/configs/abis.ts index dc987214..c095ffb6 100644 --- a/scripts/configs/abis.ts +++ b/scripts/configs/abis.ts @@ -3,6 +3,7 @@ import {mainnetProtoV3Pool} from './pools/ethereum'; /** * @dev These abis can be inferred directly from code as they exist as a dependency + * For contracts that are not unique, the path needs to be prefixed */ export const ABI_INTERFACES = [ 'ICollector', @@ -15,11 +16,11 @@ export const ABI_INTERFACES = [ 'IGovernancePowerStrategy', 'IDataWarehouse', 'IExecutorWithTimelock', - 'IERC20', + 'lib/aave-v3-origin/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol:IERC20', 'IERC20Detailed', 'IAToken', 'IDefaultInterestRateStrategy', - 'IAaveOracle', + 'lib/aave-v3-origin/src/core/contracts/interfaces/IAaveOracle.sol:IAaveOracle', 'IExecutor', 'ICrossChainController', 'IWithGuardian', @@ -32,8 +33,8 @@ export const ABI_INTERFACES = [ 'IPoolAddressesProvider', 'IPoolConfigurator', 'IStakeToken', - 'IStaticATokenFactory', - 'IStaticATokenLM', + 'IStataTokenFactory', + 'IStataTokenV2', ]; /** diff --git a/scripts/generateABIs.ts b/scripts/generateABIs.ts index 08409239..da9d33ab 100644 --- a/scripts/generateABIs.ts +++ b/scripts/generateABIs.ts @@ -15,8 +15,10 @@ export async function generateABIs(removeExisting: boolean) { } else { mkdirSync('./src/ts/abis'); } - for (const INTERFACE of ABI_INTERFACES) { - const {stdout, stderr} = await awaitableExec(`forge inspect ${INTERFACE} abi`); + for (const INTERFACE_PATH of ABI_INTERFACES) { + const {stdout, stderr} = await awaitableExec(`forge inspect ${INTERFACE_PATH} abi`); + const INTERFACE = + INTERFACE_PATH.split(':').length > 1 ? INTERFACE_PATH.split(':')[1] : INTERFACE_PATH; if (stderr) { throw new Error(`Failed to generate abi for ${INTERFACE}`); } diff --git a/src/AaveV2.sol b/src/AaveV2.sol index be889d7d..d7239489 100644 --- a/src/AaveV2.sol +++ b/src/AaveV2.sol @@ -2,8 +2,6 @@ pragma solidity >=0.6.0; pragma experimental ABIEncoderV2; -import {AggregatorInterface} from './common/AggregatorInterface.sol'; - library DataTypes { // refer to the whitepaper, section 1.1 basic concepts for a formal description of these properties. struct ReserveData { diff --git a/src/common/AggregatorInterface.sol b/src/common/AggregatorInterface.sol deleted file mode 100644 index ac9998e1..00000000 --- a/src/common/AggregatorInterface.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.6.0; - -interface AggregatorInterface { - function latestAnswer() external view returns (int256); - - function latestTimestamp() external view returns (uint256); - - function latestRound() external view returns (uint256); - - function getAnswer(uint256 roundId) external view returns (int256); - - function getTimestamp(uint256 roundId) external view returns (uint256); - - event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt); - - event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); -} diff --git a/src/test/AaveV2Ethereum.t.sol b/src/test/AaveV2Ethereum.t.sol index edcf191c..92cd5829 100644 --- a/src/test/AaveV2Ethereum.t.sol +++ b/src/test/AaveV2Ethereum.t.sol @@ -6,8 +6,8 @@ import {AaveV2Ethereum} from '../AaveAddressBook.sol'; // 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'; +import {IStataTokenFactory} from 'aave-v3-origin/periphery/contracts/static-a-token/interfaces/IStataTokenFactory.sol'; +import {IStataTokenV2} from 'aave-v3-origin/periphery/contracts/static-a-token/interfaces/IStataTokenV2.sol'; contract AaveAddressBookTest is Test { function setUp() public {} diff --git a/src/ts/abis/ICrossChainController.ts b/src/ts/abis/ICrossChainController.ts index be9f3bbf..cdef52a0 100644 --- a/src/ts/abis/ICrossChainController.ts +++ b/src/ts/abis/ICrossChainController.ts @@ -694,6 +694,25 @@ export const ICrossChainController_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'maxRescue', + inputs: [ + { + name: 'erc20Token', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, { type: 'function', name: 'receiveCrossChainMessage', diff --git a/src/ts/abis/IERC20.ts b/src/ts/abis/IERC20.ts index b3d0c449..73358b27 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: 'to', + name: 'recipient', type: 'address', internalType: 'address', }, @@ -109,12 +109,12 @@ export const IERC20_ABI = [ name: 'transferFrom', inputs: [ { - name: 'from', + name: 'sender', type: 'address', internalType: 'address', }, { - name: 'to', + name: 'recipient', type: 'address', internalType: 'address', }, diff --git a/src/ts/abis/IPoolConfigurator.ts b/src/ts/abis/IPoolConfigurator.ts index 9c9f0405..8b27d187 100644 --- a/src/ts/abis/IPoolConfigurator.ts +++ b/src/ts/abis/IPoolConfigurator.ts @@ -11,7 +11,7 @@ export const IPoolConfigurator_ABI = [ internalType: 'uint40', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -78,7 +78,7 @@ export const IPoolConfigurator_ABI = [ internalType: 'address', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -97,7 +97,7 @@ export const IPoolConfigurator_ABI = [ internalType: 'uint256', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', diff --git a/src/ts/abis/IRescuable.ts b/src/ts/abis/IRescuable.ts index fd64f3fe..73eaf807 100644 --- a/src/ts/abis/IRescuable.ts +++ b/src/ts/abis/IRescuable.ts @@ -41,6 +41,25 @@ export const IRescuable_ABI = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + name: 'maxRescue', + inputs: [ + { + name: 'erc20Token', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, { type: 'function', name: 'whoCanRescue', diff --git a/src/ts/abis/IStataTokenFactory.ts b/src/ts/abis/IStataTokenFactory.ts new file mode 100644 index 00000000..41991966 --- /dev/null +++ b/src/ts/abis/IStataTokenFactory.ts @@ -0,0 +1,65 @@ +// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR +export const IStataTokenFactory_ABI = [ + { + type: 'function', + name: 'createStataTokens', + inputs: [ + { + name: 'underlyings', + type: 'address[]', + internalType: 'address[]', + }, + ], + outputs: [ + { + name: '', + type: 'address[]', + internalType: 'address[]', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'getStataToken', + inputs: [ + { + name: 'underlying', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'address', + internalType: 'address', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'getStataTokens', + inputs: [], + outputs: [ + { + name: '', + type: 'address[]', + internalType: 'address[]', + }, + ], + stateMutability: 'view', + }, + { + type: 'error', + name: 'NotListedUnderlying', + inputs: [ + { + name: 'underlying', + type: 'address', + internalType: 'address', + }, + ], + }, +] as const; diff --git a/src/ts/abis/IStataTokenV2.ts b/src/ts/abis/IStataTokenV2.ts new file mode 100644 index 00000000..a5bc85ae --- /dev/null +++ b/src/ts/abis/IStataTokenV2.ts @@ -0,0 +1,1136 @@ +// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR +export const IStataTokenV2_ABI = [ + { + type: 'function', + name: 'DOMAIN_SEPARATOR', + inputs: [], + outputs: [ + { + name: '', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'aToken', + inputs: [], + outputs: [ + { + name: '', + type: 'address', + internalType: 'contract IERC20', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'allowance', + inputs: [ + { + name: 'owner', + type: 'address', + internalType: 'address', + }, + { + name: 'spender', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'approve', + inputs: [ + { + name: 'spender', + type: 'address', + internalType: 'address', + }, + { + name: 'value', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [ + { + name: '', + type: 'bool', + internalType: 'bool', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'asset', + inputs: [], + outputs: [ + { + name: 'assetTokenAddress', + type: 'address', + internalType: 'address', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'balanceOf', + inputs: [ + { + name: 'account', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'canPause', + inputs: [ + { + name: 'actor', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'bool', + internalType: 'bool', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'claimRewards', + inputs: [ + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + { + name: 'rewards', + type: 'address[]', + internalType: 'address[]', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'claimRewardsOnBehalf', + inputs: [ + { + name: 'onBehalfOf', + type: 'address', + internalType: 'address', + }, + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + { + name: 'rewards', + type: 'address[]', + internalType: 'address[]', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'claimRewardsToSelf', + inputs: [ + { + name: 'rewards', + type: 'address[]', + internalType: 'address[]', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'collectAndUpdateRewards', + inputs: [ + { + name: 'reward', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'convertToAssets', + inputs: [ + { + name: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'convertToShares', + inputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [ + { + name: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'decimals', + inputs: [], + outputs: [ + { + name: '', + type: 'uint8', + internalType: 'uint8', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'deposit', + inputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'depositATokens', + inputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'depositWithPermit', + inputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + { + name: 'deadline', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'sig', + type: 'tuple', + internalType: 'struct IERC4626StataToken.SignatureParams', + components: [ + { + name: 'v', + type: 'uint8', + internalType: 'uint8', + }, + { + name: 'r', + type: 'bytes32', + internalType: 'bytes32', + }, + { + name: 's', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + }, + { + name: 'depositToAave', + type: 'bool', + internalType: 'bool', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'getClaimableRewards', + inputs: [ + { + name: 'user', + type: 'address', + internalType: 'address', + }, + { + name: 'reward', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'getCurrentRewardsIndex', + inputs: [ + { + name: 'reward', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'getReferenceAsset', + inputs: [], + outputs: [ + { + name: '', + type: 'address', + internalType: 'address', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'getTotalClaimableRewards', + inputs: [ + { + name: 'reward', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'getUnclaimedRewards', + inputs: [ + { + name: 'user', + type: 'address', + internalType: 'address', + }, + { + name: 'reward', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'isRegisteredRewardToken', + inputs: [ + { + name: 'reward', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: '', + type: 'bool', + internalType: 'bool', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'latestAnswer', + inputs: [], + outputs: [ + { + name: '', + type: 'int256', + internalType: 'int256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'maxDeposit', + inputs: [ + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: 'maxAssets', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'maxMint', + inputs: [ + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: 'maxShares', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'maxRedeem', + inputs: [ + { + name: 'owner', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: 'maxShares', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'maxWithdraw', + inputs: [ + { + name: 'owner', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: 'maxAssets', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'mint', + inputs: [ + { + name: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + { + name: 'receiver', + type: 'address', + internalType: 'address', + }, + ], + outputs: [ + { + name: 'assets', + 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: 'owner', + 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: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'previewMint', + inputs: [ + { + name: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'previewRedeem', + inputs: [ + { + name: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'previewWithdraw', + inputs: [ + { + name: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [ + { + name: 'shares', + type: 'uint256', + internalType: 'uint256', + }, + ], + 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: 'assets', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'redeemATokens', + 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: 'refreshRewardTokens', + inputs: [], + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'rewardTokens', + inputs: [], + outputs: [ + { + name: '', + type: 'address[]', + internalType: 'address[]', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'setPaused', + inputs: [ + { + name: 'paused', + type: 'bool', + internalType: 'bool', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'symbol', + inputs: [], + outputs: [ + { + name: '', + type: 'string', + internalType: 'string', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'totalAssets', + inputs: [], + outputs: [ + { + name: 'totalManagedAssets', + 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: 'value', + 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: 'value', + 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: 'shares', + 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: 'value', + 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: 'RewardTokenRegistered', + inputs: [ + { + name: 'reward', + type: 'address', + indexed: true, + internalType: 'address', + }, + { + name: 'startIndex', + type: 'uint256', + indexed: false, + internalType: 'uint256', + }, + ], + anonymous: false, + }, + { + type: 'event', + name: 'Transfer', + inputs: [ + { + name: 'from', + type: 'address', + indexed: true, + internalType: 'address', + }, + { + name: 'to', + type: 'address', + indexed: true, + internalType: 'address', + }, + { + name: 'value', + 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: 'InvalidClaimer', + inputs: [ + { + name: 'claimer', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'OnlyPauseGuardian', + inputs: [ + { + name: 'caller', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'PoolAddressMismatch', + inputs: [ + { + name: 'pool', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'RewardNotInitialized', + inputs: [ + { + name: 'reward', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'StaticATokenInvalidZeroShares', + inputs: [], + }, +] as const; From 743705985ba6c2307566e576f00cb8238d1d7a66 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 17 Sep 2024 11:17:14 +0200 Subject: [PATCH 3/3] fix: patch abi generation --- safe.csv | 12 ++++++------ scripts/generateABIs.ts | 1 + scripts/generator/abis.ts | 4 +++- src/AaveV2Polygon.sol | 24 ++++++++++++------------ src/ts/AaveAddressBook.ts | 4 ++-- src/ts/AaveV2Polygon.ts | 12 ++++++------ 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/safe.csv b/safe.csv index e1398153..ad5843a3 100644 --- a/safe.csv +++ b/safe.csv @@ -1201,37 +1201,37 @@ address,name,chainId 0x27F8D03b3a2196956ED754baDc28D73be8830A6e,AaveV2Polygon ASSETS DAI A_TOKEN,137 0x2238101B7014C279aaF6b408A284E49cDBd5DB55,AaveV2Polygon ASSETS DAI S_TOKEN,137 0x75c4d1Fb84429023170086f06E682DcbBF537b7d,AaveV2Polygon ASSETS DAI V_TOKEN,137 -0xa68fF0Ee7Bac9bD5cf68667fBEf0870804Fce734,AaveV2Polygon ASSETS DAI INTEREST_RATE_STRATEGY,137 +0x3697E0090B392A924359450aad26eD612e522d51,AaveV2Polygon ASSETS DAI INTEREST_RATE_STRATEGY,137 0x08EDd9E1DF3b0b8498864C60a2FD6cDb13148885,AaveV2Polygon ASSETS DAI ORACLE,137 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174,AaveV2Polygon ASSETS USDC UNDERLYING,137 0x1a13F4Ca1d028320A707D99520AbFefca3998b7F,AaveV2Polygon ASSETS USDC A_TOKEN,137 0xdeb05676dB0DB85cecafE8933c903466Bf20C572,AaveV2Polygon ASSETS USDC S_TOKEN,137 0x248960A9d75EdFa3de94F7193eae3161Eb349a12,AaveV2Polygon ASSETS USDC V_TOKEN,137 -0xc7A565fec411b6fB2F974dd79552Cd038d5Bc575,AaveV2Polygon ASSETS USDC INTEREST_RATE_STRATEGY,137 +0xF8956d286a1f15bf4D90B741C1d065bDA5E4a8a6,AaveV2Polygon ASSETS USDC INTEREST_RATE_STRATEGY,137 0xB611AA5E98112C7c3711Ca3a5187dC025B83C8e4,AaveV2Polygon ASSETS USDC ORACLE,137 0xc2132D05D31c914a87C6611C10748AEb04B58e8F,AaveV2Polygon ASSETS USDT UNDERLYING,137 0x60D55F02A771d515e077c9C2403a1ef324885CeC,AaveV2Polygon ASSETS USDT A_TOKEN,137 0xe590cfca10e81FeD9B0e4496381f02256f5d2f61,AaveV2Polygon ASSETS USDT S_TOKEN,137 0x8038857FD47108A07d1f6Bf652ef1cBeC279A2f3,AaveV2Polygon ASSETS USDT V_TOKEN,137 -0x38580592Fd23E5cc6FF5c3c76966733A43e69120,AaveV2Polygon ASSETS USDT INTEREST_RATE_STRATEGY,137 +0x1481acF39Ea31B0853f5FBdace6368B0FCd2a3E4,AaveV2Polygon ASSETS USDT INTEREST_RATE_STRATEGY,137 0xf840c80932908EF206056dF0882bC595e7150607,AaveV2Polygon ASSETS USDT ORACLE,137 0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6,AaveV2Polygon ASSETS WBTC UNDERLYING,137 0x5c2ed810328349100A66B82b78a1791B101C9D61,AaveV2Polygon ASSETS WBTC A_TOKEN,137 0x2551B15dB740dB8348bFaDFe06830210eC2c2F13,AaveV2Polygon ASSETS WBTC S_TOKEN,137 0xF664F50631A6f0D72ecdaa0e49b0c019Fa72a8dC,AaveV2Polygon ASSETS WBTC V_TOKEN,137 -0x588DEd8C297DE231005028553f902FA60B4535d7,AaveV2Polygon ASSETS WBTC INTEREST_RATE_STRATEGY,137 +0x2384F4cD894A474AA5F2D591C74513d6360bF9aF,AaveV2Polygon ASSETS WBTC INTEREST_RATE_STRATEGY,137 0xA338e0492B2F944E9F8C0653D3AD1484f2657a37,AaveV2Polygon ASSETS WBTC ORACLE,137 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619,AaveV2Polygon ASSETS WETH UNDERLYING,137 0x28424507fefb6f7f8E9D3860F56504E4e5f5f390,AaveV2Polygon ASSETS WETH A_TOKEN,137 0xc478cBbeB590C76b01ce658f8C4dda04f30e2C6f,AaveV2Polygon ASSETS WETH S_TOKEN,137 0xeDe17e9d79fc6f9fF9250D9EEfbdB88Cc18038b5,AaveV2Polygon ASSETS WETH V_TOKEN,137 -0xca2D6f36F395b72DC16506a65e65f94F14455cAd,AaveV2Polygon ASSETS WETH INTEREST_RATE_STRATEGY,137 +0x1Cb00e80e45b6F0983AD6a4387dD1c5767a0Da28,AaveV2Polygon ASSETS WETH INTEREST_RATE_STRATEGY,137 0x0000000000000000000000000000000000000000,AaveV2Polygon ASSETS WETH ORACLE,137 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270,AaveV2Polygon ASSETS WMATIC UNDERLYING,137 0x8dF3aad3a84da6b69A4DA8aeC3eA40d9091B2Ac4,AaveV2Polygon ASSETS WMATIC A_TOKEN,137 0xb9A6E29fB540C5F1243ef643EB39b0AcbC2e68E3,AaveV2Polygon ASSETS WMATIC S_TOKEN,137 0x59e8E9100cbfCBCBAdf86b9279fa61526bBB8765,AaveV2Polygon ASSETS WMATIC V_TOKEN,137 -0x24EFC8B78763aDb295f59bF86A03e4857720B6e4,AaveV2Polygon ASSETS WMATIC INTEREST_RATE_STRATEGY,137 +0x38Df903141cb0d6Fd6fD79270A727bf1b9c31ebb,AaveV2Polygon ASSETS WMATIC INTEREST_RATE_STRATEGY,137 0x327e23A4855b6F663a28c5161541d69Af8973302,AaveV2Polygon ASSETS WMATIC ORACLE,137 0xD6DF932A45C0f255f85145f286eA0b292B21C90B,AaveV2Polygon ASSETS AAVE UNDERLYING,137 0x1d2a0E5EC8E5bBDCA5CB219e649B565d8e5c3360,AaveV2Polygon ASSETS AAVE A_TOKEN,137 diff --git a/scripts/generateABIs.ts b/scripts/generateABIs.ts index da9d33ab..50b2aefc 100644 --- a/scripts/generateABIs.ts +++ b/scripts/generateABIs.ts @@ -15,6 +15,7 @@ export async function generateABIs(removeExisting: boolean) { } else { mkdirSync('./src/ts/abis'); } + const imports: string[] = []; for (const INTERFACE_PATH of ABI_INTERFACES) { const {stdout, stderr} = await awaitableExec(`forge inspect ${INTERFACE_PATH} abi`); const INTERFACE = diff --git a/scripts/generator/abis.ts b/scripts/generator/abis.ts index b45f2076..3b5104a8 100644 --- a/scripts/generator/abis.ts +++ b/scripts/generator/abis.ts @@ -2,7 +2,9 @@ import {ABI_INTERFACES, DOWNLOAD_ABI_INTERFACES} from '../configs/abis'; export function generateABIImports() { const jsExports: string[] = []; - for (const INTERFACE of ABI_INTERFACES) { + for (const INTERFACE_PATH of ABI_INTERFACES) { + const INTERFACE = + INTERFACE_PATH.split(':').length > 1 ? INTERFACE_PATH.split(':')[1] : INTERFACE_PATH; const varName = `${INTERFACE}_ABI`; jsExports.push(`export {${varName}} from './abis/${INTERFACE}';`); } diff --git a/src/AaveV2Polygon.sol b/src/AaveV2Polygon.sol index 2b0f3377..0f207a49 100644 --- a/src/AaveV2Polygon.sol +++ b/src/AaveV2Polygon.sol @@ -108,8 +108,8 @@ library AaveV2PolygonAssets { // https://polygonscan.com/address/0x08EDd9E1DF3b0b8498864C60a2FD6cDb13148885 address internal constant DAI_ORACLE = 0x08EDd9E1DF3b0b8498864C60a2FD6cDb13148885; - // https://polygonscan.com/address/0xa68fF0Ee7Bac9bD5cf68667fBEf0870804Fce734 - address internal constant DAI_INTEREST_RATE_STRATEGY = 0xa68fF0Ee7Bac9bD5cf68667fBEf0870804Fce734; + // https://polygonscan.com/address/0x3697E0090B392A924359450aad26eD612e522d51 + address internal constant DAI_INTEREST_RATE_STRATEGY = 0x3697E0090B392A924359450aad26eD612e522d51; // https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 address internal constant USDC_UNDERLYING = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174; @@ -128,9 +128,9 @@ library AaveV2PolygonAssets { // https://polygonscan.com/address/0xB611AA5E98112C7c3711Ca3a5187dC025B83C8e4 address internal constant USDC_ORACLE = 0xB611AA5E98112C7c3711Ca3a5187dC025B83C8e4; - // https://polygonscan.com/address/0xc7A565fec411b6fB2F974dd79552Cd038d5Bc575 + // https://polygonscan.com/address/0xF8956d286a1f15bf4D90B741C1d065bDA5E4a8a6 address internal constant USDC_INTEREST_RATE_STRATEGY = - 0xc7A565fec411b6fB2F974dd79552Cd038d5Bc575; + 0xF8956d286a1f15bf4D90B741C1d065bDA5E4a8a6; // https://polygonscan.com/address/0xc2132D05D31c914a87C6611C10748AEb04B58e8F address internal constant USDT_UNDERLYING = 0xc2132D05D31c914a87C6611C10748AEb04B58e8F; @@ -149,9 +149,9 @@ library AaveV2PolygonAssets { // https://polygonscan.com/address/0xf840c80932908EF206056dF0882bC595e7150607 address internal constant USDT_ORACLE = 0xf840c80932908EF206056dF0882bC595e7150607; - // https://polygonscan.com/address/0x38580592Fd23E5cc6FF5c3c76966733A43e69120 + // https://polygonscan.com/address/0x1481acF39Ea31B0853f5FBdace6368B0FCd2a3E4 address internal constant USDT_INTEREST_RATE_STRATEGY = - 0x38580592Fd23E5cc6FF5c3c76966733A43e69120; + 0x1481acF39Ea31B0853f5FBdace6368B0FCd2a3E4; // https://polygonscan.com/address/0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6 address internal constant WBTC_UNDERLYING = 0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6; @@ -170,9 +170,9 @@ library AaveV2PolygonAssets { // https://polygonscan.com/address/0xA338e0492B2F944E9F8C0653D3AD1484f2657a37 address internal constant WBTC_ORACLE = 0xA338e0492B2F944E9F8C0653D3AD1484f2657a37; - // https://polygonscan.com/address/0x588DEd8C297DE231005028553f902FA60B4535d7 + // https://polygonscan.com/address/0x2384F4cD894A474AA5F2D591C74513d6360bF9aF address internal constant WBTC_INTEREST_RATE_STRATEGY = - 0x588DEd8C297DE231005028553f902FA60B4535d7; + 0x2384F4cD894A474AA5F2D591C74513d6360bF9aF; // https://polygonscan.com/address/0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619 address internal constant WETH_UNDERLYING = 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619; @@ -188,9 +188,9 @@ library AaveV2PolygonAssets { // https://polygonscan.com/address/0xc478cBbeB590C76b01ce658f8C4dda04f30e2C6f address internal constant WETH_S_TOKEN = 0xc478cBbeB590C76b01ce658f8C4dda04f30e2C6f; - // https://polygonscan.com/address/0xca2D6f36F395b72DC16506a65e65f94F14455cAd + // https://polygonscan.com/address/0x1Cb00e80e45b6F0983AD6a4387dD1c5767a0Da28 address internal constant WETH_INTEREST_RATE_STRATEGY = - 0xca2D6f36F395b72DC16506a65e65f94F14455cAd; + 0x1Cb00e80e45b6F0983AD6a4387dD1c5767a0Da28; // https://polygonscan.com/address/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270 address internal constant WMATIC_UNDERLYING = 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270; @@ -209,9 +209,9 @@ library AaveV2PolygonAssets { // https://polygonscan.com/address/0x327e23A4855b6F663a28c5161541d69Af8973302 address internal constant WMATIC_ORACLE = 0x327e23A4855b6F663a28c5161541d69Af8973302; - // https://polygonscan.com/address/0x24EFC8B78763aDb295f59bF86A03e4857720B6e4 + // https://polygonscan.com/address/0x38Df903141cb0d6Fd6fD79270A727bf1b9c31ebb address internal constant WMATIC_INTEREST_RATE_STRATEGY = - 0x24EFC8B78763aDb295f59bF86A03e4857720B6e4; + 0x38Df903141cb0d6Fd6fD79270A727bf1b9c31ebb; // https://polygonscan.com/address/0xD6DF932A45C0f255f85145f286eA0b292B21C90B address internal constant AAVE_UNDERLYING = 0xD6DF932A45C0f255f85145f286eA0b292B21C90B; diff --git a/src/ts/AaveAddressBook.ts b/src/ts/AaveAddressBook.ts index 2d6ee77a..3526640c 100644 --- a/src/ts/AaveAddressBook.ts +++ b/src/ts/AaveAddressBook.ts @@ -90,8 +90,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 {IStataTokenFactory_ABI} from './abis/IStataTokenFactory'; +export {IStataTokenV2_ABI} from './abis/IStataTokenV2'; export {IPayloadsControllerDataHelper_ABI} from './abis/IPayloadsControllerDataHelper'; export {IGovernanceDataHelper_ABI} from './abis/IGovernanceDataHelper'; export {IMetaDelegateHelper_ABI} from './abis/IMetaDelegateHelper'; diff --git a/src/ts/AaveV2Polygon.ts b/src/ts/AaveV2Polygon.ts index 376d1ad7..6955bbb5 100644 --- a/src/ts/AaveV2Polygon.ts +++ b/src/ts/AaveV2Polygon.ts @@ -82,7 +82,7 @@ export const ASSETS = { A_TOKEN: '0x27F8D03b3a2196956ED754baDc28D73be8830A6e', S_TOKEN: '0x2238101B7014C279aaF6b408A284E49cDBd5DB55', V_TOKEN: '0x75c4d1Fb84429023170086f06E682DcbBF537b7d', - INTEREST_RATE_STRATEGY: '0xa68fF0Ee7Bac9bD5cf68667fBEf0870804Fce734', + INTEREST_RATE_STRATEGY: '0x3697E0090B392A924359450aad26eD612e522d51', ORACLE: '0x08EDd9E1DF3b0b8498864C60a2FD6cDb13148885', }, USDC: { @@ -91,7 +91,7 @@ export const ASSETS = { A_TOKEN: '0x1a13F4Ca1d028320A707D99520AbFefca3998b7F', S_TOKEN: '0xdeb05676dB0DB85cecafE8933c903466Bf20C572', V_TOKEN: '0x248960A9d75EdFa3de94F7193eae3161Eb349a12', - INTEREST_RATE_STRATEGY: '0xc7A565fec411b6fB2F974dd79552Cd038d5Bc575', + INTEREST_RATE_STRATEGY: '0xF8956d286a1f15bf4D90B741C1d065bDA5E4a8a6', ORACLE: '0xB611AA5E98112C7c3711Ca3a5187dC025B83C8e4', }, USDT: { @@ -100,7 +100,7 @@ export const ASSETS = { A_TOKEN: '0x60D55F02A771d515e077c9C2403a1ef324885CeC', S_TOKEN: '0xe590cfca10e81FeD9B0e4496381f02256f5d2f61', V_TOKEN: '0x8038857FD47108A07d1f6Bf652ef1cBeC279A2f3', - INTEREST_RATE_STRATEGY: '0x38580592Fd23E5cc6FF5c3c76966733A43e69120', + INTEREST_RATE_STRATEGY: '0x1481acF39Ea31B0853f5FBdace6368B0FCd2a3E4', ORACLE: '0xf840c80932908EF206056dF0882bC595e7150607', }, WBTC: { @@ -109,7 +109,7 @@ export const ASSETS = { A_TOKEN: '0x5c2ed810328349100A66B82b78a1791B101C9D61', S_TOKEN: '0x2551B15dB740dB8348bFaDFe06830210eC2c2F13', V_TOKEN: '0xF664F50631A6f0D72ecdaa0e49b0c019Fa72a8dC', - INTEREST_RATE_STRATEGY: '0x588DEd8C297DE231005028553f902FA60B4535d7', + INTEREST_RATE_STRATEGY: '0x2384F4cD894A474AA5F2D591C74513d6360bF9aF', ORACLE: '0xA338e0492B2F944E9F8C0653D3AD1484f2657a37', }, WETH: { @@ -118,7 +118,7 @@ export const ASSETS = { A_TOKEN: '0x28424507fefb6f7f8E9D3860F56504E4e5f5f390', S_TOKEN: '0xc478cBbeB590C76b01ce658f8C4dda04f30e2C6f', V_TOKEN: '0xeDe17e9d79fc6f9fF9250D9EEfbdB88Cc18038b5', - INTEREST_RATE_STRATEGY: '0xca2D6f36F395b72DC16506a65e65f94F14455cAd', + INTEREST_RATE_STRATEGY: '0x1Cb00e80e45b6F0983AD6a4387dD1c5767a0Da28', ORACLE: '0x0000000000000000000000000000000000000000', }, WMATIC: { @@ -127,7 +127,7 @@ export const ASSETS = { A_TOKEN: '0x8dF3aad3a84da6b69A4DA8aeC3eA40d9091B2Ac4', S_TOKEN: '0xb9A6E29fB540C5F1243ef643EB39b0AcbC2e68E3', V_TOKEN: '0x59e8E9100cbfCBCBAdf86b9279fa61526bBB8765', - INTEREST_RATE_STRATEGY: '0x24EFC8B78763aDb295f59bF86A03e4857720B6e4', + INTEREST_RATE_STRATEGY: '0x38Df903141cb0d6Fd6fD79270A727bf1b9c31ebb', ORACLE: '0x327e23A4855b6F663a28c5161541d69Af8973302', }, AAVE: {