From d17c77451adb7aa1826b4711e4e59ad5bc7d576e Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 9 Oct 2024 10:23:28 +0200 Subject: [PATCH 1/3] feat: mock stable debt token --- src/contracts/instances/PoolInstance.sol | 2 +- src/contracts/protocol/pool/Pool.sol | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/contracts/instances/PoolInstance.sol b/src/contracts/instances/PoolInstance.sol index 4b1596d8..02eafdd1 100644 --- a/src/contracts/instances/PoolInstance.sol +++ b/src/contracts/instances/PoolInstance.sol @@ -6,7 +6,7 @@ import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {Errors} from '../protocol/libraries/helpers/Errors.sol'; contract PoolInstance is Pool { - uint256 public constant POOL_REVISION = 5; + uint256 public constant POOL_REVISION = 6; constructor(IPoolAddressesProvider provider) Pool(provider) {} diff --git a/src/contracts/protocol/pool/Pool.sol b/src/contracts/protocol/pool/Pool.sol index f4a9812e..9629c6a3 100644 --- a/src/contracts/protocol/pool/Pool.sol +++ b/src/contracts/protocol/pool/Pool.sol @@ -450,6 +450,10 @@ abstract contract Pool is VersionedInitializable, PoolStorage, IPool { res.accruedToTreasury = reserve.accruedToTreasury; res.unbacked = reserve.unbacked; res.isolationModeTotalDebt = reserve.isolationModeTotalDebt; + // This is a temporary workaround for integrations that are broken by Aave 3.2 + // While the new pool data provider is backward compatible, some integrations hard-code an old implementation + // To allow them to unlock the funds, the pool address provider is setting a stable debt token, so balanceOf() and totalSupply() will return zero instead of reverting + res.stableDebtTokenAddress = ADDRESSES_PROVIDER.getAddress(bytes32('MOCK_STABLE_DEBT')); return res; } From 181fcd32eb02e83f79902f010153b29136fa00cb Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 9 Oct 2024 11:42:19 +0200 Subject: [PATCH 2/3] Update src/contracts/protocol/pool/Pool.sol Co-authored-by: Ernesto Boado --- src/contracts/protocol/pool/Pool.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/protocol/pool/Pool.sol b/src/contracts/protocol/pool/Pool.sol index 9629c6a3..72445e47 100644 --- a/src/contracts/protocol/pool/Pool.sol +++ b/src/contracts/protocol/pool/Pool.sol @@ -452,7 +452,7 @@ abstract contract Pool is VersionedInitializable, PoolStorage, IPool { res.isolationModeTotalDebt = reserve.isolationModeTotalDebt; // This is a temporary workaround for integrations that are broken by Aave 3.2 // While the new pool data provider is backward compatible, some integrations hard-code an old implementation - // To allow them to unlock the funds, the pool address provider is setting a stable debt token, so balanceOf() and totalSupply() will return zero instead of reverting + // To allow them to not have any infrastructural blocker, a mock must be configured in the Aave Pool Addresses Provider, returning zero on all required view methods, instead of reverting res.stableDebtTokenAddress = ADDRESSES_PROVIDER.getAddress(bytes32('MOCK_STABLE_DEBT')); return res; } From 43fcb6bcc30809bc96d2d722d7112886e0bdf28d Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 9 Oct 2024 11:43:12 +0200 Subject: [PATCH 3/3] fix: lint error --- certora/stata/harness/pool/SymbolicLendingPool.sol | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/certora/stata/harness/pool/SymbolicLendingPool.sol b/certora/stata/harness/pool/SymbolicLendingPool.sol index 1051ae1e..c64d5874 100644 --- a/certora/stata/harness/pool/SymbolicLendingPool.sol +++ b/certora/stata/harness/pool/SymbolicLendingPool.sol @@ -93,10 +93,7 @@ contract SymbolicLendingPool { return reserve.configuration; } - function getVirtualUnderlyingBalance( - address asset - ) external view virtual returns (uint128) { + function getVirtualUnderlyingBalance(address asset) external view virtual returns (uint128) { return reserve.virtualUnderlyingBalance; } - }