From 9a8eb294a0f1f21376e39b357e0ef192bedccaf4 Mon Sep 17 00:00:00 2001 From: Hadrien Charlanes Date: Tue, 27 Apr 2021 19:04:29 +0200 Subject: [PATCH] fix: borrowCap from 16 to 32 bits --- .../protocol/libraries/configuration/ReserveConfiguration.sol | 4 ++-- contracts/protocol/libraries/types/DataTypes.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/protocol/libraries/configuration/ReserveConfiguration.sol b/contracts/protocol/libraries/configuration/ReserveConfiguration.sol index 188bee66..e7ab9da9 100644 --- a/contracts/protocol/libraries/configuration/ReserveConfiguration.sol +++ b/contracts/protocol/libraries/configuration/ReserveConfiguration.sol @@ -19,7 +19,7 @@ library ReserveConfiguration { uint256 constant BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFF; // prettier-ignore uint256 constant STABLE_BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFF; // prettier-ignore uint256 constant RESERVE_FACTOR_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFF; // prettier-ignore - uint256 constant BORROW_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFF; // prettier-ignore + uint256 constant BORROW_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFFFFFF; // prettier-ignore /// @dev For the LTV, the start bit is 0 (up to 15), hence no bitshifting is needed uint256 constant LIQUIDATION_THRESHOLD_START_BIT_POSITION = 16; @@ -37,7 +37,7 @@ library ReserveConfiguration { uint256 constant MAX_VALID_LIQUIDATION_BONUS = 65535; uint256 constant MAX_VALID_DECIMALS = 255; uint256 constant MAX_VALID_RESERVE_FACTOR = 65535; - uint256 constant MAX_VALID_BORROW_CAP = 65535; + uint256 constant MAX_VALID_BORROW_CAP = 4294967296; /** * @dev Sets the Loan to Value of the reserve diff --git a/contracts/protocol/libraries/types/DataTypes.sol b/contracts/protocol/libraries/types/DataTypes.sol index 6cf8b913..93ad017d 100644 --- a/contracts/protocol/libraries/types/DataTypes.sol +++ b/contracts/protocol/libraries/types/DataTypes.sol @@ -38,7 +38,7 @@ library DataTypes { //bit 59: stable rate borrowing enabled //bit 60-63: reserved //bit 64-79: reserve factor - //bit 80-95 borrow cap + //bit 80-111 borrow cap uint256 data; }