From 716d254fe2d3aec34e9eb3fd11562d0285541c86 Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Wed, 14 Dec 2022 19:15:22 +0100 Subject: [PATCH 1/3] fix: Update contracts of Aave core-v3.0.1 --- package-lock.json | 14 +++++++------- package.json | 2 +- .../interestStrategy/GhoInterestRateStrategy.sol | 10 ---------- .../facilitators/aave/tokens/GhoAToken.sol | 12 ++++++------ 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 37b77ed1..054b2bce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "dependencies": { "@aave/aave-token": "^1.0.4", - "@aave/core-v3": "1.16.2-beta.2", + "@aave/core-v3": "^1.16.2-beta.3", "@aave/deploy-v3": "1.51.0", "@aave/periphery-v3": "1.21.4", "@aave/safety-module": "github:aave/aave-stake-v2#b9e40fb1c14df7e3874e4def53860d0f53c1d958", @@ -53,9 +53,9 @@ } }, "node_modules/@aave/core-v3": { - "version": "1.16.2-beta.2", - "resolved": "https://registry.npmjs.org/@aave/core-v3/-/core-v3-1.16.2-beta.2.tgz", - "integrity": "sha512-7do3gRDrcJPoqKZ6FGGdEv2vMXxGgysYh2q8qsFs8Mdm6w+eDEa1uEklwOh0NX9qSw7+ikl3Mvhi3p0QYp8K4Q==", + "version": "1.16.2-beta.3", + "resolved": "https://registry.npmjs.org/@aave/core-v3/-/core-v3-1.16.2-beta.3.tgz", + "integrity": "sha512-QtCI6fII+DRYpUs858XSyGOihipeyb/9B2HEZWs9o4xEMqMixeMKvpkRLajQkvcvcoX4h8a8PqescSxYoGYZqA==", "engines": { "node": ">=16.0.0" } @@ -21968,9 +21968,9 @@ } }, "@aave/core-v3": { - "version": "1.16.2-beta.2", - "resolved": "https://registry.npmjs.org/@aave/core-v3/-/core-v3-1.16.2-beta.2.tgz", - "integrity": "sha512-7do3gRDrcJPoqKZ6FGGdEv2vMXxGgysYh2q8qsFs8Mdm6w+eDEa1uEklwOh0NX9qSw7+ikl3Mvhi3p0QYp8K4Q==" + "version": "1.16.2-beta.3", + "resolved": "https://registry.npmjs.org/@aave/core-v3/-/core-v3-1.16.2-beta.3.tgz", + "integrity": "sha512-QtCI6fII+DRYpUs858XSyGOihipeyb/9B2HEZWs9o4xEMqMixeMKvpkRLajQkvcvcoX4h8a8PqescSxYoGYZqA==" }, "@aave/deploy-v3": { "version": "1.51.0", diff --git a/package.json b/package.json index aab2134f..2f32c754 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ }, "dependencies": { "@aave/aave-token": "^1.0.4", - "@aave/core-v3": "1.16.2-beta.2", + "@aave/core-v3": "^1.16.2-beta.3", "@aave/deploy-v3": "1.51.0", "@aave/periphery-v3": "1.21.4", "@aave/safety-module": "github:aave/aave-stake-v2#b9e40fb1c14df7e3874e4def53860d0f53c1d958", diff --git a/src/contracts/facilitators/aave/interestStrategy/GhoInterestRateStrategy.sol b/src/contracts/facilitators/aave/interestStrategy/GhoInterestRateStrategy.sol index 2bd427f9..96f5ddfe 100644 --- a/src/contracts/facilitators/aave/interestStrategy/GhoInterestRateStrategy.sol +++ b/src/contracts/facilitators/aave/interestStrategy/GhoInterestRateStrategy.sol @@ -22,16 +22,6 @@ contract GhoInterestRateStrategy is IReserveInterestRateStrategy { _variableBorrowRate = variableBorrowRate; } - /// @inheritdoc IReserveInterestRateStrategy - function getBaseVariableBorrowRate() external view override returns (uint256) { - return _variableBorrowRate; - } - - /// @inheritdoc IReserveInterestRateStrategy - function getMaxVariableBorrowRate() external view override returns (uint256) { - return _variableBorrowRate; - } - /// @inheritdoc IReserveInterestRateStrategy function calculateInterestRates(DataTypes.CalculateInterestRatesParams memory params) public diff --git a/src/contracts/facilitators/aave/tokens/GhoAToken.sol b/src/contracts/facilitators/aave/tokens/GhoAToken.sol index ce42fd47..678ed934 100644 --- a/src/contracts/facilitators/aave/tokens/GhoAToken.sol +++ b/src/contracts/facilitators/aave/tokens/GhoAToken.sol @@ -112,7 +112,7 @@ contract GhoAToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base } /// @inheritdoc IAToken - function mintToTreasury(uint256 amount, uint256 index) external override onlyPool { + function mintToTreasury(uint256 amount, uint256 index) external virtual override onlyPool { revert('OPERATION_NOT_PERMITTED'); } @@ -121,7 +121,7 @@ contract GhoAToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base address from, address to, uint256 value - ) external override onlyPool { + ) external virtual override onlyPool { revert('OPERATION_NOT_PERMITTED'); } @@ -166,14 +166,14 @@ contract GhoAToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base /// @inheritdoc IAToken function handleRepayment( address user, - address onBehalf, + address onBehalfOf, uint256 amount ) external virtual override onlyPool { - uint256 balanceFromInterest = _ghoVariableDebtToken.getBalanceFromInterest(onBehalf); + uint256 balanceFromInterest = _ghoVariableDebtToken.getBalanceFromInterest(onBehalfOf); if (amount <= balanceFromInterest) { - _repayInterest(onBehalf, amount); + _repayInterest(onBehalfOf, amount); } else { - _repayInterest(onBehalf, balanceFromInterest); + _repayInterest(onBehalfOf, balanceFromInterest); IERC20Burnable(_underlyingAsset).burn(amount - balanceFromInterest); } } From 933dc543662794a9930e38421e2db522920d0a75 Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Wed, 14 Dec 2022 19:15:36 +0100 Subject: [PATCH 2/3] fix: Remove unneeded file --- .../tokens/interfaces/IAaveIncentivesController.sol | 10 ---------- .../aave/tokens/interfaces/IGhoVariableDebtToken.sol | 1 + 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 src/contracts/facilitators/aave/tokens/interfaces/IAaveIncentivesController.sol diff --git a/src/contracts/facilitators/aave/tokens/interfaces/IAaveIncentivesController.sol b/src/contracts/facilitators/aave/tokens/interfaces/IAaveIncentivesController.sol deleted file mode 100644 index 29283019..00000000 --- a/src/contracts/facilitators/aave/tokens/interfaces/IAaveIncentivesController.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: agpl-3.0 -pragma solidity ^0.8.0; - -interface IAaveIncentivesController { - function handleAction( - address user, - uint256 userBalance, - uint256 totalSupply - ) external; -} diff --git a/src/contracts/facilitators/aave/tokens/interfaces/IGhoVariableDebtToken.sol b/src/contracts/facilitators/aave/tokens/interfaces/IGhoVariableDebtToken.sol index 083ce1ec..5107cfad 100644 --- a/src/contracts/facilitators/aave/tokens/interfaces/IGhoVariableDebtToken.sol +++ b/src/contracts/facilitators/aave/tokens/interfaces/IGhoVariableDebtToken.sol @@ -1,5 +1,6 @@ // SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.0; + import {IVariableDebtToken} from '@aave/core-v3/contracts/interfaces/IVariableDebtToken.sol'; /** From 241d2913593635be5d85196e57d80eb5d5614a15 Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Wed, 14 Dec 2022 19:53:08 +0100 Subject: [PATCH 3/3] fix: Fix the version of aave core-v3 package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2f32c754..2c5530d3 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ }, "dependencies": { "@aave/aave-token": "^1.0.4", - "@aave/core-v3": "^1.16.2-beta.3", + "@aave/core-v3": "1.16.2-beta.3", "@aave/deploy-v3": "1.51.0", "@aave/periphery-v3": "1.21.4", "@aave/safety-module": "github:aave/aave-stake-v2#b9e40fb1c14df7e3874e4def53860d0f53c1d958",