diff --git a/GNOSIS_CELO/AAVE_PROTOCOL_DATA_PROVIDER_DIFF.md b/GNOSIS_CELO/AAVE_PROTOCOL_DATA_PROVIDER_DIFF.md index ae334d9a..42df441f 100644 --- a/GNOSIS_CELO/AAVE_PROTOCOL_DATA_PROVIDER_DIFF.md +++ b/GNOSIS_CELO/AAVE_PROTOCOL_DATA_PROVIDER_DIFF.md @@ -3,139 +3,5 @@ diff --git a/./downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER.sol b/./downloads/CE index ef1c828..0540bfa 100644 --- a/./downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER.sol +++ b/./downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: MIT - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -331,7 +331,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -438,7 +438,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -457,7 +457,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -533,7 +533,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -760,7 +760,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -832,7 +832,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -958,7 +958,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -968,7 +968,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/interfaces/IPoolDataProvider.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/interfaces/IPoolDataProvider.sol - - /** - * @title IPoolDataProvider -@@ -1223,7 +1223,7 @@ interface IPoolDataProvider { - function getReserveDeficit(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/interfaces/IPool.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2091,7 +2091,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -2675,7 +2675,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -2907,7 +2907,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -2956,7 +2956,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -2999,7 +2999,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/lib/aave-v3-origin/src/contracts/helpers/AaveProtocolDataProvider.sol -+// downloads/CELO/AAVE_PROTOCOL_DATA_PROVIDER/AaveProtocolDataProvider/src/contracts/helpers/AaveProtocolDataProvider.sol - - /** - * @title AaveProtocolDataProvider + ``` diff --git a/GNOSIS_CELO/ACL_MANAGER_DIFF.md b/GNOSIS_CELO/ACL_MANAGER_DIFF.md index 8b3a157d..2d8b4075 100644 --- a/GNOSIS_CELO/ACL_MANAGER_DIFF.md +++ b/GNOSIS_CELO/ACL_MANAGER_DIFF.md @@ -3,144 +3,5 @@ diff --git a/./downloads/GNOSIS/ACL_MANAGER.sol b/./downloads/CELO/ACL_MANAGER.s index 5f26b31..aba09ce 100644 --- a/./downloads/GNOSIS/ACL_MANAGER.sol +++ b/./downloads/CELO/ACL_MANAGER.sol -@@ -1,7 +1,7 @@ --// SPDX-License-Identifier: MIT -+// SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -24,7 +24,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -62,17 +62,14 @@ library Errors { - string public constant RESERVE_FROZEN = '28'; // 'Action cannot be performed because the reserve is frozen' - string public constant RESERVE_PAUSED = '29'; // 'Action cannot be performed because the reserve is paused' - string public constant BORROWING_NOT_ENABLED = '30'; // 'Borrowing is not enabled' -- string public constant STABLE_BORROWING_NOT_ENABLED = '31'; // 'Stable borrowing is not enabled' - string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '32'; // 'User cannot withdraw more than the available balance' - string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '33'; // 'Invalid interest rate mode selected' - string public constant COLLATERAL_BALANCE_IS_ZERO = '34'; // 'The collateral balance is 0' - string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '35'; // 'Health factor is lesser than the liquidation threshold' - string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '36'; // 'There is not enough collateral to cover a new borrow' - string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '37'; // 'Collateral is (mostly) the same currency that is being borrowed' -- string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '38'; // 'The requested amount is greater than the max loan size in stable rate mode' - string public constant NO_DEBT_OF_SELECTED_TYPE = '39'; // 'For repayment of a specific type of debt, the user needs to have debt that type' - string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '40'; // 'To repay on behalf of a user an explicit amount to repay is needed' -- string public constant NO_OUTSTANDING_STABLE_DEBT = '41'; // 'User does not have outstanding stable rate debt on this reserve' - string public constant NO_OUTSTANDING_VARIABLE_DEBT = '42'; // 'User does not have outstanding variable rate debt on this reserve' - string public constant UNDERLYING_BALANCE_ZERO = '43'; // 'The underlying balance needs to be greater than 0' - string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '44'; // 'Interest rate rebalance conditions were not met' -@@ -85,7 +82,6 @@ library Errors { - string public constant UNBACKED_MINT_CAP_EXCEEDED = '52'; // 'Unbacked mint cap is exceeded' - string public constant DEBT_CEILING_EXCEEDED = '53'; // 'Debt ceiling is exceeded' - string public constant UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO = '54'; // 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)' -- string public constant STABLE_DEBT_NOT_ZERO = '55'; // 'Stable debt supply is not zero' - string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '56'; // 'Variable debt supply is not zero' - string public constant LTV_VALIDATION_FAILED = '57'; // 'Ltv validation failed' - string public constant INCONSISTENT_EMODE_CATEGORY = '58'; // 'Inconsistent eMode category' -@@ -114,17 +110,28 @@ library Errors { - string public constant DEBT_CEILING_NOT_ZERO = '81'; // 'Debt ceiling is not zero' - string public constant ASSET_NOT_LISTED = '82'; // 'Asset is not listed' - string public constant INVALID_OPTIMAL_USAGE_RATIO = '83'; // 'Invalid optimal usage ratio' -- string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '84'; // 'Invalid optimal stable to total debt ratio' - string public constant UNDERLYING_CANNOT_BE_RESCUED = '85'; // 'The underlying asset cannot be rescued' - string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '86'; // 'Reserve has already been added to reserve list' - string public constant POOL_ADDRESSES_DO_NOT_MATCH = '87'; // 'The token implementation pool address and the pool address provided by the initializing pool do not match' -- string public constant STABLE_BORROWING_ENABLED = '88'; // 'Stable borrowing is enabled' - string public constant SILOED_BORROWING_VIOLATION = '89'; // 'User is trying to borrow multiple assets including a siloed one' - string public constant RESERVE_DEBT_NOT_ZERO = '90'; // the total debt of the reserve needs to be 0 - string public constant FLASHLOAN_DISABLED = '91'; // FlashLoaning for this asset is disabled -+ string public constant INVALID_MAX_RATE = '92'; // The expect maximum borrow rate is invalid -+ string public constant WITHDRAW_TO_ATOKEN = '93'; // Withdrawing to the aToken is not allowed -+ string public constant SUPPLY_TO_ATOKEN = '94'; // Supplying to the aToken is not allowed -+ string public constant SLOPE_2_MUST_BE_GTE_SLOPE_1 = '95'; // Variable interest rate slope 2 can not be lower than slope 1 -+ string public constant CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN = '96'; // 'The caller of the function is not a risk, pool or emergency admin' -+ string public constant LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED = '97'; // 'Liquidation grace sentinel validation failed' -+ string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range -+ string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state -+ string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -214,7 +221,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/dependencies/openzeppelin/contracts/IERC165.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/dependencies/openzeppelin/contracts/IERC165.sol - - /** - * @dev Interface of the ERC165 standard, as defined in the -@@ -237,7 +244,7 @@ interface IERC165 { - function supportsInterface(bytes4 interfaceId) external view returns (bool); - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -464,7 +471,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/dependencies/openzeppelin/contracts/Strings.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/dependencies/openzeppelin/contracts/Strings.sol - - /** - * @dev String operations. -@@ -529,7 +536,7 @@ library Strings { - } - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/dependencies/openzeppelin/contracts/ERC165.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/dependencies/openzeppelin/contracts/ERC165.sol - - /** - * @dev Implementation of the {IERC165} interface. -@@ -554,7 +561,7 @@ abstract contract ERC165 is IERC165 { - } - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/interfaces/IACLManager.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -727,7 +734,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/dependencies/openzeppelin/contracts/AccessControl.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/dependencies/openzeppelin/contracts/AccessControl.sol - - /** - * @dev Contract module that allows children to implement role-based access -@@ -937,7 +944,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { - } - } - --// downloads/GNOSIS/ACL_MANAGER/ACLManager/src/core/contracts/protocol/configuration/ACLManager.sol -+// downloads/CELO/ACL_MANAGER/ACLManager/src/contracts/protocol/configuration/ACLManager.sol - - /** - * @title ACLManager + ``` diff --git a/GNOSIS_CELO/BORROW_LOGIC_DIFF.md b/GNOSIS_CELO/BORROW_LOGIC_DIFF.md index c984d17c..160eff95 100644 --- a/GNOSIS_CELO/BORROW_LOGIC_DIFF.md +++ b/GNOSIS_CELO/BORROW_LOGIC_DIFF.md @@ -3,310 +3,5 @@ diff --git a/./downloads/GNOSIS/BORROW_LOGIC.sol b/./downloads/CELO/BORROW_LOGIC index 6281b07..9fc8b47 100644 --- a/./downloads/GNOSIS/BORROW_LOGIC.sol +++ b/./downloads/CELO/BORROW_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1638,7 +1638,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1751,7 +1751,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1924,7 +1924,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1934,7 +1934,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -1999,7 +1999,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2026,7 +2026,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2123,7 +2123,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2991,7 +2991,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3575,7 +3575,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3624,7 +3624,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3856,7 +3856,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3909,7 +3909,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3958,7 +3958,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol - - /** - * @title IsolationModeLogic library -@@ -4033,7 +4033,7 @@ library IsolationModeLogic { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4076,7 +4076,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4210,7 +4210,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4433,7 +4433,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4735,7 +4735,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library -@@ -4797,7 +4797,7 @@ library EModeLogic { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -5049,7 +5049,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5669,7 +5669,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/BorrowLogic.sol -+// downloads/CELO/BORROW_LOGIC/BorrowLogic/src/contracts/protocol/libraries/logic/BorrowLogic.sol - - /** - * @title BorrowLogic library + ``` diff --git a/GNOSIS_CELO/BRIDGE_LOGIC_DIFF.md b/GNOSIS_CELO/BRIDGE_LOGIC_DIFF.md index c99bb694..eaaaf028 100644 --- a/GNOSIS_CELO/BRIDGE_LOGIC_DIFF.md +++ b/GNOSIS_CELO/BRIDGE_LOGIC_DIFF.md @@ -3,301 +3,5 @@ diff --git a/./downloads/GNOSIS/BRIDGE_LOGIC.sol b/./downloads/CELO/BRIDGE_LOGIC index cc4e36b..1347edb 100644 --- a/./downloads/GNOSIS/BRIDGE_LOGIC.sol +++ b/./downloads/CELO/BRIDGE_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1638,7 +1638,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1751,7 +1751,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1924,7 +1924,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1934,7 +1934,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -1999,7 +1999,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2026,7 +2026,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2123,7 +2123,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2991,7 +2991,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3575,7 +3575,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3624,7 +3624,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3856,7 +3856,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3909,7 +3909,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3958,7 +3958,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4001,7 +4001,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4135,7 +4135,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4358,7 +4358,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4660,7 +4660,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library -@@ -4722,7 +4722,7 @@ library EModeLogic { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -4974,7 +4974,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5594,7 +5594,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/BridgeLogic.sol -+// downloads/CELO/BRIDGE_LOGIC/BridgeLogic/src/contracts/protocol/libraries/logic/BridgeLogic.sol - - /** - * @title BridgeLogic library + ``` diff --git a/GNOSIS_CELO/COLLECTOR_IMPL_DIFF.md b/GNOSIS_CELO/COLLECTOR_IMPL_DIFF.md index daf185e8..d2b684fe 100644 --- a/GNOSIS_CELO/COLLECTOR_IMPL_DIFF.md +++ b/GNOSIS_CELO/COLLECTOR_IMPL_DIFF.md @@ -3,13 +3,10 @@ diff --git a/./downloads/GNOSIS/COLLECTOR_IMPL.sol b/./downloads/CELO/COLLECTOR_ index 2ac55c8..7a7eb91 100644 --- a/./downloads/GNOSIS/COLLECTOR_IMPL.sol +++ b/./downloads/CELO/COLLECTOR_IMPL.sol -@@ -659,7 +659,7 @@ abstract contract ContextUpgradeable is Initializable { - } - } - + -// downloads/GNOSIS/COLLECTOR_IMPL/CollectorWithCustomImpl/lib/aave-v3-origin/src/contracts/treasury/ICollector.sol +// downloads/CELO/COLLECTOR_IMPL/Collector/src/contracts/treasury/ICollector.sol - + interface ICollector { struct Stream { @@ -722,7 +722,7 @@ interface ICollector { @@ -18,16 +15,16 @@ index 2ac55c8..7a7eb91 100644 */ - error OnlyFundsAdminOrRceipient(); + error OnlyFundsAdminOrRecipient(); - + /** * @dev The provided ID does not belong to an existing stream @@ -1553,7 +1553,7 @@ library SafeERC20 { } } - + -// downloads/GNOSIS/COLLECTOR_IMPL/CollectorWithCustomImpl/lib/aave-v3-origin/src/contracts/treasury/Collector.sol +// downloads/CELO/COLLECTOR_IMPL/Collector/src/contracts/treasury/Collector.sol - + /** * @title Collector @@ -1616,7 +1616,7 @@ contract Collector is AccessControlUpgradeable, ReentrancyGuardUpgradeable, ICol diff --git a/GNOSIS_CELO/CONFIGURATOR_LOGIC_DIFF.md b/GNOSIS_CELO/CONFIGURATOR_LOGIC_DIFF.md index 3e4a8453..fb6804ed 100644 --- a/GNOSIS_CELO/CONFIGURATOR_LOGIC_DIFF.md +++ b/GNOSIS_CELO/CONFIGURATOR_LOGIC_DIFF.md @@ -3,175 +3,5 @@ diff --git a/./downloads/GNOSIS/CONFIGURATOR_LOGIC.sol b/./downloads/CELO/CONFIG index a05116a..98c05e0 100644 --- a/./downloads/GNOSIS/CONFIGURATOR_LOGIC.sol +++ b/./downloads/CELO/CONFIGURATOR_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol - - library ConfiguratorInputTypes { - struct InitReserveInput { -@@ -260,7 +260,7 @@ library ConfiguratorInputTypes { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -590,7 +590,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -697,7 +697,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -716,7 +716,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -792,7 +792,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1019,7 +1019,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol - - /** - * @title Proxy -@@ -1100,7 +1100,7 @@ abstract contract Proxy { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1110,7 +1110,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -1137,7 +1137,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol - - /** - * @title BaseUpgradeabilityProxy -@@ -1200,7 +1200,7 @@ contract BaseUpgradeabilityProxy is Proxy { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2068,7 +2068,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -2652,7 +2652,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol - - /** - * @title BaseImmutableAdminUpgradeabilityProxy -@@ -2735,7 +2735,7 @@ contract BaseImmutableAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol - - /** - * @title InitializableUpgradeabilityProxy -@@ -2762,7 +2762,7 @@ contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -2815,7 +2815,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -2864,7 +2864,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol - - /** - * @title InitializableAdminUpgradeabilityProxy -@@ -2889,7 +2889,7 @@ contract InitializableImmutableAdminUpgradeabilityProxy is - } - } - --// downloads/GNOSIS/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol -+// downloads/CELO/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol - - /** - * @title ConfiguratorLogic library + ``` diff --git a/GNOSIS_CELO/DEFAULT_A_TOKEN_IMPL_DIFF.md b/GNOSIS_CELO/DEFAULT_A_TOKEN_IMPL_DIFF.md index 14b735cd..f469dc14 100644 --- a/GNOSIS_CELO/DEFAULT_A_TOKEN_IMPL_DIFF.md +++ b/GNOSIS_CELO/DEFAULT_A_TOKEN_IMPL_DIFF.md @@ -3,872 +3,10 @@ diff --git a/./downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL.sol b/./downloads/CELO/DEFA index 5f19e1c..66219c7 100644 --- a/./downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL.sol +++ b/./downloads/CELO/DEFAULT_A_TOKEN_IMPL.sol -@@ -1,7 +1,7 @@ --// SPDX-License-Identifier: MIT -+// SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -24,10 +24,14 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { -- struct ReserveData { -+ /** -+ * This exists specifically to maintain the `getReserveData()` interface, since the new, internal -+ * `ReserveData` struct includes the reserve's `virtualUnderlyingBalance`. -+ */ -+ struct ReserveDataLegacy { - //stores the reserve configuration - ReserveConfigurationMap configuration; - //the liquidity index. Expressed in ray -@@ -38,7 +42,7 @@ library DataTypes { - uint128 variableBorrowIndex; - //the current variable borrow rate. Expressed in ray - uint128 currentVariableBorrowRate; -- //the current stable borrow rate. Expressed in ray -+ // DEPRECATED on v3.2.0 - uint128 currentStableBorrowRate; - //timestamp of last update - uint40 lastUpdateTimestamp; -@@ -46,7 +50,7 @@ library DataTypes { - uint16 id; - //aToken address - address aTokenAddress; -- //stableDebtToken address -+ // DEPRECATED on v3.2.0 - address stableDebtTokenAddress; - //variableDebtToken address - address variableDebtTokenAddress; -@@ -60,6 +64,44 @@ library DataTypes { - uint128 isolationModeTotalDebt; - } - -+ struct ReserveData { -+ //stores the reserve configuration -+ ReserveConfigurationMap configuration; -+ //the liquidity index. Expressed in ray -+ uint128 liquidityIndex; -+ //the current supply rate. Expressed in ray -+ uint128 currentLiquidityRate; -+ //variable borrow index. Expressed in ray -+ uint128 variableBorrowIndex; -+ //the current variable borrow rate. Expressed in ray -+ uint128 currentVariableBorrowRate; -+ /// @notice reused `__deprecatedStableBorrowRate` storage from pre 3.2 -+ // the current accumulate deficit in underlying tokens -+ uint128 deficit; -+ //timestamp of last update -+ uint40 lastUpdateTimestamp; -+ //the id of the reserve. Represents the position in the list of the active reserves -+ uint16 id; -+ //timestamp until when liquidations are not allowed on the reserve, if set to past liquidations will be allowed -+ uint40 liquidationGracePeriodUntil; -+ //aToken address -+ address aTokenAddress; -+ // DEPRECATED on v3.2.0 -+ address __deprecatedStableDebtTokenAddress; -+ //variableDebtToken address -+ address variableDebtTokenAddress; -+ //address of the interest rate strategy -+ address interestRateStrategyAddress; -+ //the current treasury balance, scaled -+ uint128 accruedToTreasury; -+ //the outstanding unbacked aTokens minted through the bridging feature -+ uint128 unbacked; -+ //the outstanding debt borrowed against this asset in isolation mode -+ uint128 isolationModeTotalDebt; -+ //the amount of underlying accounted for by the protocol -+ uint128 virtualUnderlyingBalance; -+ } -+ - struct ReserveConfigurationMap { - //bit 0-15: LTV - //bit 16-31: Liq. threshold -@@ -68,19 +110,20 @@ library DataTypes { - //bit 56: reserve is active - //bit 57: reserve is frozen - //bit 58: borrowing is enabled -- //bit 59: stable rate borrowing enabled -+ //bit 59: DEPRECATED: stable rate borrowing enabled - //bit 60: asset is paused - //bit 61: borrowing in isolation mode is enabled - //bit 62: siloed borrowing enabled - //bit 63: flashloaning enabled - //bit 64-79: reserve factor -- //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap -- //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap -- //bit 152-167 liquidation protocol fee -- //bit 168-175 eMode category -- //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled -- //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals -- //bit 252-255 unused -+ //bit 80-115: borrow cap in whole tokens, borrowCap == 0 => no cap -+ //bit 116-151: supply cap in whole tokens, supplyCap == 0 => no cap -+ //bit 152-167: liquidation protocol fee -+ //bit 168-175: DEPRECATED: eMode category -+ //bit 176-211: unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled -+ //bit 212-251: debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals -+ //bit 252: virtual accounting is enabled for the reserve -+ //bit 253-255 unused - - uint256 data; - } -@@ -94,30 +137,49 @@ library DataTypes { - uint256 data; - } - -- struct EModeCategory { -+ // DEPRECATED: kept for backwards compatibility, might be removed in a future version -+ struct EModeCategoryLegacy { - // each eMode category has a custom ltv and liquidation threshold - uint16 ltv; - uint16 liquidationThreshold; - uint16 liquidationBonus; -- // each eMode category may or may not have a custom oracle to override the individual assets price oracles -+ // DEPRECATED - address priceSource; - string label; - } - -+ struct CollateralConfig { -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ } -+ -+ struct EModeCategoryBaseConfiguration { -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ string label; -+ } -+ -+ struct EModeCategory { -+ // each eMode category has a custom ltv and liquidation threshold -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ uint128 collateralBitmap; -+ string label; -+ uint128 borrowableBitmap; -+ } -+ - enum InterestRateMode { - NONE, -- STABLE, -+ __DEPRECATED, - VARIABLE - } - - struct ReserveCache { - uint256 currScaledVariableDebt; - uint256 nextScaledVariableDebt; -- uint256 currPrincipalStableDebt; -- uint256 currAvgStableBorrowRate; -- uint256 currTotalStableDebt; -- uint256 nextAvgStableBorrowRate; -- uint256 nextTotalStableDebt; - uint256 currLiquidityIndex; - uint256 nextLiquidityIndex; - uint256 currVariableBorrowIndex; -@@ -127,10 +189,8 @@ library DataTypes { - uint256 reserveFactor; - ReserveConfigurationMap reserveConfiguration; - address aTokenAddress; -- address stableDebtTokenAddress; - address variableDebtTokenAddress; - uint40 reserveLastUpdateTimestamp; -- uint40 stableDebtLastUpdateTimestamp; - } - - struct ExecuteLiquidationCallParams { -@@ -160,7 +220,6 @@ library DataTypes { - InterestRateMode interestRateMode; - uint16 referralCode; - bool releaseUnderlying; -- uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; -@@ -184,6 +243,11 @@ library DataTypes { - uint8 userEModeCategory; - } - -+ struct ExecuteEliminateDeficitParams { -+ address asset; -+ uint256 amount; -+ } -+ - struct ExecuteSetUserEModeParams { - uint256 reservesCount; - address oracle; -@@ -212,9 +276,9 @@ library DataTypes { - uint16 referralCode; - uint256 flashLoanPremiumToProtocol; - uint256 flashLoanPremiumTotal; -- uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address addressesProvider; -+ address pool; - uint8 userEModeCategory; - bool isAuthorizedFlashBorrower; - } -@@ -253,7 +317,6 @@ library DataTypes { - address userAddress; - uint256 amount; - InterestRateMode interestRateMode; -- uint256 maxStableLoanPercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; -@@ -274,18 +337,16 @@ library DataTypes { - uint256 unbacked; - uint256 liquidityAdded; - uint256 liquidityTaken; -- uint256 totalStableDebt; -- uint256 totalVariableDebt; -- uint256 averageStableBorrowRate; -+ uint256 totalDebt; - uint256 reserveFactor; - address reserve; -- address aToken; -+ bool usingVirtualBalance; -+ uint256 virtualUnderlyingBalance; - } - - struct InitReserveParams { - address asset; - address aTokenAddress; -- address stableDebtAddress; - address variableDebtAddress; - address interestRateStrategyAddress; - uint16 reservesCount; -@@ -293,7 +354,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/tokenization/base/EIP712Base.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/tokenization/base/EIP712Base.sol - - /** - * @title EIP712Base -@@ -363,7 +424,7 @@ abstract contract EIP712Base { - function _EIP712BaseId() internal view virtual returns (string memory); - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -401,17 +462,14 @@ library Errors { - string public constant RESERVE_FROZEN = '28'; // 'Action cannot be performed because the reserve is frozen' - string public constant RESERVE_PAUSED = '29'; // 'Action cannot be performed because the reserve is paused' - string public constant BORROWING_NOT_ENABLED = '30'; // 'Borrowing is not enabled' -- string public constant STABLE_BORROWING_NOT_ENABLED = '31'; // 'Stable borrowing is not enabled' - string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '32'; // 'User cannot withdraw more than the available balance' - string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '33'; // 'Invalid interest rate mode selected' - string public constant COLLATERAL_BALANCE_IS_ZERO = '34'; // 'The collateral balance is 0' - string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '35'; // 'Health factor is lesser than the liquidation threshold' - string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '36'; // 'There is not enough collateral to cover a new borrow' - string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '37'; // 'Collateral is (mostly) the same currency that is being borrowed' -- string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '38'; // 'The requested amount is greater than the max loan size in stable rate mode' - string public constant NO_DEBT_OF_SELECTED_TYPE = '39'; // 'For repayment of a specific type of debt, the user needs to have debt that type' - string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '40'; // 'To repay on behalf of a user an explicit amount to repay is needed' -- string public constant NO_OUTSTANDING_STABLE_DEBT = '41'; // 'User does not have outstanding stable rate debt on this reserve' - string public constant NO_OUTSTANDING_VARIABLE_DEBT = '42'; // 'User does not have outstanding variable rate debt on this reserve' - string public constant UNDERLYING_BALANCE_ZERO = '43'; // 'The underlying balance needs to be greater than 0' - string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '44'; // 'Interest rate rebalance conditions were not met' -@@ -424,7 +482,6 @@ library Errors { - string public constant UNBACKED_MINT_CAP_EXCEEDED = '52'; // 'Unbacked mint cap is exceeded' - string public constant DEBT_CEILING_EXCEEDED = '53'; // 'Debt ceiling is exceeded' - string public constant UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO = '54'; // 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)' -- string public constant STABLE_DEBT_NOT_ZERO = '55'; // 'Stable debt supply is not zero' - string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '56'; // 'Variable debt supply is not zero' - string public constant LTV_VALIDATION_FAILED = '57'; // 'Ltv validation failed' - string public constant INCONSISTENT_EMODE_CATEGORY = '58'; // 'Inconsistent eMode category' -@@ -453,17 +510,28 @@ library Errors { - string public constant DEBT_CEILING_NOT_ZERO = '81'; // 'Debt ceiling is not zero' - string public constant ASSET_NOT_LISTED = '82'; // 'Asset is not listed' - string public constant INVALID_OPTIMAL_USAGE_RATIO = '83'; // 'Invalid optimal usage ratio' -- string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '84'; // 'Invalid optimal stable to total debt ratio' - string public constant UNDERLYING_CANNOT_BE_RESCUED = '85'; // 'The underlying asset cannot be rescued' - string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '86'; // 'Reserve has already been added to reserve list' - string public constant POOL_ADDRESSES_DO_NOT_MATCH = '87'; // 'The token implementation pool address and the pool address provided by the initializing pool do not match' -- string public constant STABLE_BORROWING_ENABLED = '88'; // 'Stable borrowing is enabled' - string public constant SILOED_BORROWING_VIOLATION = '89'; // 'User is trying to borrow multiple assets including a siloed one' - string public constant RESERVE_DEBT_NOT_ZERO = '90'; // the total debt of the reserve needs to be 0 - string public constant FLASHLOAN_DISABLED = '91'; // FlashLoaning for this asset is disabled -+ string public constant INVALID_MAX_RATE = '92'; // The expect maximum borrow rate is invalid -+ string public constant WITHDRAW_TO_ATOKEN = '93'; // Withdrawing to the aToken is not allowed -+ string public constant SUPPLY_TO_ATOKEN = '94'; // Supplying to the aToken is not allowed -+ string public constant SLOPE_2_MUST_BE_GTE_SLOPE_1 = '95'; // Variable interest rate slope 2 can not be lower than slope 1 -+ string public constant CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN = '96'; // 'The caller of the function is not a risk, pool or emergency admin' -+ string public constant LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED = '97'; // 'Liquidation grace sentinel validation failed' -+ string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range -+ string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state -+ string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -482,7 +550,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -558,7 +626,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -785,7 +853,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -857,7 +925,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1113,7 +1181,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol - - /** - * @title VersionedInitializable -@@ -1190,7 +1258,7 @@ abstract contract VersionedInitializable { - uint256[50] private ______gap; - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1316,7 +1384,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1429,7 +1497,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/interfaces/IACLManager.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1602,7 +1670,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1612,7 +1680,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/interfaces/IPool.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -1677,7 +1745,7 @@ interface IPool { - * initiator of the transaction on flashLoan() - * @param onBehalfOf The address that will be getting the debt - * @param amount The amount borrowed out -- * @param interestRateMode The rate mode: 1 for Stable, 2 for Variable -+ * @param interestRateMode The rate mode: 2 for Variable, 1 is deprecated (changed on v3.2.0) - * @param borrowRate The numeric rate at which the user has borrowed, expressed in ray - * @param referralCode The referral code used - */ -@@ -1707,18 +1775,6 @@ interface IPool { - bool useATokens - ); - -- /** -- * @dev Emitted on swapBorrowRateMode() -- * @param reserve The address of the underlying asset of the reserve -- * @param user The address of the user swapping his rate mode -- * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable -- */ -- event SwapBorrowRateMode( -- address indexed reserve, -- address indexed user, -- DataTypes.InterestRateMode interestRateMode -- ); -- - /** - * @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets - * @param asset The address of the underlying asset of the reserve -@@ -1747,20 +1803,14 @@ interface IPool { - */ - event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user); - -- /** -- * @dev Emitted on rebalanceStableBorrowRate() -- * @param reserve The address of the underlying asset of the reserve -- * @param user The address of the user for which the rebalance has been executed -- */ -- event RebalanceStableBorrowRate(address indexed reserve, address indexed user); -- - /** - * @dev Emitted on flashLoan() - * @param target The address of the flash loan receiver contract - * @param initiator The address initiating the flash loan - * @param asset The address of the asset being flash borrowed - * @param amount The amount flash borrowed -- * @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt -+ * @param interestRateMode The flashloan mode: 0 for regular flashloan, -+ * 1 for Stable (Deprecated on v3.2.0), 2 for Variable - * @param premium The fee flash borrowed - * @param referralCode The referral code used - */ -@@ -1799,7 +1849,7 @@ interface IPool { - * @dev Emitted when the state of a reserve is updated. - * @param reserve The address of the underlying asset of the reserve - * @param liquidityRate The next liquidity rate -- * @param stableBorrowRate The next stable borrow rate -+ * @param stableBorrowRate The next stable borrow rate @note deprecated on v3.2.0 - * @param variableBorrowRate The next variable borrow rate - * @param liquidityIndex The next liquidity index - * @param variableBorrowIndex The next variable borrow index -@@ -1813,6 +1863,14 @@ interface IPool { - uint256 variableBorrowIndex - ); - -+ /** -+ * @dev Emitted when the deficit of a reserve is covered. -+ * @param reserve The address of the underlying asset of the reserve -+ * @param caller The caller that triggered the DeficitCovered event -+ * @param amountCovered The amount of deficit covered -+ */ -+ event DeficitCovered(address indexed reserve, address caller, uint256 amountCovered); -+ - /** - * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest. - * @param reserve The address of the reserve -@@ -1820,6 +1878,14 @@ interface IPool { - */ - event MintedToTreasury(address indexed reserve, uint256 amountMinted); - -+ /** -+ * @dev Emitted when deficit is realized on a liquidation. -+ * @param user The user address where the bad debt will be burned -+ * @param debtAsset The address of the underlying borrowed asset to be burned -+ * @param amountCreated The amount of deficit created -+ */ -+ event DeficitCreated(address indexed user, address indexed debtAsset, uint256 amountCreated); -+ - /** - * @notice Mints an `amount` of aTokens to the `onBehalfOf` - * @param asset The address of the underlying asset to mint -@@ -1898,13 +1964,12 @@ interface IPool { - - /** - * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower -- * already supplied enough collateral, or he was given enough allowance by a credit delegator on the -- * corresponding debt token (StableDebtToken or VariableDebtToken) -+ * already supplied enough collateral, or he was given enough allowance by a credit delegator on the VariableDebtToken - * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet -- * and 100 stable/variable debt tokens, depending on the `interestRateMode` -+ * and 100 variable debt tokens - * @param asset The address of the underlying asset to borrow - * @param amount The amount to be borrowed -- * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself -@@ -1921,11 +1986,11 @@ interface IPool { - - /** - * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned -- * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address -+ * - E.g. User repays 100 USDC, burning 100 variable debt tokens of the `onBehalfOf` address - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed -@@ -1944,7 +2009,7 @@ interface IPool { - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed -@@ -1968,13 +2033,13 @@ interface IPool { - /** - * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the - * equivalent debt tokens -- * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens -+ * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable debt tokens - * @dev Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken - * balance is not enough to cover the whole debt - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode DEPRECATED in v3.2.0 - * @return The final amount repaid - */ - function repayWithATokens( -@@ -1983,24 +2048,6 @@ interface IPool { - uint256 interestRateMode - ) external returns (uint256); - -- /** -- * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa -- * @param asset The address of the underlying asset borrowed -- * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable -- */ -- function swapBorrowRateMode(address asset, uint256 interestRateMode) external; -- -- /** -- * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve. -- * - Users can be rebalanced if the following conditions are satisfied: -- * 1. Usage ratio is above 95% -- * 2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too -- * much has been borrowed at a stable rate and suppliers are not earning enough -- * @param asset The address of the underlying asset borrowed -- * @param user The address of the user to be rebalanced -- */ -- function rebalanceStableBorrowRate(address asset, address user) external; -- - /** - * @notice Allows suppliers to enable/disable a specific supplied asset as collateral - * @param asset The address of the underlying asset supplied -@@ -2037,9 +2084,9 @@ interface IPool { - * @param amounts The amounts of the assets being flash-borrowed - * @param interestRateModes Types of the debt to open if the flash loan is not returned: - * 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver -- * 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address -+ * 1 -> Deprecated on v3.2.0 - * 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address -- * @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2 -+ * @param onBehalfOf The address that will receive the debt in the case of using 2 on `modes` - * @param params Variadic packed params to pass to the receiver as extra information - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man -@@ -2104,14 +2151,12 @@ interface IPool { - * @dev Only callable by the PoolConfigurator contract - * @param asset The address of the underlying asset of the reserve - * @param aTokenAddress The address of the aToken that will be assigned to the reserve -- * @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve - * @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve - * @param interestRateStrategyAddress The address of the interest rate strategy contract - */ - function initReserve( - address asset, - address aTokenAddress, -- address stableDebtAddress, - address variableDebtAddress, - address interestRateStrategyAddress - ) external; -@@ -2119,6 +2164,7 @@ interface IPool { - /** - * @notice Drop a reserve - * @dev Only callable by the PoolConfigurator contract -+ * @dev Does not reset eMode flags, which must be considered when reusing the same reserve id for a different reserve. - * @param asset The address of the underlying asset of the reserve - */ - function dropReserve(address asset) external; -@@ -2134,6 +2180,22 @@ interface IPool { - address rateStrategyAddress - ) external; - -+ /** -+ * @notice Accumulates interest to all indexes of the reserve -+ * @dev Only callable by the PoolConfigurator contract -+ * @dev To be used when required by the configurator, for example when updating interest rates strategy data -+ * @param asset The address of the underlying asset of the reserve -+ */ -+ function syncIndexesState(address asset) external; -+ -+ /** -+ * @notice Updates interest rates on the reserve data -+ * @dev Only callable by the PoolConfigurator contract -+ * @dev To be used when required by the configurator, for example when updating interest rates strategy data -+ * @param asset The address of the underlying asset of the reserve -+ */ -+ function syncRatesState(address asset) external; -+ - /** - * @notice Sets the configuration bitmap of the reserve as a whole - * @dev Only callable by the PoolConfigurator contract -@@ -2189,7 +2251,14 @@ interface IPool { - * @param asset The address of the underlying asset of the reserve - * @return The state and configuration data of the reserve - */ -- function getReserveData(address asset) external view returns (DataTypes.ReserveData memory); -+ function getReserveData(address asset) external view returns (DataTypes.ReserveDataLegacy memory); -+ -+ /** -+ * @notice Returns the virtual underlying balance of the reserve -+ * @param asset The address of the underlying asset of the reserve -+ * @return The reserve virtual underlying balance -+ */ -+ function getVirtualUnderlyingBalance(address asset) external view returns (uint128); - - /** - * @notice Validates and finalizes an aToken transfer -@@ -2217,6 +2286,13 @@ interface IPool { - */ - function getReservesList() external view returns (address[] memory); - -+ /** -+ * @notice Returns the number of initialized reserves -+ * @dev It includes dropped reserves -+ * @return The count -+ */ -+ function getReservesCount() external view returns (uint256); -+ - /** - * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct - * @param id The id of the reserve as stored in the DataTypes.ReserveData struct -@@ -2252,20 +2328,70 @@ interface IPool { - ) external; - - /** -- * @notice Configures a new category for the eMode. -+ * @notice Configures a new or alters an existing collateral configuration of an eMode. - * @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category. - * The category 0 is reserved as it's the default for volatile assets - * @param id The id of the category - * @param config The configuration of the category - */ -- function configureEModeCategory(uint8 id, DataTypes.EModeCategory memory config) external; -+ function configureEModeCategory( -+ uint8 id, -+ DataTypes.EModeCategoryBaseConfiguration memory config -+ ) external; -+ -+ /** -+ * @notice Replaces the current eMode collateralBitmap. -+ * @param id The id of the category -+ * @param collateralBitmap The collateralBitmap of the category -+ */ -+ function configureEModeCategoryCollateralBitmap(uint8 id, uint128 collateralBitmap) external; -+ -+ /** -+ * @notice Replaces the current eMode borrowableBitmap. -+ * @param id The id of the category -+ * @param borrowableBitmap The borrowableBitmap of the category -+ */ -+ function configureEModeCategoryBorrowableBitmap(uint8 id, uint128 borrowableBitmap) external; - - /** - * @notice Returns the data of an eMode category -+ * @dev DEPRECATED use independent getters instead - * @param id The id of the category - * @return The configuration data of the category - */ -- function getEModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory); -+ function getEModeCategoryData( -+ uint8 id -+ ) external view returns (DataTypes.EModeCategoryLegacy memory); -+ -+ /** -+ * @notice Returns the label of an eMode category -+ * @param id The id of the category -+ * @return The label of the category -+ */ -+ function getEModeCategoryLabel(uint8 id) external view returns (string memory); -+ -+ /** -+ * @notice Returns the collateral config of an eMode category -+ * @param id The id of the category -+ * @return The ltv,lt,lb of the category -+ */ -+ function getEModeCategoryCollateralConfig( -+ uint8 id -+ ) external view returns (DataTypes.CollateralConfig memory); -+ -+ /** -+ * @notice Returns the collateralBitmap of an eMode category -+ * @param id The id of the category -+ * @return The collateralBitmap of the category -+ */ -+ function getEModeCategoryCollateralBitmap(uint8 id) external view returns (uint128); -+ -+ /** -+ * @notice Returns the borrowableBitmap of an eMode category -+ * @param id The id of the category -+ * @return The borrowableBitmap of the category -+ */ -+ function getEModeCategoryBorrowableBitmap(uint8 id) external view returns (uint128); - - /** - * @notice Allows a user to use the protocol in eMode -@@ -2288,10 +2414,20 @@ interface IPool { - function resetIsolationModeTotalDebt(address asset) external; - - /** -- * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate -- * @return The percentage of available liquidity to borrow, expressed in bps -- */ -- function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256); -+ * @notice Sets the liquidation grace period of the given asset -+ * @dev To enable a liquidation grace period, a timestamp in the future should be set, -+ * To disable a liquidation grace period, any timestamp in the past works, like 0 -+ * @param asset The address of the underlying asset to set the liquidationGracePeriod -+ * @param until Timestamp when the liquidation grace period will end -+ **/ -+ function setLiquidationGracePeriod(address asset, uint40 until) external; -+ -+ /** -+ * @notice Returns the liquidation grace period of the given asset -+ * @param asset The address of the underlying asset -+ * @return Timestamp when the liquidation grace period will end -+ **/ -+ function getLiquidationGracePeriod(address asset) external view returns (uint40); - - /** - * @notice Returns the total fee on flash loans -@@ -2344,9 +2480,75 @@ interface IPool { - * 0 if the action is executed directly by the user, without any middle-man - */ - function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external; -+ -+ /** -+ * @notice It covers the deficit of a specified reserve by burning: -+ * - the equivalent aToken `amount` for assets with virtual accounting enabled -+ * - the equivalent `amount` of underlying for assets with virtual accounting disabled (e.g. GHO) -+ * @dev The deficit of a reserve can occur due to situations where borrowed assets are not repaid, leading to bad debt. -+ * @param asset The address of the underlying asset to cover the deficit. -+ * @param amount The amount to be covered, in aToken or underlying on non-virtual accounted assets -+ */ -+ function eliminateReserveDeficit(address asset, uint256 amount) external; -+ -+ /** -+ * @notice Returns the current deficit of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The current deficit of the reserve -+ */ -+ function getReserveDeficit(address asset) external view returns (uint256); -+ -+ /** -+ * @notice Returns the aToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the aToken -+ */ -+ function getReserveAToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Returns the variableDebtToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the variableDebtToken -+ */ -+ function getReserveVariableDebtToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external FlashLoanLogic -+ */ -+ function getFlashLoanLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external BorrowLogic -+ */ -+ function getBorrowLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external BridgeLogic -+ */ -+ function getBridgeLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external EModeLogic -+ */ -+ function getEModeLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external LiquidationLogic -+ */ -+ function getLiquidationLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external PoolLogic -+ */ -+ function getPoolLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external SupplyLogic -+ */ -+ function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -2399,7 +2601,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/interfaces/IAToken.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -2533,7 +2735,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - + -// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol +// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - + /** * @title IncentivizedERC20 @@ -2564,8 +2766,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { @@ -903,32 +41,10 @@ index 5f19e1c..66219c7 100644 + _decimals = decimals_; POOL = pool; } - -@@ -2757,7 +2958,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol - - /** - * @title MintableIncentivizedERC20 -@@ -2819,7 +3020,7 @@ abstract contract MintableIncentivizedERC20 is IncentivizedERC20 { - } - } - --// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol -+// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol - - /** - * @title ScaledBalanceTokenBase -@@ -2968,14 +3169,14 @@ abstract contract ScaledBalanceTokenBase is MintableIncentivizedERC20, IScaledBa - } - } - + -// downloads/GNOSIS/DEFAULT_A_TOKEN_IMPL/AToken/src/core/contracts/protocol/tokenization/AToken.sol +// downloads/CELO/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/tokenization/AToken.sol - + /** * @title Aave ERC20 AToken * @author Aave @@ -942,12 +58,12 @@ index 5f19e1c..66219c7 100644 @@ -2983,16 +3184,9 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I bytes32 public constant PERMIT_TYPEHASH = keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'); - + - uint256 public constant ATOKEN_REVISION = 0x1; - address internal _treasury; address internal _underlyingAsset; - + - /// @inheritdoc VersionedInitializable - function getRevision() internal pure virtual override returns (uint256) { - return ATOKEN_REVISION; @@ -984,7 +100,7 @@ index 5f19e1c..66219c7 100644 - ); - } + ) public virtual; - + /// @inheritdoc IAToken function mint( @@ -3209,3 +3381,50 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I diff --git a/GNOSIS_CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL_DIFF.md b/GNOSIS_CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL_DIFF.md index 95b501a2..8e393b3a 100644 --- a/GNOSIS_CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL_DIFF.md +++ b/GNOSIS_CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL_DIFF.md @@ -3,126 +3,10 @@ diff --git a/./downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol b/./downl index 470a2d4..ade74e4 100644 --- a/./downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol +++ b/./downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL.sol -@@ -1,11 +1,39 @@ --// SPDX-License-Identifier: MIT -+// SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/dependencies/chainlink/AggregatorInterface.sol - --interface IEACAggregatorProxy { -+// Chainlink Contracts v0.8 -+ -+interface AggregatorInterface { - function decimals() external view returns (uint8); - -+ function description() external view returns (string memory); -+ -+ function getRoundData( -+ uint80 _roundId -+ ) -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ function latestRoundData() -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ - function latestAnswer() external view returns (int256); - - function latestTimestamp() external view returns (uint256); -@@ -16,11 +44,12 @@ interface IEACAggregatorProxy { - - function getTimestamp(uint256 roundId) external view returns (uint256); - -- event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp); -- event NewRound(uint256 indexed roundId, address indexed startedBy); -+ event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt); -+ -+ event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); - } - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -96,7 +125,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/interfaces/IRewardsDistributor.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/rewards/interfaces/IRewardsDistributor.sol - - /** - * @title IRewardsDistributor -@@ -273,7 +302,7 @@ interface IRewardsDistributor { - function getEmissionManager() external view returns (address); - } - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/core/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -345,7 +374,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/interfaces/ITransferStrategyBase.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/rewards/interfaces/ITransferStrategyBase.sol - - interface ITransferStrategyBase { - event EmergencyWithdrawal( -@@ -383,7 +412,7 @@ interface ITransferStrategyBase { - function emergencyWithdrawal(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -639,7 +668,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/core/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol - - /** - * @title VersionedInitializable -@@ -716,7 +745,7 @@ abstract contract VersionedInitializable { - uint256[50] private ______gap; - } - --// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -726,7 +755,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - + -// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/libraries/RewardsDataTypes.sol +// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/rewards/libraries/RewardsDataTypes.sol - + library RewardsDataTypes { struct RewardsConfigInput { @@ -736,7 +765,7 @@ library RewardsDataTypes { @@ -132,15 +16,15 @@ index 470a2d4..ade74e4 100644 - IEACAggregatorProxy rewardOracle; + AggregatorInterface rewardOracle; } - + struct UserAssetBalance { @@ -777,7 +806,7 @@ library RewardsDataTypes { } } - + -// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/interfaces/IRewardsController.sol +// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/rewards/interfaces/IRewardsController.sol - + /** * @title IRewardsController @@ -843,9 +872,9 @@ interface IRewardsController is IRewardsDistributor { @@ -152,7 +36,7 @@ index 470a2d4..ade74e4 100644 */ - function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external; + function setRewardOracle(address reward, AggregatorInterface rewardOracle) external; - + /** * @dev Get the price aggregator oracle address @@ -877,8 +906,8 @@ interface IRewardsController is IRewardsDistributor { @@ -165,14 +49,14 @@ index 470a2d4..ade74e4 100644 + * Must follow Chainlink Aggregator AggregatorInterface interface to be compatible. */ function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external; - + @@ -975,7 +1004,7 @@ interface IRewardsController is IRewardsDistributor { ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts); } - + -// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/RewardsDistributor.sol +// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/rewards/RewardsDistributor.sol - + /** * @title RewardsDistributor @@ -1015,7 +1044,7 @@ abstract contract RewardsDistributor is IRewardsDistributor { @@ -192,14 +76,14 @@ index 470a2d4..ade74e4 100644 + ) external view override returns (uint256) { return _assets[asset].rewards[reward].usersData[user].index; } - + @@ -1506,7 +1535,7 @@ abstract contract RewardsDistributor is IRewardsDistributor { } } - + -// downloads/GNOSIS/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/periphery/contracts/rewards/RewardsController.sol +// downloads/CELO/DEFAULT_INCENTIVES_CONTROLLER_IMPL/RewardsController/src/contracts/rewards/RewardsController.sol - + /** * @title RewardsController @@ -1532,7 +1561,7 @@ contract RewardsController is RewardsDistributor, VersionedInitializable, IRewar @@ -208,7 +92,7 @@ index 470a2d4..ade74e4 100644 // a check to see if the provided reward oracle contains `latestAnswer`. - mapping(address => IEACAggregatorProxy) internal _rewardOracle; + mapping(address => AggregatorInterface) internal _rewardOracle; - + modifier onlyAuthorizedClaimers(address claimer, address user) { require(_authorizedClaimers[user] == claimer, 'CLAIMER_UNAUTHORIZED'); @@ -1598,7 +1627,7 @@ contract RewardsController is RewardsDistributor, VersionedInitializable, IRewar @@ -222,7 +106,7 @@ index 470a2d4..ade74e4 100644 } @@ -1839,13 +1868,13 @@ contract RewardsController is RewardsDistributor, VersionedInitializable, IRewar } - + /** - * @dev Update the Price Oracle of a reward token. The Price Oracle must follow Chainlink IEACAggregatorProxy interface. + * @dev Update the Price Oracle of a reward token. The Price Oracle must follow Chainlink AggregatorInterface interface. @@ -230,7 +114,7 @@ index 470a2d4..ade74e4 100644 * @param reward The address of the reward token * @param rewardOracle The address of the price oracle */ - + - function _setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) internal { + function _setRewardOracle(address reward, AggregatorInterface rewardOracle) internal { require(rewardOracle.latestAnswer() > 0, 'ORACLE_MUST_RETURN_PRICE'); diff --git a/GNOSIS_CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_DIFF.md b/GNOSIS_CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_DIFF.md index bfe98ebc..e7c34b99 100644 --- a/GNOSIS_CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_DIFF.md +++ b/GNOSIS_CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_DIFF.md @@ -3,863 +3,10 @@ diff --git a/./downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL.sol b/./downloa index aa145c3..ba3ffd3 100644 --- a/./downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL.sol +++ b/./downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL.sol -@@ -1,7 +1,7 @@ --// SPDX-License-Identifier: MIT -+// SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -24,10 +24,14 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { -- struct ReserveData { -+ /** -+ * This exists specifically to maintain the `getReserveData()` interface, since the new, internal -+ * `ReserveData` struct includes the reserve's `virtualUnderlyingBalance`. -+ */ -+ struct ReserveDataLegacy { - //stores the reserve configuration - ReserveConfigurationMap configuration; - //the liquidity index. Expressed in ray -@@ -38,7 +42,7 @@ library DataTypes { - uint128 variableBorrowIndex; - //the current variable borrow rate. Expressed in ray - uint128 currentVariableBorrowRate; -- //the current stable borrow rate. Expressed in ray -+ // DEPRECATED on v3.2.0 - uint128 currentStableBorrowRate; - //timestamp of last update - uint40 lastUpdateTimestamp; -@@ -46,7 +50,7 @@ library DataTypes { - uint16 id; - //aToken address - address aTokenAddress; -- //stableDebtToken address -+ // DEPRECATED on v3.2.0 - address stableDebtTokenAddress; - //variableDebtToken address - address variableDebtTokenAddress; -@@ -60,6 +64,44 @@ library DataTypes { - uint128 isolationModeTotalDebt; - } - -+ struct ReserveData { -+ //stores the reserve configuration -+ ReserveConfigurationMap configuration; -+ //the liquidity index. Expressed in ray -+ uint128 liquidityIndex; -+ //the current supply rate. Expressed in ray -+ uint128 currentLiquidityRate; -+ //variable borrow index. Expressed in ray -+ uint128 variableBorrowIndex; -+ //the current variable borrow rate. Expressed in ray -+ uint128 currentVariableBorrowRate; -+ /// @notice reused `__deprecatedStableBorrowRate` storage from pre 3.2 -+ // the current accumulate deficit in underlying tokens -+ uint128 deficit; -+ //timestamp of last update -+ uint40 lastUpdateTimestamp; -+ //the id of the reserve. Represents the position in the list of the active reserves -+ uint16 id; -+ //timestamp until when liquidations are not allowed on the reserve, if set to past liquidations will be allowed -+ uint40 liquidationGracePeriodUntil; -+ //aToken address -+ address aTokenAddress; -+ // DEPRECATED on v3.2.0 -+ address __deprecatedStableDebtTokenAddress; -+ //variableDebtToken address -+ address variableDebtTokenAddress; -+ //address of the interest rate strategy -+ address interestRateStrategyAddress; -+ //the current treasury balance, scaled -+ uint128 accruedToTreasury; -+ //the outstanding unbacked aTokens minted through the bridging feature -+ uint128 unbacked; -+ //the outstanding debt borrowed against this asset in isolation mode -+ uint128 isolationModeTotalDebt; -+ //the amount of underlying accounted for by the protocol -+ uint128 virtualUnderlyingBalance; -+ } -+ - struct ReserveConfigurationMap { - //bit 0-15: LTV - //bit 16-31: Liq. threshold -@@ -68,19 +110,20 @@ library DataTypes { - //bit 56: reserve is active - //bit 57: reserve is frozen - //bit 58: borrowing is enabled -- //bit 59: stable rate borrowing enabled -+ //bit 59: DEPRECATED: stable rate borrowing enabled - //bit 60: asset is paused - //bit 61: borrowing in isolation mode is enabled - //bit 62: siloed borrowing enabled - //bit 63: flashloaning enabled - //bit 64-79: reserve factor -- //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap -- //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap -- //bit 152-167 liquidation protocol fee -- //bit 168-175 eMode category -- //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled -- //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals -- //bit 252-255 unused -+ //bit 80-115: borrow cap in whole tokens, borrowCap == 0 => no cap -+ //bit 116-151: supply cap in whole tokens, supplyCap == 0 => no cap -+ //bit 152-167: liquidation protocol fee -+ //bit 168-175: DEPRECATED: eMode category -+ //bit 176-211: unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled -+ //bit 212-251: debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals -+ //bit 252: virtual accounting is enabled for the reserve -+ //bit 253-255 unused - - uint256 data; - } -@@ -94,30 +137,49 @@ library DataTypes { - uint256 data; - } - -- struct EModeCategory { -+ // DEPRECATED: kept for backwards compatibility, might be removed in a future version -+ struct EModeCategoryLegacy { - // each eMode category has a custom ltv and liquidation threshold - uint16 ltv; - uint16 liquidationThreshold; - uint16 liquidationBonus; -- // each eMode category may or may not have a custom oracle to override the individual assets price oracles -+ // DEPRECATED - address priceSource; - string label; - } - -+ struct CollateralConfig { -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ } -+ -+ struct EModeCategoryBaseConfiguration { -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ string label; -+ } -+ -+ struct EModeCategory { -+ // each eMode category has a custom ltv and liquidation threshold -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ uint128 collateralBitmap; -+ string label; -+ uint128 borrowableBitmap; -+ } -+ - enum InterestRateMode { - NONE, -- STABLE, -+ __DEPRECATED, - VARIABLE - } - - struct ReserveCache { - uint256 currScaledVariableDebt; - uint256 nextScaledVariableDebt; -- uint256 currPrincipalStableDebt; -- uint256 currAvgStableBorrowRate; -- uint256 currTotalStableDebt; -- uint256 nextAvgStableBorrowRate; -- uint256 nextTotalStableDebt; - uint256 currLiquidityIndex; - uint256 nextLiquidityIndex; - uint256 currVariableBorrowIndex; -@@ -127,10 +189,8 @@ library DataTypes { - uint256 reserveFactor; - ReserveConfigurationMap reserveConfiguration; - address aTokenAddress; -- address stableDebtTokenAddress; - address variableDebtTokenAddress; - uint40 reserveLastUpdateTimestamp; -- uint40 stableDebtLastUpdateTimestamp; - } - - struct ExecuteLiquidationCallParams { -@@ -160,7 +220,6 @@ library DataTypes { - InterestRateMode interestRateMode; - uint16 referralCode; - bool releaseUnderlying; -- uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; -@@ -184,6 +243,11 @@ library DataTypes { - uint8 userEModeCategory; - } - -+ struct ExecuteEliminateDeficitParams { -+ address asset; -+ uint256 amount; -+ } -+ - struct ExecuteSetUserEModeParams { - uint256 reservesCount; - address oracle; -@@ -212,9 +276,9 @@ library DataTypes { - uint16 referralCode; - uint256 flashLoanPremiumToProtocol; - uint256 flashLoanPremiumTotal; -- uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address addressesProvider; -+ address pool; - uint8 userEModeCategory; - bool isAuthorizedFlashBorrower; - } -@@ -253,7 +317,6 @@ library DataTypes { - address userAddress; - uint256 amount; - InterestRateMode interestRateMode; -- uint256 maxStableLoanPercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; -@@ -274,18 +337,16 @@ library DataTypes { - uint256 unbacked; - uint256 liquidityAdded; - uint256 liquidityTaken; -- uint256 totalStableDebt; -- uint256 totalVariableDebt; -- uint256 averageStableBorrowRate; -+ uint256 totalDebt; - uint256 reserveFactor; - address reserve; -- address aToken; -+ bool usingVirtualBalance; -+ uint256 virtualUnderlyingBalance; - } - - struct InitReserveParams { - address asset; - address aTokenAddress; -- address stableDebtAddress; - address variableDebtAddress; - address interestRateStrategyAddress; - uint16 reservesCount; -@@ -293,7 +354,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/tokenization/base/EIP712Base.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/tokenization/base/EIP712Base.sol - - /** - * @title EIP712Base -@@ -363,7 +424,7 @@ abstract contract EIP712Base { - function _EIP712BaseId() internal view virtual returns (string memory); - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -401,17 +462,14 @@ library Errors { - string public constant RESERVE_FROZEN = '28'; // 'Action cannot be performed because the reserve is frozen' - string public constant RESERVE_PAUSED = '29'; // 'Action cannot be performed because the reserve is paused' - string public constant BORROWING_NOT_ENABLED = '30'; // 'Borrowing is not enabled' -- string public constant STABLE_BORROWING_NOT_ENABLED = '31'; // 'Stable borrowing is not enabled' - string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '32'; // 'User cannot withdraw more than the available balance' - string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '33'; // 'Invalid interest rate mode selected' - string public constant COLLATERAL_BALANCE_IS_ZERO = '34'; // 'The collateral balance is 0' - string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '35'; // 'Health factor is lesser than the liquidation threshold' - string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '36'; // 'There is not enough collateral to cover a new borrow' - string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '37'; // 'Collateral is (mostly) the same currency that is being borrowed' -- string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '38'; // 'The requested amount is greater than the max loan size in stable rate mode' - string public constant NO_DEBT_OF_SELECTED_TYPE = '39'; // 'For repayment of a specific type of debt, the user needs to have debt that type' - string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '40'; // 'To repay on behalf of a user an explicit amount to repay is needed' -- string public constant NO_OUTSTANDING_STABLE_DEBT = '41'; // 'User does not have outstanding stable rate debt on this reserve' - string public constant NO_OUTSTANDING_VARIABLE_DEBT = '42'; // 'User does not have outstanding variable rate debt on this reserve' - string public constant UNDERLYING_BALANCE_ZERO = '43'; // 'The underlying balance needs to be greater than 0' - string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '44'; // 'Interest rate rebalance conditions were not met' -@@ -424,7 +482,6 @@ library Errors { - string public constant UNBACKED_MINT_CAP_EXCEEDED = '52'; // 'Unbacked mint cap is exceeded' - string public constant DEBT_CEILING_EXCEEDED = '53'; // 'Debt ceiling is exceeded' - string public constant UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO = '54'; // 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)' -- string public constant STABLE_DEBT_NOT_ZERO = '55'; // 'Stable debt supply is not zero' - string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '56'; // 'Variable debt supply is not zero' - string public constant LTV_VALIDATION_FAILED = '57'; // 'Ltv validation failed' - string public constant INCONSISTENT_EMODE_CATEGORY = '58'; // 'Inconsistent eMode category' -@@ -453,17 +510,28 @@ library Errors { - string public constant DEBT_CEILING_NOT_ZERO = '81'; // 'Debt ceiling is not zero' - string public constant ASSET_NOT_LISTED = '82'; // 'Asset is not listed' - string public constant INVALID_OPTIMAL_USAGE_RATIO = '83'; // 'Invalid optimal usage ratio' -- string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '84'; // 'Invalid optimal stable to total debt ratio' - string public constant UNDERLYING_CANNOT_BE_RESCUED = '85'; // 'The underlying asset cannot be rescued' - string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '86'; // 'Reserve has already been added to reserve list' - string public constant POOL_ADDRESSES_DO_NOT_MATCH = '87'; // 'The token implementation pool address and the pool address provided by the initializing pool do not match' -- string public constant STABLE_BORROWING_ENABLED = '88'; // 'Stable borrowing is enabled' - string public constant SILOED_BORROWING_VIOLATION = '89'; // 'User is trying to borrow multiple assets including a siloed one' - string public constant RESERVE_DEBT_NOT_ZERO = '90'; // the total debt of the reserve needs to be 0 - string public constant FLASHLOAN_DISABLED = '91'; // FlashLoaning for this asset is disabled -+ string public constant INVALID_MAX_RATE = '92'; // The expect maximum borrow rate is invalid -+ string public constant WITHDRAW_TO_ATOKEN = '93'; // Withdrawing to the aToken is not allowed -+ string public constant SUPPLY_TO_ATOKEN = '94'; // Supplying to the aToken is not allowed -+ string public constant SLOPE_2_MUST_BE_GTE_SLOPE_1 = '95'; // Variable interest rate slope 2 can not be lower than slope 1 -+ string public constant CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN = '96'; // 'The caller of the function is not a risk, pool or emergency admin' -+ string public constant LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED = '97'; // 'Liquidation grace sentinel validation failed' -+ string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range -+ string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state -+ string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -482,7 +550,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/ICreditDelegationToken.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/ICreditDelegationToken.sol - - /** - * @title ICreditDelegationToken -@@ -542,7 +610,7 @@ interface ICreditDelegationToken { - ) external; - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -618,7 +686,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -845,7 +913,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -917,7 +985,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1173,7 +1241,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/libraries/aave-upgradeability/VersionedInitializable.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol - - /** - * @title VersionedInitializable -@@ -1250,7 +1318,7 @@ abstract contract VersionedInitializable { - uint256[50] private ______gap; - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1376,7 +1444,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/IACLManager.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1549,7 +1617,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1559,7 +1627,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/IPool.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -1624,7 +1692,7 @@ interface IPool { - * initiator of the transaction on flashLoan() - * @param onBehalfOf The address that will be getting the debt - * @param amount The amount borrowed out -- * @param interestRateMode The rate mode: 1 for Stable, 2 for Variable -+ * @param interestRateMode The rate mode: 2 for Variable, 1 is deprecated (changed on v3.2.0) - * @param borrowRate The numeric rate at which the user has borrowed, expressed in ray - * @param referralCode The referral code used - */ -@@ -1654,18 +1722,6 @@ interface IPool { - bool useATokens - ); - -- /** -- * @dev Emitted on swapBorrowRateMode() -- * @param reserve The address of the underlying asset of the reserve -- * @param user The address of the user swapping his rate mode -- * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable -- */ -- event SwapBorrowRateMode( -- address indexed reserve, -- address indexed user, -- DataTypes.InterestRateMode interestRateMode -- ); -- - /** - * @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets - * @param asset The address of the underlying asset of the reserve -@@ -1694,20 +1750,14 @@ interface IPool { - */ - event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user); - -- /** -- * @dev Emitted on rebalanceStableBorrowRate() -- * @param reserve The address of the underlying asset of the reserve -- * @param user The address of the user for which the rebalance has been executed -- */ -- event RebalanceStableBorrowRate(address indexed reserve, address indexed user); -- - /** - * @dev Emitted on flashLoan() - * @param target The address of the flash loan receiver contract - * @param initiator The address initiating the flash loan - * @param asset The address of the asset being flash borrowed - * @param amount The amount flash borrowed -- * @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt -+ * @param interestRateMode The flashloan mode: 0 for regular flashloan, -+ * 1 for Stable (Deprecated on v3.2.0), 2 for Variable - * @param premium The fee flash borrowed - * @param referralCode The referral code used - */ -@@ -1746,7 +1796,7 @@ interface IPool { - * @dev Emitted when the state of a reserve is updated. - * @param reserve The address of the underlying asset of the reserve - * @param liquidityRate The next liquidity rate -- * @param stableBorrowRate The next stable borrow rate -+ * @param stableBorrowRate The next stable borrow rate @note deprecated on v3.2.0 - * @param variableBorrowRate The next variable borrow rate - * @param liquidityIndex The next liquidity index - * @param variableBorrowIndex The next variable borrow index -@@ -1760,6 +1810,14 @@ interface IPool { - uint256 variableBorrowIndex - ); - -+ /** -+ * @dev Emitted when the deficit of a reserve is covered. -+ * @param reserve The address of the underlying asset of the reserve -+ * @param caller The caller that triggered the DeficitCovered event -+ * @param amountCovered The amount of deficit covered -+ */ -+ event DeficitCovered(address indexed reserve, address caller, uint256 amountCovered); -+ - /** - * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest. - * @param reserve The address of the reserve -@@ -1767,6 +1825,14 @@ interface IPool { - */ - event MintedToTreasury(address indexed reserve, uint256 amountMinted); - -+ /** -+ * @dev Emitted when deficit is realized on a liquidation. -+ * @param user The user address where the bad debt will be burned -+ * @param debtAsset The address of the underlying borrowed asset to be burned -+ * @param amountCreated The amount of deficit created -+ */ -+ event DeficitCreated(address indexed user, address indexed debtAsset, uint256 amountCreated); -+ - /** - * @notice Mints an `amount` of aTokens to the `onBehalfOf` - * @param asset The address of the underlying asset to mint -@@ -1845,13 +1911,12 @@ interface IPool { - - /** - * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower -- * already supplied enough collateral, or he was given enough allowance by a credit delegator on the -- * corresponding debt token (StableDebtToken or VariableDebtToken) -+ * already supplied enough collateral, or he was given enough allowance by a credit delegator on the VariableDebtToken - * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet -- * and 100 stable/variable debt tokens, depending on the `interestRateMode` -+ * and 100 variable debt tokens - * @param asset The address of the underlying asset to borrow - * @param amount The amount to be borrowed -- * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself -@@ -1868,11 +1933,11 @@ interface IPool { - - /** - * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned -- * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address -+ * - E.g. User repays 100 USDC, burning 100 variable debt tokens of the `onBehalfOf` address - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed -@@ -1891,7 +1956,7 @@ interface IPool { - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed -@@ -1915,13 +1980,13 @@ interface IPool { - /** - * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the - * equivalent debt tokens -- * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens -+ * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable debt tokens - * @dev Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken - * balance is not enough to cover the whole debt - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode DEPRECATED in v3.2.0 - * @return The final amount repaid - */ - function repayWithATokens( -@@ -1930,24 +1995,6 @@ interface IPool { - uint256 interestRateMode - ) external returns (uint256); - -- /** -- * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa -- * @param asset The address of the underlying asset borrowed -- * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable -- */ -- function swapBorrowRateMode(address asset, uint256 interestRateMode) external; -- -- /** -- * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve. -- * - Users can be rebalanced if the following conditions are satisfied: -- * 1. Usage ratio is above 95% -- * 2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too -- * much has been borrowed at a stable rate and suppliers are not earning enough -- * @param asset The address of the underlying asset borrowed -- * @param user The address of the user to be rebalanced -- */ -- function rebalanceStableBorrowRate(address asset, address user) external; -- - /** - * @notice Allows suppliers to enable/disable a specific supplied asset as collateral - * @param asset The address of the underlying asset supplied -@@ -1984,9 +2031,9 @@ interface IPool { - * @param amounts The amounts of the assets being flash-borrowed - * @param interestRateModes Types of the debt to open if the flash loan is not returned: - * 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver -- * 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address -+ * 1 -> Deprecated on v3.2.0 - * 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address -- * @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2 -+ * @param onBehalfOf The address that will receive the debt in the case of using 2 on `modes` - * @param params Variadic packed params to pass to the receiver as extra information - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man -@@ -2051,14 +2098,12 @@ interface IPool { - * @dev Only callable by the PoolConfigurator contract - * @param asset The address of the underlying asset of the reserve - * @param aTokenAddress The address of the aToken that will be assigned to the reserve -- * @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve - * @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve - * @param interestRateStrategyAddress The address of the interest rate strategy contract - */ - function initReserve( - address asset, - address aTokenAddress, -- address stableDebtAddress, - address variableDebtAddress, - address interestRateStrategyAddress - ) external; -@@ -2066,6 +2111,7 @@ interface IPool { - /** - * @notice Drop a reserve - * @dev Only callable by the PoolConfigurator contract -+ * @dev Does not reset eMode flags, which must be considered when reusing the same reserve id for a different reserve. - * @param asset The address of the underlying asset of the reserve - */ - function dropReserve(address asset) external; -@@ -2081,6 +2127,22 @@ interface IPool { - address rateStrategyAddress - ) external; - -+ /** -+ * @notice Accumulates interest to all indexes of the reserve -+ * @dev Only callable by the PoolConfigurator contract -+ * @dev To be used when required by the configurator, for example when updating interest rates strategy data -+ * @param asset The address of the underlying asset of the reserve -+ */ -+ function syncIndexesState(address asset) external; -+ -+ /** -+ * @notice Updates interest rates on the reserve data -+ * @dev Only callable by the PoolConfigurator contract -+ * @dev To be used when required by the configurator, for example when updating interest rates strategy data -+ * @param asset The address of the underlying asset of the reserve -+ */ -+ function syncRatesState(address asset) external; -+ - /** - * @notice Sets the configuration bitmap of the reserve as a whole - * @dev Only callable by the PoolConfigurator contract -@@ -2136,7 +2198,14 @@ interface IPool { - * @param asset The address of the underlying asset of the reserve - * @return The state and configuration data of the reserve - */ -- function getReserveData(address asset) external view returns (DataTypes.ReserveData memory); -+ function getReserveData(address asset) external view returns (DataTypes.ReserveDataLegacy memory); -+ -+ /** -+ * @notice Returns the virtual underlying balance of the reserve -+ * @param asset The address of the underlying asset of the reserve -+ * @return The reserve virtual underlying balance -+ */ -+ function getVirtualUnderlyingBalance(address asset) external view returns (uint128); - - /** - * @notice Validates and finalizes an aToken transfer -@@ -2164,6 +2233,13 @@ interface IPool { - */ - function getReservesList() external view returns (address[] memory); - -+ /** -+ * @notice Returns the number of initialized reserves -+ * @dev It includes dropped reserves -+ * @return The count -+ */ -+ function getReservesCount() external view returns (uint256); -+ - /** - * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct - * @param id The id of the reserve as stored in the DataTypes.ReserveData struct -@@ -2199,20 +2275,70 @@ interface IPool { - ) external; - - /** -- * @notice Configures a new category for the eMode. -+ * @notice Configures a new or alters an existing collateral configuration of an eMode. - * @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category. - * The category 0 is reserved as it's the default for volatile assets - * @param id The id of the category - * @param config The configuration of the category - */ -- function configureEModeCategory(uint8 id, DataTypes.EModeCategory memory config) external; -+ function configureEModeCategory( -+ uint8 id, -+ DataTypes.EModeCategoryBaseConfiguration memory config -+ ) external; -+ -+ /** -+ * @notice Replaces the current eMode collateralBitmap. -+ * @param id The id of the category -+ * @param collateralBitmap The collateralBitmap of the category -+ */ -+ function configureEModeCategoryCollateralBitmap(uint8 id, uint128 collateralBitmap) external; -+ -+ /** -+ * @notice Replaces the current eMode borrowableBitmap. -+ * @param id The id of the category -+ * @param borrowableBitmap The borrowableBitmap of the category -+ */ -+ function configureEModeCategoryBorrowableBitmap(uint8 id, uint128 borrowableBitmap) external; - - /** - * @notice Returns the data of an eMode category -+ * @dev DEPRECATED use independent getters instead - * @param id The id of the category - * @return The configuration data of the category - */ -- function getEModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory); -+ function getEModeCategoryData( -+ uint8 id -+ ) external view returns (DataTypes.EModeCategoryLegacy memory); -+ -+ /** -+ * @notice Returns the label of an eMode category -+ * @param id The id of the category -+ * @return The label of the category -+ */ -+ function getEModeCategoryLabel(uint8 id) external view returns (string memory); -+ -+ /** -+ * @notice Returns the collateral config of an eMode category -+ * @param id The id of the category -+ * @return The ltv,lt,lb of the category -+ */ -+ function getEModeCategoryCollateralConfig( -+ uint8 id -+ ) external view returns (DataTypes.CollateralConfig memory); -+ -+ /** -+ * @notice Returns the collateralBitmap of an eMode category -+ * @param id The id of the category -+ * @return The collateralBitmap of the category -+ */ -+ function getEModeCategoryCollateralBitmap(uint8 id) external view returns (uint128); -+ -+ /** -+ * @notice Returns the borrowableBitmap of an eMode category -+ * @param id The id of the category -+ * @return The borrowableBitmap of the category -+ */ -+ function getEModeCategoryBorrowableBitmap(uint8 id) external view returns (uint128); - - /** - * @notice Allows a user to use the protocol in eMode -@@ -2235,10 +2361,20 @@ interface IPool { - function resetIsolationModeTotalDebt(address asset) external; - - /** -- * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate -- * @return The percentage of available liquidity to borrow, expressed in bps -- */ -- function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256); -+ * @notice Sets the liquidation grace period of the given asset -+ * @dev To enable a liquidation grace period, a timestamp in the future should be set, -+ * To disable a liquidation grace period, any timestamp in the past works, like 0 -+ * @param asset The address of the underlying asset to set the liquidationGracePeriod -+ * @param until Timestamp when the liquidation grace period will end -+ **/ -+ function setLiquidationGracePeriod(address asset, uint40 until) external; -+ -+ /** -+ * @notice Returns the liquidation grace period of the given asset -+ * @param asset The address of the underlying asset -+ * @return Timestamp when the liquidation grace period will end -+ **/ -+ function getLiquidationGracePeriod(address asset) external view returns (uint40); - - /** - * @notice Returns the total fee on flash loans -@@ -2291,9 +2427,75 @@ interface IPool { - * 0 if the action is executed directly by the user, without any middle-man - */ - function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external; -+ -+ /** -+ * @notice It covers the deficit of a specified reserve by burning: -+ * - the equivalent aToken `amount` for assets with virtual accounting enabled -+ * - the equivalent `amount` of underlying for assets with virtual accounting disabled (e.g. GHO) -+ * @dev The deficit of a reserve can occur due to situations where borrowed assets are not repaid, leading to bad debt. -+ * @param asset The address of the underlying asset to cover the deficit. -+ * @param amount The amount to be covered, in aToken or underlying on non-virtual accounted assets -+ */ -+ function eliminateReserveDeficit(address asset, uint256 amount) external; -+ -+ /** -+ * @notice Returns the current deficit of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The current deficit of the reserve -+ */ -+ function getReserveDeficit(address asset) external view returns (uint256); -+ -+ /** -+ * @notice Returns the aToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the aToken -+ */ -+ function getReserveAToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Returns the variableDebtToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the variableDebtToken -+ */ -+ function getReserveVariableDebtToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external FlashLoanLogic -+ */ -+ function getFlashLoanLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external BorrowLogic -+ */ -+ function getBorrowLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external BridgeLogic -+ */ -+ function getBridgeLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external EModeLogic -+ */ -+ function getEModeLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external LiquidationLogic -+ */ -+ function getLiquidationLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external PoolLogic -+ */ -+ function getPoolLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external SupplyLogic -+ */ -+ function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -2342,12 +2544,12 @@ interface IInitializableDebtToken { - ) external; - } - + -// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/tokenization/base/DebtTokenBase.sol +// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/tokenization/base/DebtTokenBase.sol - + /** * @title DebtTokenBase * @author Aave @@ -871,19 +18,10 @@ index aa145c3..ba3ffd3 100644 @@ -2438,7 +2640,7 @@ abstract contract DebtTokenBase is } } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -2481,7 +2683,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - + -// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/tokenization/base/IncentivizedERC20.sol +// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - + /** * @title IncentivizedERC20 @@ -2512,8 +2714,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { @@ -918,32 +56,14 @@ index aa145c3..ba3ffd3 100644 + _decimals = decimals_; POOL = pool; } - + @@ -2705,7 +2906,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { } } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/tokenization/base/MintableIncentivizedERC20.sol - - /** - * @title MintableIncentivizedERC20 -@@ -2767,7 +2968,7 @@ abstract contract MintableIncentivizedERC20 is IncentivizedERC20 { - } - } - --// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol -+// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/tokenization/base/ScaledBalanceTokenBase.sol - - /** - * @title ScaledBalanceTokenBase -@@ -2916,7 +3117,7 @@ abstract contract ScaledBalanceTokenBase is MintableIncentivizedERC20, IScaledBa - } - } - + -// downloads/GNOSIS/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtToken/src/core/contracts/protocol/tokenization/VariableDebtToken.sol +// downloads/CELO/DEFAULT_VARIABLE_DEBT_TOKEN_IMPL/VariableDebtTokenInstance/src/contracts/protocol/tokenization/VariableDebtToken.sol - + /** * @title VariableDebtToken @@ -2925,12 +3126,10 @@ abstract contract ScaledBalanceTokenBase is MintableIncentivizedERC20, IScaledBa @@ -954,7 +74,7 @@ index aa145c3..ba3ffd3 100644 +abstract contract VariableDebtToken is DebtTokenBase, ScaledBalanceTokenBase, IVariableDebtToken { using WadRayMath for uint256; using SafeCast for uint256; - + - uint256 public constant DEBT_TOKEN_REVISION = 0x1; - /** @@ -991,7 +111,7 @@ index aa145c3..ba3ffd3 100644 - return DEBT_TOKEN_REVISION; - } + ) external virtual; - + /// @inheritdoc IERC20 function balanceOf(address user) public view virtual override returns (uint256) { @@ -3057,3 +3231,47 @@ contract VariableDebtToken is DebtTokenBase, ScaledBalanceTokenBase, IVariableDe diff --git a/GNOSIS_CELO/EMISSION_MANAGER_DIFF.md b/GNOSIS_CELO/EMISSION_MANAGER_DIFF.md index 0ac8ffb3..13583c7f 100644 --- a/GNOSIS_CELO/EMISSION_MANAGER_DIFF.md +++ b/GNOSIS_CELO/EMISSION_MANAGER_DIFF.md @@ -3,118 +3,10 @@ diff --git a/./downloads/GNOSIS/EMISSION_MANAGER.sol b/./downloads/CELO/EMISSION index 65dd5d6..fc34c5f 100644 --- a/./downloads/GNOSIS/EMISSION_MANAGER.sol +++ b/./downloads/CELO/EMISSION_MANAGER.sol -@@ -1,7 +1,55 @@ --// SPDX-License-Identifier: MIT --pragma solidity ^0.8.10; -+// SPDX-License-Identifier: BUSL-1.1 -+pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/core/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/dependencies/chainlink/AggregatorInterface.sol -+ -+// Chainlink Contracts v0.8 -+ -+interface AggregatorInterface { -+ function decimals() external view returns (uint8); -+ -+ function description() external view returns (string memory); -+ -+ function getRoundData( -+ uint80 _roundId -+ ) -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ function latestRoundData() -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ 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); -+} -+ -+// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -24,26 +72,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/periphery/contracts/misc/interfaces/IEACAggregatorProxy.sol -- --interface IEACAggregatorProxy { -- function decimals() external view returns (uint8); -- -- 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 timestamp); -- event NewRound(uint256 indexed roundId, address indexed startedBy); --} -- --// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/periphery/contracts/rewards/interfaces/IRewardsDistributor.sol -+// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/rewards/interfaces/IRewardsDistributor.sol - - /** - * @title IRewardsDistributor -@@ -220,7 +249,7 @@ interface IRewardsDistributor { - function getEmissionManager() external view returns (address); - } - --// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/periphery/contracts/rewards/interfaces/ITransferStrategyBase.sol -+// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/rewards/interfaces/ITransferStrategyBase.sol - - interface ITransferStrategyBase { - event EmergencyWithdrawal( -@@ -258,7 +287,7 @@ interface ITransferStrategyBase { - function emergencyWithdrawal(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/core/contracts/dependencies/openzeppelin/contracts/Ownable.sol -+// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/dependencies/openzeppelin/contracts/Ownable.sol - - /** - * @dev Contract module which provides a basic access control mechanism, where -@@ -324,7 +353,7 @@ contract Ownable is Context { - } - } - + -// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/periphery/contracts/rewards/libraries/RewardsDataTypes.sol +// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/rewards/libraries/RewardsDataTypes.sol - + library RewardsDataTypes { struct RewardsConfigInput { @@ -334,7 +363,7 @@ library RewardsDataTypes { @@ -124,15 +16,15 @@ index 65dd5d6..fc34c5f 100644 - IEACAggregatorProxy rewardOracle; + AggregatorInterface rewardOracle; } - + struct UserAssetBalance { @@ -375,7 +404,7 @@ library RewardsDataTypes { } } - + -// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/periphery/contracts/rewards/interfaces/IRewardsController.sol +// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/rewards/interfaces/IRewardsController.sol - + /** * @title IRewardsController @@ -441,9 +470,9 @@ interface IRewardsController is IRewardsDistributor { @@ -144,7 +36,7 @@ index 65dd5d6..fc34c5f 100644 */ - function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external; + function setRewardOracle(address reward, AggregatorInterface rewardOracle) external; - + /** * @dev Get the price aggregator oracle address @@ -475,8 +504,8 @@ interface IRewardsController is IRewardsDistributor { @@ -157,14 +49,14 @@ index 65dd5d6..fc34c5f 100644 + * Must follow Chainlink Aggregator AggregatorInterface interface to be compatible. */ function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external; - + @@ -573,7 +602,7 @@ interface IRewardsController is IRewardsDistributor { ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts); } - + -// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/periphery/contracts/rewards/interfaces/IEmissionManager.sol +// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/rewards/interfaces/IEmissionManager.sol - + /** * @title IEmissionManager @@ -603,8 +632,8 @@ interface IEmissionManager { @@ -177,7 +69,7 @@ index 65dd5d6..fc34c5f 100644 + * Must follow Chainlink Aggregator AggregatorInterface interface to be compatible. */ function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external; - + @@ -620,13 +649,13 @@ interface IEmissionManager { * @dev Sets an Aave Oracle contract to enforce rewards with a source of value. * @dev Only callable by the emission admin of the given reward @@ -192,16 +84,16 @@ index 65dd5d6..fc34c5f 100644 */ - function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external; + function setRewardOracle(address reward, AggregatorInterface rewardOracle) external; - + /** * @dev Sets the end date for the distribution @@ -686,7 +715,7 @@ interface IEmissionManager { function getEmissionAdmin(address reward) external view returns (address); } - + -// downloads/GNOSIS/EMISSION_MANAGER/EmissionManager/src/periphery/contracts/rewards/EmissionManager.sol +// downloads/CELO/EMISSION_MANAGER/EmissionManager/src/contracts/rewards/EmissionManager.sol - + /** * @title EmissionManager @@ -734,7 +763,7 @@ contract EmissionManager is Ownable, IEmissionManager { diff --git a/GNOSIS_CELO/EMODE_LOGIC_DIFF.md b/GNOSIS_CELO/EMODE_LOGIC_DIFF.md index 3d0730fd..8124bf07 100644 --- a/GNOSIS_CELO/EMODE_LOGIC_DIFF.md +++ b/GNOSIS_CELO/EMODE_LOGIC_DIFF.md @@ -3,292 +3,5 @@ diff --git a/./downloads/GNOSIS/EMODE_LOGIC.sol b/./downloads/CELO/EMODE_LOGIC.s index d8db78a..867ce2d 100644 --- a/./downloads/GNOSIS/EMODE_LOGIC.sol +++ b/./downloads/CELO/EMODE_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1638,7 +1638,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1751,7 +1751,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1924,7 +1924,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1934,7 +1934,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -1999,7 +1999,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2026,7 +2026,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2123,7 +2123,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2991,7 +2991,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3575,7 +3575,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3624,7 +3624,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3856,7 +3856,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3909,7 +3909,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3958,7 +3958,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4001,7 +4001,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4135,7 +4135,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4358,7 +4358,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4660,7 +4660,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -4912,7 +4912,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5532,7 +5532,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/EMODE_LOGIC/EModeLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library + ``` diff --git a/GNOSIS_CELO/FLASHLOAN_LOGIC_DIFF.md b/GNOSIS_CELO/FLASHLOAN_LOGIC_DIFF.md index b60b30ee..dbf966e4 100644 --- a/GNOSIS_CELO/FLASHLOAN_LOGIC_DIFF.md +++ b/GNOSIS_CELO/FLASHLOAN_LOGIC_DIFF.md @@ -3,337 +3,5 @@ diff --git a/./downloads/GNOSIS/FLASHLOAN_LOGIC.sol b/./downloads/CELO/FLASHLOAN index 67fc4e7..a0a5763 100644 --- a/./downloads/GNOSIS/FLASHLOAN_LOGIC.sol +++ b/./downloads/CELO/FLASHLOAN_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1638,7 +1638,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1751,7 +1751,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1924,7 +1924,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1934,7 +1934,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -1999,7 +1999,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2026,7 +2026,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2123,7 +2123,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2991,7 +2991,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3575,7 +3575,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3624,7 +3624,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/misc/flashloan/interfaces/IFlashLoanReceiver.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/misc/flashloan/interfaces/IFlashLoanReceiver.sol - - /** - * @title IFlashLoanReceiver -@@ -3657,7 +3657,7 @@ interface IFlashLoanReceiver { - function POOL() external view returns (IPool); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol - - /** - * @title IFlashLoanSimpleReceiver -@@ -3690,7 +3690,7 @@ interface IFlashLoanSimpleReceiver { - function POOL() external view returns (IPool); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3922,7 +3922,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3975,7 +3975,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -4024,7 +4024,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol - - /** - * @title IsolationModeLogic library -@@ -4099,7 +4099,7 @@ library IsolationModeLogic { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4142,7 +4142,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4276,7 +4276,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4499,7 +4499,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4801,7 +4801,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library -@@ -4863,7 +4863,7 @@ library EModeLogic { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -5115,7 +5115,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5735,7 +5735,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/BorrowLogic.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/BorrowLogic.sol - - /** - * @title BorrowLogic library -@@ -5958,7 +5958,7 @@ library BorrowLogic { - } - } - --// downloads/GNOSIS/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/FlashLoanLogic.sol -+// downloads/CELO/FLASHLOAN_LOGIC/FlashLoanLogic/src/contracts/protocol/libraries/logic/FlashLoanLogic.sol - - /** - * @title FlashLoanLogic library + ``` diff --git a/GNOSIS_CELO/LIQUIDATION_LOGIC_DIFF.md b/GNOSIS_CELO/LIQUIDATION_LOGIC_DIFF.md index a59345a4..24ec3c5f 100644 --- a/GNOSIS_CELO/LIQUIDATION_LOGIC_DIFF.md +++ b/GNOSIS_CELO/LIQUIDATION_LOGIC_DIFF.md @@ -3,310 +3,5 @@ diff --git a/./downloads/GNOSIS/LIQUIDATION_LOGIC.sol b/./downloads/CELO/LIQUIDA index 40c0173..e9ff01e 100644 --- a/./downloads/GNOSIS/LIQUIDATION_LOGIC.sol +++ b/./downloads/CELO/LIQUIDATION_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1638,7 +1638,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1751,7 +1751,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1924,7 +1924,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1934,7 +1934,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -1999,7 +1999,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2026,7 +2026,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2123,7 +2123,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2991,7 +2991,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3575,7 +3575,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3624,7 +3624,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3856,7 +3856,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3909,7 +3909,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3958,7 +3958,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol - - /** - * @title IsolationModeLogic library -@@ -4033,7 +4033,7 @@ library IsolationModeLogic { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4076,7 +4076,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4210,7 +4210,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4433,7 +4433,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4735,7 +4735,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library -@@ -4797,7 +4797,7 @@ library EModeLogic { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -5049,7 +5049,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5669,7 +5669,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/LiquidationLogic.sol -+// downloads/CELO/LIQUIDATION_LOGIC/LiquidationLogic/src/contracts/protocol/libraries/logic/LiquidationLogic.sol - - interface IGhoVariableDebtToken { - function getBalanceFromInterest(address user) external view returns (uint256); + ``` diff --git a/GNOSIS_CELO/ORACLE_DIFF.md b/GNOSIS_CELO/ORACLE_DIFF.md index ffc6a964..0593adf2 100644 --- a/GNOSIS_CELO/ORACLE_DIFF.md +++ b/GNOSIS_CELO/ORACLE_DIFF.md @@ -3,148 +3,5 @@ diff --git a/./downloads/GNOSIS/ORACLE.sol b/./downloads/CELO/ORACLE.sol index ac0cf84..0d5df16 100644 --- a/./downloads/GNOSIS/ORACLE.sol +++ b/./downloads/CELO/ORACLE.sol -@@ -1,11 +1,39 @@ - // SPDX-License-Identifier: MIT - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/ORACLE/AaveOracle/src/core/contracts/dependencies/chainlink/AggregatorInterface.sol -+// downloads/CELO/ORACLE/AaveOracle/src/contracts/dependencies/chainlink/AggregatorInterface.sol - - // Chainlink Contracts v0.8 - - interface AggregatorInterface { -+ function decimals() external view returns (uint8); -+ -+ function description() external view returns (string memory); -+ -+ function getRoundData( -+ uint80 _roundId -+ ) -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ function latestRoundData() -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ - function latestAnswer() external view returns (int256); - - function latestTimestamp() external view returns (uint256); -@@ -21,7 +49,7 @@ interface AggregatorInterface { - event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); - } - --// downloads/GNOSIS/ORACLE/AaveOracle/src/core/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/ORACLE/AaveOracle/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -59,17 +87,14 @@ library Errors { - string public constant RESERVE_FROZEN = '28'; // 'Action cannot be performed because the reserve is frozen' - string public constant RESERVE_PAUSED = '29'; // 'Action cannot be performed because the reserve is paused' - string public constant BORROWING_NOT_ENABLED = '30'; // 'Borrowing is not enabled' -- string public constant STABLE_BORROWING_NOT_ENABLED = '31'; // 'Stable borrowing is not enabled' - string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '32'; // 'User cannot withdraw more than the available balance' - string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '33'; // 'Invalid interest rate mode selected' - string public constant COLLATERAL_BALANCE_IS_ZERO = '34'; // 'The collateral balance is 0' - string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '35'; // 'Health factor is lesser than the liquidation threshold' - string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '36'; // 'There is not enough collateral to cover a new borrow' - string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '37'; // 'Collateral is (mostly) the same currency that is being borrowed' -- string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '38'; // 'The requested amount is greater than the max loan size in stable rate mode' - string public constant NO_DEBT_OF_SELECTED_TYPE = '39'; // 'For repayment of a specific type of debt, the user needs to have debt that type' - string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '40'; // 'To repay on behalf of a user an explicit amount to repay is needed' -- string public constant NO_OUTSTANDING_STABLE_DEBT = '41'; // 'User does not have outstanding stable rate debt on this reserve' - string public constant NO_OUTSTANDING_VARIABLE_DEBT = '42'; // 'User does not have outstanding variable rate debt on this reserve' - string public constant UNDERLYING_BALANCE_ZERO = '43'; // 'The underlying balance needs to be greater than 0' - string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '44'; // 'Interest rate rebalance conditions were not met' -@@ -82,7 +107,6 @@ library Errors { - string public constant UNBACKED_MINT_CAP_EXCEEDED = '52'; // 'Unbacked mint cap is exceeded' - string public constant DEBT_CEILING_EXCEEDED = '53'; // 'Debt ceiling is exceeded' - string public constant UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO = '54'; // 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)' -- string public constant STABLE_DEBT_NOT_ZERO = '55'; // 'Stable debt supply is not zero' - string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '56'; // 'Variable debt supply is not zero' - string public constant LTV_VALIDATION_FAILED = '57'; // 'Ltv validation failed' - string public constant INCONSISTENT_EMODE_CATEGORY = '58'; // 'Inconsistent eMode category' -@@ -111,17 +135,28 @@ library Errors { - string public constant DEBT_CEILING_NOT_ZERO = '81'; // 'Debt ceiling is not zero' - string public constant ASSET_NOT_LISTED = '82'; // 'Asset is not listed' - string public constant INVALID_OPTIMAL_USAGE_RATIO = '83'; // 'Invalid optimal usage ratio' -- string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '84'; // 'Invalid optimal stable to total debt ratio' - string public constant UNDERLYING_CANNOT_BE_RESCUED = '85'; // 'The underlying asset cannot be rescued' - string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '86'; // 'Reserve has already been added to reserve list' - string public constant POOL_ADDRESSES_DO_NOT_MATCH = '87'; // 'The token implementation pool address and the pool address provided by the initializing pool do not match' -- string public constant STABLE_BORROWING_ENABLED = '88'; // 'Stable borrowing is enabled' - string public constant SILOED_BORROWING_VIOLATION = '89'; // 'User is trying to borrow multiple assets including a siloed one' - string public constant RESERVE_DEBT_NOT_ZERO = '90'; // the total debt of the reserve needs to be 0 - string public constant FLASHLOAN_DISABLED = '91'; // FlashLoaning for this asset is disabled -+ string public constant INVALID_MAX_RATE = '92'; // The expect maximum borrow rate is invalid -+ string public constant WITHDRAW_TO_ATOKEN = '93'; // Withdrawing to the aToken is not allowed -+ string public constant SUPPLY_TO_ATOKEN = '94'; // Supplying to the aToken is not allowed -+ string public constant SLOPE_2_MUST_BE_GTE_SLOPE_1 = '95'; // Variable interest rate slope 2 can not be lower than slope 1 -+ string public constant CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN = '96'; // 'The caller of the function is not a risk, pool or emergency admin' -+ string public constant LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED = '97'; // 'Liquidation grace sentinel validation failed' -+ string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range -+ string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state -+ string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/ORACLE/AaveOracle/src/core/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/ORACLE/AaveOracle/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -348,7 +383,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/ORACLE/AaveOracle/src/core/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/ORACLE/AaveOracle/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -378,7 +413,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/ORACLE/AaveOracle/src/core/contracts/interfaces/IACLManager.sol -+// downloads/CELO/ORACLE/AaveOracle/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -551,7 +586,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/ORACLE/AaveOracle/src/core/contracts/interfaces/IAaveOracle.sol -+// downloads/CELO/ORACLE/AaveOracle/src/contracts/interfaces/IAaveOracle.sol - - /** - * @title IAaveOracle -@@ -619,7 +654,7 @@ interface IAaveOracle is IPriceOracleGetter { - function getFallbackOracle() external view returns (address); - } - --// downloads/GNOSIS/ORACLE/AaveOracle/src/core/contracts/misc/AaveOracle.sol -+// downloads/CELO/ORACLE/AaveOracle/src/contracts/misc/AaveOracle.sol - - /** - * @title AaveOracle + ``` diff --git a/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_DIFF.md b/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_DIFF.md index e91d9f0f..e36887e5 100644 --- a/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_DIFF.md +++ b/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_DIFF.md @@ -3,47 +3,16 @@ diff --git a/./downloads/GNOSIS/POOL_ADDRESSES_PROVIDER.sol b/./downloads/CELO/P index ac6b143..6c08fed 100644 --- a/./downloads/GNOSIS/POOL_ADDRESSES_PROVIDER.sol +++ b/./downloads/CELO/POOL_ADDRESSES_PROVIDER.sol -@@ -1,7 +1,7 @@ --// SPDX-License-Identifier: MIT -+// SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -471,7 +471,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - + -// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol +// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol - + /** * @title Proxy @@ -490,6 +490,14 @@ abstract contract Proxy { _fallback(); } - + + /** + * @dev Fallback function that will run if call data is empty. + * IMPORTANT. receive() on implementation contracts will be unreachable @@ -58,32 +27,14 @@ index ac6b143..6c08fed 100644 @@ -544,7 +552,7 @@ abstract contract Proxy { } } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/dependencies/openzeppelin/contracts/Ownable.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/dependencies/openzeppelin/contracts/Ownable.sol - - /** - * @dev Contract module which provides a basic access control mechanism, where -@@ -610,7 +618,7 @@ contract Ownable is Context { - } - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol - - /** - * @title BaseUpgradeabilityProxy -@@ -673,7 +681,7 @@ contract BaseUpgradeabilityProxy is Proxy { - } - } - + -// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/protocol/libraries/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol +// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol - + /** * @title BaseImmutableAdminUpgradeabilityProxy @@ -690,10 +698,10 @@ contract BaseImmutableAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { - + /** * @dev Constructor. - * @param admin The address of the admin @@ -94,33 +45,9 @@ index ac6b143..6c08fed 100644 + constructor(address admin_) { + _admin = admin_; } - + modifier ifAdmin() { @@ -756,7 +764,7 @@ contract BaseImmutableAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { } } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol - - /** - * @title InitializableUpgradeabilityProxy -@@ -783,7 +791,7 @@ contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { - } - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol - - /** - * @title InitializableAdminUpgradeabilityProxy -@@ -808,7 +816,7 @@ contract InitializableImmutableAdminUpgradeabilityProxy is - } - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/core/contracts/protocol/configuration/PoolAddressesProvider.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER/PoolAddressesProvider/src/contracts/protocol/configuration/PoolAddressesProvider.sol - - /** - * @title PoolAddressesProvider ``` diff --git a/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_REGISTRY_DIFF.md b/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_REGISTRY_DIFF.md index b1f24c43..7d8a5d34 100644 --- a/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_REGISTRY_DIFF.md +++ b/GNOSIS_CELO/POOL_ADDRESSES_PROVIDER_REGISTRY_DIFF.md @@ -3,99 +3,5 @@ diff --git a/./downloads/GNOSIS/POOL_ADDRESSES_PROVIDER_REGISTRY.sol b/./downloa index e53c84f..8086e31 100644 --- a/./downloads/GNOSIS/POOL_ADDRESSES_PROVIDER_REGISTRY.sol +++ b/./downloads/CELO/POOL_ADDRESSES_PROVIDER_REGISTRY.sol -@@ -1,7 +1,7 @@ --// SPDX-License-Identifier: MIT -+// SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/core/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -24,7 +24,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/core/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -62,17 +62,14 @@ library Errors { - string public constant RESERVE_FROZEN = '28'; // 'Action cannot be performed because the reserve is frozen' - string public constant RESERVE_PAUSED = '29'; // 'Action cannot be performed because the reserve is paused' - string public constant BORROWING_NOT_ENABLED = '30'; // 'Borrowing is not enabled' -- string public constant STABLE_BORROWING_NOT_ENABLED = '31'; // 'Stable borrowing is not enabled' - string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '32'; // 'User cannot withdraw more than the available balance' - string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '33'; // 'Invalid interest rate mode selected' - string public constant COLLATERAL_BALANCE_IS_ZERO = '34'; // 'The collateral balance is 0' - string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '35'; // 'Health factor is lesser than the liquidation threshold' - string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '36'; // 'There is not enough collateral to cover a new borrow' - string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '37'; // 'Collateral is (mostly) the same currency that is being borrowed' -- string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '38'; // 'The requested amount is greater than the max loan size in stable rate mode' - string public constant NO_DEBT_OF_SELECTED_TYPE = '39'; // 'For repayment of a specific type of debt, the user needs to have debt that type' - string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '40'; // 'To repay on behalf of a user an explicit amount to repay is needed' -- string public constant NO_OUTSTANDING_STABLE_DEBT = '41'; // 'User does not have outstanding stable rate debt on this reserve' - string public constant NO_OUTSTANDING_VARIABLE_DEBT = '42'; // 'User does not have outstanding variable rate debt on this reserve' - string public constant UNDERLYING_BALANCE_ZERO = '43'; // 'The underlying balance needs to be greater than 0' - string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '44'; // 'Interest rate rebalance conditions were not met' -@@ -85,7 +82,6 @@ library Errors { - string public constant UNBACKED_MINT_CAP_EXCEEDED = '52'; // 'Unbacked mint cap is exceeded' - string public constant DEBT_CEILING_EXCEEDED = '53'; // 'Debt ceiling is exceeded' - string public constant UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO = '54'; // 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)' -- string public constant STABLE_DEBT_NOT_ZERO = '55'; // 'Stable debt supply is not zero' - string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '56'; // 'Variable debt supply is not zero' - string public constant LTV_VALIDATION_FAILED = '57'; // 'Ltv validation failed' - string public constant INCONSISTENT_EMODE_CATEGORY = '58'; // 'Inconsistent eMode category' -@@ -114,17 +110,28 @@ library Errors { - string public constant DEBT_CEILING_NOT_ZERO = '81'; // 'Debt ceiling is not zero' - string public constant ASSET_NOT_LISTED = '82'; // 'Asset is not listed' - string public constant INVALID_OPTIMAL_USAGE_RATIO = '83'; // 'Invalid optimal usage ratio' -- string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '84'; // 'Invalid optimal stable to total debt ratio' - string public constant UNDERLYING_CANNOT_BE_RESCUED = '85'; // 'The underlying asset cannot be rescued' - string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '86'; // 'Reserve has already been added to reserve list' - string public constant POOL_ADDRESSES_DO_NOT_MATCH = '87'; // 'The token implementation pool address and the pool address provided by the initializing pool do not match' -- string public constant STABLE_BORROWING_ENABLED = '88'; // 'Stable borrowing is enabled' - string public constant SILOED_BORROWING_VIOLATION = '89'; // 'User is trying to borrow multiple assets including a siloed one' - string public constant RESERVE_DEBT_NOT_ZERO = '90'; // the total debt of the reserve needs to be 0 - string public constant FLASHLOAN_DISABLED = '91'; // FlashLoaning for this asset is disabled -+ string public constant INVALID_MAX_RATE = '92'; // The expect maximum borrow rate is invalid -+ string public constant WITHDRAW_TO_ATOKEN = '93'; // Withdrawing to the aToken is not allowed -+ string public constant SUPPLY_TO_ATOKEN = '94'; // Supplying to the aToken is not allowed -+ string public constant SLOPE_2_MUST_BE_GTE_SLOPE_1 = '95'; // Variable interest rate slope 2 can not be lower than slope 1 -+ string public constant CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN = '96'; // 'The caller of the function is not a risk, pool or emergency admin' -+ string public constant LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED = '97'; // 'Liquidation grace sentinel validation failed' -+ string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range -+ string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state -+ string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/core/contracts/interfaces/IPoolAddressesProviderRegistry.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/contracts/interfaces/IPoolAddressesProviderRegistry.sol - - /** - * @title IPoolAddressesProviderRegistry -@@ -184,7 +191,7 @@ interface IPoolAddressesProviderRegistry { - function unregisterAddressesProvider(address provider) external; - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/core/contracts/dependencies/openzeppelin/contracts/Ownable.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/contracts/dependencies/openzeppelin/contracts/Ownable.sol - - /** - * @dev Contract module which provides a basic access control mechanism, where -@@ -250,7 +257,7 @@ contract Ownable is Context { - } - } - --// downloads/GNOSIS/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/core/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol -+// downloads/CELO/POOL_ADDRESSES_PROVIDER_REGISTRY/PoolAddressesProviderRegistry/src/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol - - /** - * @title PoolAddressesProviderRegistry + ``` diff --git a/GNOSIS_CELO/POOL_CONFIGURATOR_IMPL_DIFF.md b/GNOSIS_CELO/POOL_CONFIGURATOR_IMPL_DIFF.md index 50afb90f..83eeb0c2 100644 --- a/GNOSIS_CELO/POOL_CONFIGURATOR_IMPL_DIFF.md +++ b/GNOSIS_CELO/POOL_CONFIGURATOR_IMPL_DIFF.md @@ -3,256 +3,5 @@ diff --git a/./downloads/GNOSIS/POOL_CONFIGURATOR_IMPL.sol b/./downloads/CELO/PO index 4b3c4ad..f370587 100644 --- a/./downloads/GNOSIS/POOL_CONFIGURATOR_IMPL.sol +++ b/./downloads/CELO/POOL_CONFIGURATOR_IMPL.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol - - library ConfiguratorInputTypes { - struct InitReserveInput { -@@ -260,7 +260,7 @@ library ConfiguratorInputTypes { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -590,7 +590,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -697,7 +697,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -716,7 +716,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -792,7 +792,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1019,7 +1019,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1080,7 +1080,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol - - /** - * @title Proxy -@@ -1161,7 +1161,7 @@ abstract contract Proxy { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol - - /** - * @title VersionedInitializable -@@ -1238,7 +1238,7 @@ abstract contract VersionedInitializable { - uint256[50] private ______gap; - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1411,7 +1411,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1421,7 +1421,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IPoolDataProvider.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IPoolDataProvider.sol - - /** - * @title IPoolDataProvider -@@ -1676,7 +1676,7 @@ interface IPoolDataProvider { - function getReserveDeficit(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -1703,7 +1703,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol - - /** - * @title BaseUpgradeabilityProxy -@@ -1766,7 +1766,7 @@ contract BaseUpgradeabilityProxy is Proxy { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IPool.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2634,7 +2634,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3218,7 +3218,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/misc/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol - - /** - * @title BaseImmutableAdminUpgradeabilityProxy -@@ -3301,7 +3301,7 @@ contract BaseImmutableAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3350,7 +3350,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol - - /** - * @title IDefaultInterestRateStrategyV2 -@@ -3508,7 +3508,7 @@ interface IDefaultInterestRateStrategyV2 is IReserveInterestRateStrategy { - function setInterestRateParams(address reserve, InterestRateData calldata rateData) external; - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol - - /** - * @title InitializableUpgradeabilityProxy -@@ -3535,7 +3535,7 @@ contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3588,7 +3588,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3637,7 +3637,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/interfaces/IPoolConfigurator.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/interfaces/IPoolConfigurator.sol - - /** - * @title IPoolConfigurator -@@ -4185,7 +4185,7 @@ interface IPoolConfigurator { - function MAX_GRACE_PERIOD() external view returns (uint40); - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol - - /** - * @title InitializableAdminUpgradeabilityProxy -@@ -4210,7 +4210,7 @@ contract InitializableImmutableAdminUpgradeabilityProxy is - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol - - /** - * @title ConfiguratorLogic library -@@ -4414,7 +4414,7 @@ library ConfiguratorLogic { - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/protocol/pool/PoolConfigurator.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/protocol/pool/PoolConfigurator.sol - - /** - * @title PoolConfigurator -@@ -5027,7 +5027,7 @@ abstract contract PoolConfigurator is VersionedInitializable, IPoolConfigurator - } - } - --// downloads/GNOSIS/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/lib/aave-v3-origin/src/contracts/instances/PoolConfiguratorInstance.sol -+// downloads/CELO/POOL_CONFIGURATOR_IMPL/PoolConfiguratorInstance/src/contracts/instances/PoolConfiguratorInstance.sol - - contract PoolConfiguratorInstance is PoolConfigurator { - uint256 public constant CONFIGURATOR_REVISION = 5; + ``` diff --git a/GNOSIS_CELO/POOL_IMPL_DIFF.md b/GNOSIS_CELO/POOL_IMPL_DIFF.md index 4222a2d5..0133eeae 100644 --- a/GNOSIS_CELO/POOL_IMPL_DIFF.md +++ b/GNOSIS_CELO/POOL_IMPL_DIFF.md @@ -3,418 +3,5 @@ diff --git a/./downloads/GNOSIS/POOL_IMPL.sol b/./downloads/CELO/POOL_IMPL.sol index c910368..adf0527 100644 --- a/./downloads/GNOSIS/POOL_IMPL.sol +++ b/./downloads/CELO/POOL_IMPL.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/misc/aave-upgradeability/VersionedInitializable.sol - - /** - * @title VersionedInitializable -@@ -1589,7 +1589,7 @@ abstract contract VersionedInitializable { - uint256[50] private ______gap; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1715,7 +1715,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1828,7 +1828,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -2001,7 +2001,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -2011,7 +2011,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IERC20WithPermit.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IERC20WithPermit.sol - - /** - * @title IERC20WithPermit -@@ -2042,7 +2042,7 @@ interface IERC20WithPermit is IERC20 { - ) external; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -2107,7 +2107,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2134,7 +2134,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2231,7 +2231,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IPool.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -3099,7 +3099,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3683,7 +3683,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3732,7 +3732,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/misc/flashloan/interfaces/IFlashLoanReceiver.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/misc/flashloan/interfaces/IFlashLoanReceiver.sol - - /** - * @title IFlashLoanReceiver -@@ -3765,7 +3765,7 @@ interface IFlashLoanReceiver { - function POOL() external view returns (IPool); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/misc/flashloan/interfaces/IFlashLoanSimpleReceiver.sol - - /** - * @title IFlashLoanSimpleReceiver -@@ -3798,7 +3798,7 @@ interface IFlashLoanSimpleReceiver { - function POOL() external view returns (IPool); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -4030,7 +4030,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -4083,7 +4083,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -4132,7 +4132,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/IsolationModeLogic.sol - - /** - * @title IsolationModeLogic library -@@ -4207,7 +4207,7 @@ library IsolationModeLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4250,7 +4250,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4384,7 +4384,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4607,7 +4607,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4909,7 +4909,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/pool/PoolStorage.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/pool/PoolStorage.sol - - /** - * @title PoolStorage -@@ -4955,7 +4955,7 @@ contract PoolStorage { - uint16 internal _reservesCount; - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library -@@ -5017,7 +5017,7 @@ library EModeLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -5269,7 +5269,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5889,7 +5889,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/BridgeLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/BridgeLogic.sol - - /** - * @title BridgeLogic library -@@ -6031,7 +6031,7 @@ library BridgeLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/PoolLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/PoolLogic.sol - - /** - * @title PoolLogic library -@@ -6220,7 +6220,7 @@ library PoolLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/SupplyLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/SupplyLogic.sol - - /** - * @title SupplyLogic library -@@ -6508,7 +6508,7 @@ library SupplyLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/BorrowLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/BorrowLogic.sol - - /** - * @title BorrowLogic library -@@ -6731,7 +6731,7 @@ library BorrowLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/LiquidationLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/LiquidationLogic.sol - - interface IGhoVariableDebtToken { - function getBalanceFromInterest(address user) external view returns (uint256); -@@ -7444,7 +7444,7 @@ library LiquidationLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/libraries/logic/FlashLoanLogic.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/libraries/logic/FlashLoanLogic.sol - - /** - * @title FlashLoanLogic library -@@ -7704,7 +7704,7 @@ library FlashLoanLogic { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/protocol/pool/Pool.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/protocol/pool/Pool.sol - - /** - * @title Pool contract -@@ -8587,7 +8587,7 @@ abstract contract Pool is VersionedInitializable, PoolStorage, IPool { - } - } - --// downloads/GNOSIS/POOL_IMPL/PoolInstance/lib/aave-v3-origin/src/contracts/instances/PoolInstance.sol -+// downloads/CELO/POOL_IMPL/PoolInstance/src/contracts/instances/PoolInstance.sol - - contract PoolInstance is Pool { - uint256 public constant POOL_REVISION = 7; + ``` diff --git a/GNOSIS_CELO/POOL_LOGIC_DIFF.md b/GNOSIS_CELO/POOL_LOGIC_DIFF.md index 0bcc0356..1ac33071 100644 --- a/GNOSIS_CELO/POOL_LOGIC_DIFF.md +++ b/GNOSIS_CELO/POOL_LOGIC_DIFF.md @@ -3,301 +3,5 @@ diff --git a/./downloads/GNOSIS/POOL_LOGIC.sol b/./downloads/CELO/POOL_LOGIC.sol index 512173a..f3384e9 100644 --- a/./downloads/GNOSIS/POOL_LOGIC.sol +++ b/./downloads/CELO/POOL_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1638,7 +1638,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1751,7 +1751,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1924,7 +1924,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1934,7 +1934,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -1999,7 +1999,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2026,7 +2026,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2123,7 +2123,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2991,7 +2991,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3575,7 +3575,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3624,7 +3624,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3856,7 +3856,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3909,7 +3909,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3958,7 +3958,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4001,7 +4001,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4135,7 +4135,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4358,7 +4358,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4660,7 +4660,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library -@@ -4722,7 +4722,7 @@ library EModeLogic { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -4974,7 +4974,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5594,7 +5594,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/PoolLogic.sol -+// downloads/CELO/POOL_LOGIC/PoolLogic/src/contracts/protocol/libraries/logic/PoolLogic.sol - - /** - * @title PoolLogic library + ``` diff --git a/GNOSIS_CELO/SUPPLY_LOGIC_DIFF.md b/GNOSIS_CELO/SUPPLY_LOGIC_DIFF.md index 46d89852..5b7d85ab 100644 --- a/GNOSIS_CELO/SUPPLY_LOGIC_DIFF.md +++ b/GNOSIS_CELO/SUPPLY_LOGIC_DIFF.md @@ -3,301 +3,5 @@ diff --git a/./downloads/GNOSIS/SUPPLY_LOGIC.sol b/./downloads/CELO/SUPPLY_LOGIC index f92a961..cdb3a7c 100644 --- a/./downloads/GNOSIS/SUPPLY_LOGIC.sol +++ b/./downloads/CELO/SUPPLY_LOGIC.sol -@@ -1,7 +1,7 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,7 +221,7 @@ library Address { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -244,7 +244,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -574,7 +574,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -681,7 +681,7 @@ library Errors { - string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -700,7 +700,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/IAccessControl.sol - - /** - * @dev External interface of AccessControl declared to support ERC165 detection. -@@ -790,7 +790,7 @@ interface IAccessControl { - function renounceRole(bytes32 role, address account) external; - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -866,7 +866,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -1093,7 +1093,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -1123,7 +1123,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -1195,7 +1195,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/math/PercentageMath.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/math/PercentageMath.sol - - /** - * @title PercentageMath library -@@ -1256,7 +1256,7 @@ library PercentageMath { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1512,7 +1512,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1638,7 +1638,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1751,7 +1751,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1924,7 +1924,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1934,7 +1934,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPriceOracleSentinel.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPriceOracleSentinel.sol - - /** - * @title IPriceOracleSentinel -@@ -1999,7 +1999,7 @@ interface IPriceOracleSentinel { - function getGracePeriod() external view returns (uint256); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -2026,7 +2026,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/math/MathUtils.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/math/MathUtils.sol - - /** - * @title MathUtils library -@@ -2123,7 +2123,7 @@ library MathUtils { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPool.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -2991,7 +2991,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -3575,7 +3575,7 @@ library ReserveConfiguration { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/configuration/EModeConfiguration.sol - - /** - * @title EModeConfiguration library -@@ -3624,7 +3624,7 @@ library EModeConfiguration { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3856,7 +3856,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3909,7 +3909,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3958,7 +3958,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -4001,7 +4001,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -4135,7 +4135,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -4358,7 +4358,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/ReserveLogic.sol - - /** - * @title ReserveLogic library -@@ -4660,7 +4660,7 @@ library ReserveLogic { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/EModeLogic.sol - - /** - * @title EModeLogic library -@@ -4722,7 +4722,7 @@ library EModeLogic { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/GenericLogic.sol - - /** - * @title GenericLogic library -@@ -4974,7 +4974,7 @@ library GenericLogic { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/ValidationLogic.sol - - /** - * @title ValidationLogic library -@@ -5594,7 +5594,7 @@ library ValidationLogic { - } - } - --// downloads/GNOSIS/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/SupplyLogic.sol -+// downloads/CELO/SUPPLY_LOGIC/SupplyLogic/src/contracts/protocol/libraries/logic/SupplyLogic.sol - - /** - * @title SupplyLogic library + ``` diff --git a/GNOSIS_CELO/UI_INCENTIVE_DATA_PROVIDER_DIFF.md b/GNOSIS_CELO/UI_INCENTIVE_DATA_PROVIDER_DIFF.md index fd58f553..32cd1110 100644 --- a/GNOSIS_CELO/UI_INCENTIVE_DATA_PROVIDER_DIFF.md +++ b/GNOSIS_CELO/UI_INCENTIVE_DATA_PROVIDER_DIFF.md @@ -3,786 +3,10 @@ diff --git a/./downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER.sol b/./downloads/CEL index 62824f1..63bc81b 100644 --- a/./downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER.sol +++ b/./downloads/CELO/UI_INCENTIVE_DATA_PROVIDER.sol -@@ -1,7 +1,55 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/Context.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/chainlink/AggregatorInterface.sol -+ -+// Chainlink Contracts v0.8 -+ -+interface AggregatorInterface { -+ function decimals() external view returns (uint8); -+ -+ function description() external view returns (string memory); -+ -+ function getRoundData( -+ uint80 _roundId -+ ) -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ function latestRoundData() -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ 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); -+} -+ -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/Context.sol - - /* - * @dev Provides information about the current execution context, including the -@@ -24,7 +72,7 @@ abstract contract Context { - } - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -75,8 +123,9 @@ library DataTypes { - uint128 variableBorrowIndex; - //the current variable borrow rate. Expressed in ray - uint128 currentVariableBorrowRate; -- // DEPRECATED on v3.2.0 -- uint128 __deprecatedStableBorrowRate; -+ /// @notice reused `__deprecatedStableBorrowRate` storage from pre 3.2 -+ // the current accumulate deficit in underlying tokens -+ uint128 deficit; - //timestamp of last update - uint40 lastUpdateTimestamp; - //the id of the reserve. Represents the position in the list of the active reserves -@@ -242,6 +291,11 @@ library DataTypes { - uint8 userEModeCategory; - } - -+ struct ExecuteEliminateDeficitParams { -+ address asset; -+ uint256 amount; -+ } -+ - struct ExecuteSetUserEModeParams { - uint256 reservesCount; - address oracle; -@@ -348,7 +402,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -449,9 +503,13 @@ library Errors { - string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range - string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state - string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -470,26 +528,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/helpers/interfaces/IEACAggregatorProxy.sol -- --interface IEACAggregatorProxy { -- function decimals() external view returns (uint8); -- -- 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 timestamp); -- event NewRound(uint256 indexed roundId, address indexed startedBy); --} -- --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -565,7 +604,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -792,7 +831,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/interfaces/IRewardsDistributor.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/interfaces/IRewardsDistributor.sol - - /** - * @title IRewardsDistributor -@@ -969,7 +1008,7 @@ interface IRewardsDistributor { - function getEmissionManager() external view returns (address); - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/interfaces/ITransferStrategyBase.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/interfaces/ITransferStrategyBase.sol - - interface ITransferStrategyBase { - event EmergencyWithdrawal( -@@ -1007,7 +1046,7 @@ interface ITransferStrategyBase { - function emergencyWithdrawal(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/SafeCast.sol - - // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) - -@@ -1263,7 +1302,7 @@ library SafeCast { - } - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -1389,7 +1428,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IACLManager.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IACLManager.sol - - /** - * @title IACLManager -@@ -1562,7 +1601,7 @@ interface IACLManager { - function isAssetListingAdmin(address admin) external view returns (bool); - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1572,7 +1611,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/helpers/interfaces/IUiIncentiveDataProviderV3.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/helpers/interfaces/IUiIncentiveDataProviderV3.sol - - interface IUiIncentiveDataProviderV3 { - struct AggregatedReserveIncentiveData { -@@ -1643,7 +1682,7 @@ interface IUiIncentiveDataProviderV3 { - returns (AggregatedReserveIncentiveData[] memory, UserReserveIncentiveData[] memory); - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IPool.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -1826,6 +1865,14 @@ interface IPool { - uint256 variableBorrowIndex - ); - -+ /** -+ * @dev Emitted when the deficit of a reserve is covered. -+ * @param reserve The address of the underlying asset of the reserve -+ * @param caller The caller that triggered the DeficitCovered event -+ * @param amountCovered The amount of deficit covered -+ */ -+ event DeficitCovered(address indexed reserve, address caller, uint256 amountCovered); -+ - /** - * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest. - * @param reserve The address of the reserve -@@ -1833,6 +1880,14 @@ interface IPool { - */ - event MintedToTreasury(address indexed reserve, uint256 amountMinted); - -+ /** -+ * @dev Emitted when deficit is realized on a liquidation. -+ * @param user The user address where the bad debt will be burned -+ * @param debtAsset The address of the underlying borrowed asset to be burned -+ * @param amountCreated The amount of deficit created -+ */ -+ event DeficitCreated(address indexed user, address indexed debtAsset, uint256 amountCreated); -+ - /** - * @notice Mints an `amount` of aTokens to the `onBehalfOf` - * @param asset The address of the underlying asset to mint -@@ -2200,16 +2255,6 @@ interface IPool { - */ - function getReserveData(address asset) external view returns (DataTypes.ReserveDataLegacy memory); - -- /** -- * @notice Returns the state and configuration of the reserve, including extra data included with Aave v3.1 -- * @dev DEPRECATED use independent getters instead (getReserveData, getLiquidationGracePeriod) -- * @param asset The address of the underlying asset of the reserve -- * @return The state and configuration data of the reserve with virtual accounting -- */ -- function getReserveDataExtended( -- address asset -- ) external view returns (DataTypes.ReserveData memory); -- - /** - * @notice Returns the virtual underlying balance of the reserve - * @param asset The address of the underlying asset of the reserve -@@ -2384,7 +2429,7 @@ interface IPool { - * @param asset The address of the underlying asset - * @return Timestamp when the liquidation grace period will end - **/ -- function getLiquidationGracePeriod(address asset) external returns (uint40); -+ function getLiquidationGracePeriod(address asset) external view returns (uint40); - - /** - * @notice Returns the total fee on flash loans -@@ -2438,6 +2483,37 @@ interface IPool { - */ - function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external; - -+ /** -+ * @notice It covers the deficit of a specified reserve by burning: -+ * - the equivalent aToken `amount` for assets with virtual accounting enabled -+ * - the equivalent `amount` of underlying for assets with virtual accounting disabled (e.g. GHO) -+ * @dev The deficit of a reserve can occur due to situations where borrowed assets are not repaid, leading to bad debt. -+ * @param asset The address of the underlying asset to cover the deficit. -+ * @param amount The amount to be covered, in aToken or underlying on non-virtual accounted assets -+ */ -+ function eliminateReserveDeficit(address asset, uint256 amount) external; -+ -+ /** -+ * @notice Returns the current deficit of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The current deficit of the reserve -+ */ -+ function getReserveDeficit(address asset) external view returns (uint256); -+ -+ /** -+ * @notice Returns the aToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the aToken -+ */ -+ function getReserveAToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Returns the variableDebtToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the variableDebtToken -+ */ -+ function getReserveVariableDebtToken(address asset) external view returns (address); -+ - /** - * @notice Gets the address of the external FlashLoanLogic - */ -@@ -2474,7 +2550,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -2482,26 +2558,26 @@ interface IPool { - * @notice Implements the bitmap logic to handle the reserve configuration - */ - library ReserveConfiguration { -- uint256 internal constant LTV_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000; // prettier-ignore -- uint256 internal constant LIQUIDATION_THRESHOLD_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF; // prettier-ignore -- uint256 internal constant LIQUIDATION_BONUS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFF; // prettier-ignore -- uint256 internal constant DECIMALS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant ACTIVE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant FROZEN_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFF; // prettier-ignore -+ uint256 internal constant LTV_MASK = 0x000000000000000000000000000000000000000000000000000000000000FFFF; // prettier-ignore -+ uint256 internal constant LIQUIDATION_THRESHOLD_MASK = 0x00000000000000000000000000000000000000000000000000000000FFFF0000; // prettier-ignore -+ uint256 internal constant LIQUIDATION_BONUS_MASK = 0x0000000000000000000000000000000000000000000000000000FFFF00000000; // prettier-ignore -+ uint256 internal constant DECIMALS_MASK = 0x00000000000000000000000000000000000000000000000000FF000000000000; // prettier-ignore -+ uint256 internal constant ACTIVE_MASK = 0x0000000000000000000000000000000000000000000000000100000000000000; // prettier-ignore -+ uint256 internal constant FROZEN_MASK = 0x0000000000000000000000000000000000000000000000000200000000000000; // prettier-ignore -+ uint256 internal constant BORROWING_MASK = 0x0000000000000000000000000000000000000000000000000400000000000000; // prettier-ignore - // @notice there is an unoccupied hole of 1 bit at position 59 from pre 3.2 stableBorrowRateEnabled -- uint256 internal constant PAUSED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROWABLE_IN_ISOLATION_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant SILOED_BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant FLASHLOAN_ENABLED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant RESERVE_FACTOR_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROW_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant SUPPLY_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant LIQUIDATION_PROTOCOL_FEE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- // @notice there is an unoccupied hole of 8 bits from 168 to 176 left from pre 3.2 eModeCategory -- uint256 internal constant UNBACKED_MINT_CAP_MASK = 0xFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant DEBT_CEILING_MASK = 0xF0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant VIRTUAL_ACC_ACTIVE_MASK = 0xEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -+ uint256 internal constant PAUSED_MASK = 0x0000000000000000000000000000000000000000000000001000000000000000; // prettier-ignore -+ uint256 internal constant BORROWABLE_IN_ISOLATION_MASK = 0x0000000000000000000000000000000000000000000000002000000000000000; // prettier-ignore -+ uint256 internal constant SILOED_BORROWING_MASK = 0x0000000000000000000000000000000000000000000000004000000000000000; // prettier-ignore -+ uint256 internal constant FLASHLOAN_ENABLED_MASK = 0x0000000000000000000000000000000000000000000000008000000000000000; // prettier-ignore -+ uint256 internal constant RESERVE_FACTOR_MASK = 0x00000000000000000000000000000000000000000000FFFF0000000000000000; // prettier-ignore -+ uint256 internal constant BORROW_CAP_MASK = 0x00000000000000000000000000000000000FFFFFFFFF00000000000000000000; // prettier-ignore -+ uint256 internal constant SUPPLY_CAP_MASK = 0x00000000000000000000000000FFFFFFFFF00000000000000000000000000000; // prettier-ignore -+ uint256 internal constant LIQUIDATION_PROTOCOL_FEE_MASK = 0x0000000000000000000000FFFF00000000000000000000000000000000000000; // prettier-ignore -+ //@notice there is an unoccupied hole of 8 bits from 168 to 176 left from pre 3.2 eModeCategory -+ uint256 internal constant UNBACKED_MINT_CAP_MASK = 0x00000000000FFFFFFFFF00000000000000000000000000000000000000000000; // prettier-ignore -+ uint256 internal constant DEBT_CEILING_MASK = 0x0FFFFFFFFFF00000000000000000000000000000000000000000000000000000; // prettier-ignore -+ uint256 internal constant VIRTUAL_ACC_ACTIVE_MASK = 0x1000000000000000000000000000000000000000000000000000000000000000; // prettier-ignore - - /// @dev For the LTV, the start bit is 0 (up to 15), hence no bitshifting is needed - uint256 internal constant LIQUIDATION_THRESHOLD_START_BIT_POSITION = 16; -@@ -2545,7 +2621,7 @@ library ReserveConfiguration { - function setLtv(DataTypes.ReserveConfigurationMap memory self, uint256 ltv) internal pure { - require(ltv <= MAX_VALID_LTV, Errors.INVALID_LTV); - -- self.data = (self.data & LTV_MASK) | ltv; -+ self.data = (self.data & ~LTV_MASK) | ltv; - } - - /** -@@ -2554,7 +2630,7 @@ library ReserveConfiguration { - * @return The loan to value - */ - function getLtv(DataTypes.ReserveConfigurationMap memory self) internal pure returns (uint256) { -- return self.data & ~LTV_MASK; -+ return self.data & LTV_MASK; - } - - /** -@@ -2569,7 +2645,7 @@ library ReserveConfiguration { - require(threshold <= MAX_VALID_LIQUIDATION_THRESHOLD, Errors.INVALID_LIQ_THRESHOLD); - - self.data = -- (self.data & LIQUIDATION_THRESHOLD_MASK) | -+ (self.data & ~LIQUIDATION_THRESHOLD_MASK) | - (threshold << LIQUIDATION_THRESHOLD_START_BIT_POSITION); - } - -@@ -2581,7 +2657,7 @@ library ReserveConfiguration { - function getLiquidationThreshold( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION; -+ return (self.data & LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION; - } - - /** -@@ -2596,7 +2672,7 @@ library ReserveConfiguration { - require(bonus <= MAX_VALID_LIQUIDATION_BONUS, Errors.INVALID_LIQ_BONUS); - - self.data = -- (self.data & LIQUIDATION_BONUS_MASK) | -+ (self.data & ~LIQUIDATION_BONUS_MASK) | - (bonus << LIQUIDATION_BONUS_START_BIT_POSITION); - } - -@@ -2608,7 +2684,7 @@ library ReserveConfiguration { - function getLiquidationBonus( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION; -+ return (self.data & LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION; - } - - /** -@@ -2622,7 +2698,7 @@ library ReserveConfiguration { - ) internal pure { - require(decimals <= MAX_VALID_DECIMALS, Errors.INVALID_DECIMALS); - -- self.data = (self.data & DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION); -+ self.data = (self.data & ~DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION); - } - - /** -@@ -2633,7 +2709,7 @@ library ReserveConfiguration { - function getDecimals( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION; -+ return (self.data & DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION; - } - - /** -@@ -2643,7 +2719,7 @@ library ReserveConfiguration { - */ - function setActive(DataTypes.ReserveConfigurationMap memory self, bool active) internal pure { - self.data = -- (self.data & ACTIVE_MASK) | -+ (self.data & ~ACTIVE_MASK) | - (uint256(active ? 1 : 0) << IS_ACTIVE_START_BIT_POSITION); - } - -@@ -2653,7 +2729,7 @@ library ReserveConfiguration { - * @return The active state - */ - function getActive(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~ACTIVE_MASK) != 0; -+ return (self.data & ACTIVE_MASK) != 0; - } - - /** -@@ -2663,7 +2739,7 @@ library ReserveConfiguration { - */ - function setFrozen(DataTypes.ReserveConfigurationMap memory self, bool frozen) internal pure { - self.data = -- (self.data & FROZEN_MASK) | -+ (self.data & ~FROZEN_MASK) | - (uint256(frozen ? 1 : 0) << IS_FROZEN_START_BIT_POSITION); - } - -@@ -2673,7 +2749,7 @@ library ReserveConfiguration { - * @return The frozen state - */ - function getFrozen(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~FROZEN_MASK) != 0; -+ return (self.data & FROZEN_MASK) != 0; - } - - /** -@@ -2683,7 +2759,7 @@ library ReserveConfiguration { - */ - function setPaused(DataTypes.ReserveConfigurationMap memory self, bool paused) internal pure { - self.data = -- (self.data & PAUSED_MASK) | -+ (self.data & ~PAUSED_MASK) | - (uint256(paused ? 1 : 0) << IS_PAUSED_START_BIT_POSITION); - } - -@@ -2693,7 +2769,7 @@ library ReserveConfiguration { - * @return The paused state - */ - function getPaused(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~PAUSED_MASK) != 0; -+ return (self.data & PAUSED_MASK) != 0; - } - - /** -@@ -2710,7 +2786,7 @@ library ReserveConfiguration { - bool borrowable - ) internal pure { - self.data = -- (self.data & BORROWABLE_IN_ISOLATION_MASK) | -+ (self.data & ~BORROWABLE_IN_ISOLATION_MASK) | - (uint256(borrowable ? 1 : 0) << BORROWABLE_IN_ISOLATION_START_BIT_POSITION); - } - -@@ -2726,7 +2802,7 @@ library ReserveConfiguration { - function getBorrowableInIsolation( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~BORROWABLE_IN_ISOLATION_MASK) != 0; -+ return (self.data & BORROWABLE_IN_ISOLATION_MASK) != 0; - } - - /** -@@ -2740,7 +2816,7 @@ library ReserveConfiguration { - bool siloed - ) internal pure { - self.data = -- (self.data & SILOED_BORROWING_MASK) | -+ (self.data & ~SILOED_BORROWING_MASK) | - (uint256(siloed ? 1 : 0) << SILOED_BORROWING_START_BIT_POSITION); - } - -@@ -2753,7 +2829,7 @@ library ReserveConfiguration { - function getSiloedBorrowing( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~SILOED_BORROWING_MASK) != 0; -+ return (self.data & SILOED_BORROWING_MASK) != 0; - } - - /** -@@ -2766,7 +2842,7 @@ library ReserveConfiguration { - bool enabled - ) internal pure { - self.data = -- (self.data & BORROWING_MASK) | -+ (self.data & ~BORROWING_MASK) | - (uint256(enabled ? 1 : 0) << BORROWING_ENABLED_START_BIT_POSITION); - } - -@@ -2778,7 +2854,7 @@ library ReserveConfiguration { - function getBorrowingEnabled( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~BORROWING_MASK) != 0; -+ return (self.data & BORROWING_MASK) != 0; - } - - /** -@@ -2793,7 +2869,7 @@ library ReserveConfiguration { - require(reserveFactor <= MAX_VALID_RESERVE_FACTOR, Errors.INVALID_RESERVE_FACTOR); - - self.data = -- (self.data & RESERVE_FACTOR_MASK) | -+ (self.data & ~RESERVE_FACTOR_MASK) | - (reserveFactor << RESERVE_FACTOR_START_BIT_POSITION); - } - -@@ -2805,7 +2881,7 @@ library ReserveConfiguration { - function getReserveFactor( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION; -+ return (self.data & RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION; - } - - /** -@@ -2819,7 +2895,7 @@ library ReserveConfiguration { - ) internal pure { - require(borrowCap <= MAX_VALID_BORROW_CAP, Errors.INVALID_BORROW_CAP); - -- self.data = (self.data & BORROW_CAP_MASK) | (borrowCap << BORROW_CAP_START_BIT_POSITION); -+ self.data = (self.data & ~BORROW_CAP_MASK) | (borrowCap << BORROW_CAP_START_BIT_POSITION); - } - - /** -@@ -2830,7 +2906,7 @@ library ReserveConfiguration { - function getBorrowCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION; -+ return (self.data & BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION; - } - - /** -@@ -2844,7 +2920,7 @@ library ReserveConfiguration { - ) internal pure { - require(supplyCap <= MAX_VALID_SUPPLY_CAP, Errors.INVALID_SUPPLY_CAP); - -- self.data = (self.data & SUPPLY_CAP_MASK) | (supplyCap << SUPPLY_CAP_START_BIT_POSITION); -+ self.data = (self.data & ~SUPPLY_CAP_MASK) | (supplyCap << SUPPLY_CAP_START_BIT_POSITION); - } - - /** -@@ -2855,7 +2931,7 @@ library ReserveConfiguration { - function getSupplyCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION; -+ return (self.data & SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION; - } - - /** -@@ -2869,7 +2945,7 @@ library ReserveConfiguration { - ) internal pure { - require(ceiling <= MAX_VALID_DEBT_CEILING, Errors.INVALID_DEBT_CEILING); - -- self.data = (self.data & DEBT_CEILING_MASK) | (ceiling << DEBT_CEILING_START_BIT_POSITION); -+ self.data = (self.data & ~DEBT_CEILING_MASK) | (ceiling << DEBT_CEILING_START_BIT_POSITION); - } - - /** -@@ -2880,7 +2956,7 @@ library ReserveConfiguration { - function getDebtCeiling( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~DEBT_CEILING_MASK) >> DEBT_CEILING_START_BIT_POSITION; -+ return (self.data & DEBT_CEILING_MASK) >> DEBT_CEILING_START_BIT_POSITION; - } - - /** -@@ -2898,7 +2974,7 @@ library ReserveConfiguration { - ); - - self.data = -- (self.data & LIQUIDATION_PROTOCOL_FEE_MASK) | -+ (self.data & ~LIQUIDATION_PROTOCOL_FEE_MASK) | - (liquidationProtocolFee << LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION); - } - -@@ -2911,7 +2987,7 @@ library ReserveConfiguration { - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { - return -- (self.data & ~LIQUIDATION_PROTOCOL_FEE_MASK) >> LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION; -+ (self.data & LIQUIDATION_PROTOCOL_FEE_MASK) >> LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION; - } - - /** -@@ -2926,7 +3002,7 @@ library ReserveConfiguration { - require(unbackedMintCap <= MAX_VALID_UNBACKED_MINT_CAP, Errors.INVALID_UNBACKED_MINT_CAP); - - self.data = -- (self.data & UNBACKED_MINT_CAP_MASK) | -+ (self.data & ~UNBACKED_MINT_CAP_MASK) | - (unbackedMintCap << UNBACKED_MINT_CAP_START_BIT_POSITION); - } - -@@ -2938,7 +3014,7 @@ library ReserveConfiguration { - function getUnbackedMintCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~UNBACKED_MINT_CAP_MASK) >> UNBACKED_MINT_CAP_START_BIT_POSITION; -+ return (self.data & UNBACKED_MINT_CAP_MASK) >> UNBACKED_MINT_CAP_START_BIT_POSITION; - } - - /** -@@ -2951,7 +3027,7 @@ library ReserveConfiguration { - bool flashLoanEnabled - ) internal pure { - self.data = -- (self.data & FLASHLOAN_ENABLED_MASK) | -+ (self.data & ~FLASHLOAN_ENABLED_MASK) | - (uint256(flashLoanEnabled ? 1 : 0) << FLASHLOAN_ENABLED_START_BIT_POSITION); - } - -@@ -2963,7 +3039,7 @@ library ReserveConfiguration { - function getFlashLoanEnabled( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~FLASHLOAN_ENABLED_MASK) != 0; -+ return (self.data & FLASHLOAN_ENABLED_MASK) != 0; - } - - /** -@@ -2976,21 +3052,24 @@ library ReserveConfiguration { - bool active - ) internal pure { - self.data = -- (self.data & VIRTUAL_ACC_ACTIVE_MASK) | -+ (self.data & ~VIRTUAL_ACC_ACTIVE_MASK) | - (uint256(active ? 1 : 0) << VIRTUAL_ACC_START_BIT_POSITION); - } - - /** - * @notice Gets the virtual account active/not state of the reserve - * @dev The state should be true for all normal assets and should be false -- * only in special cases (ex. GHO) where an asset is minted instead of supplied. -+ * Virtual accounting being disabled means that the asset: -+ * - is GHO -+ * - can never be supplied -+ * - the interest rate strategy is not influenced by the virtual balance - * @param self The reserve configuration - * @return The active state - */ - function getIsVirtualAccActive( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~VIRTUAL_ACC_ACTIVE_MASK) != 0; -+ return (self.data & VIRTUAL_ACC_ACTIVE_MASK) != 0; - } - - /** -@@ -3007,10 +3086,10 @@ library ReserveConfiguration { - uint256 dataLocal = self.data; - - return ( -- (dataLocal & ~ACTIVE_MASK) != 0, -- (dataLocal & ~FROZEN_MASK) != 0, -- (dataLocal & ~BORROWING_MASK) != 0, -- (dataLocal & ~PAUSED_MASK) != 0 -+ (dataLocal & ACTIVE_MASK) != 0, -+ (dataLocal & FROZEN_MASK) != 0, -+ (dataLocal & BORROWING_MASK) != 0, -+ (dataLocal & PAUSED_MASK) != 0 - ); - } - -@@ -3029,11 +3108,11 @@ library ReserveConfiguration { - uint256 dataLocal = self.data; - - return ( -- dataLocal & ~LTV_MASK, -- (dataLocal & ~LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION, -- (dataLocal & ~LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION, -- (dataLocal & ~DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION, -- (dataLocal & ~RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION -+ dataLocal & LTV_MASK, -+ (dataLocal & LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION, -+ (dataLocal & LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION, -+ (dataLocal & DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION, -+ (dataLocal & RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION - ); - } - -@@ -3049,13 +3128,13 @@ library ReserveConfiguration { - uint256 dataLocal = self.data; - - return ( -- (dataLocal & ~BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION, -- (dataLocal & ~SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION -+ (dataLocal & BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION, -+ (dataLocal & SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION - ); - } - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/libraries/RewardsDataTypes.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/libraries/RewardsDataTypes.sol - - library RewardsDataTypes { - struct RewardsConfigInput { -@@ -3065,7 +3144,7 @@ library RewardsDataTypes { - address asset; - address reward; - ITransferStrategyBase transferStrategy; -- IEACAggregatorProxy rewardOracle; -+ AggregatorInterface rewardOracle; - } - - struct UserAssetBalance { -@@ -3106,7 +3185,7 @@ library RewardsDataTypes { - } - } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3338,7 +3417,7 @@ library UserConfiguration { - } - } - + -// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/interfaces/IRewardsController.sol +// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/rewards/interfaces/IRewardsController.sol - + /** * @title IRewardsController @@ -3404,9 +3483,9 @@ interface IRewardsController is IRewardsDistributor { @@ -794,7 +18,7 @@ index 62824f1..63bc81b 100644 */ - function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external; + function setRewardOracle(address reward, AggregatorInterface rewardOracle) external; - + /** * @dev Get the price aggregator oracle address @@ -3438,8 +3517,8 @@ interface IRewardsController is IRewardsDistributor { @@ -807,23 +31,14 @@ index 62824f1..63bc81b 100644 + * Must follow Chainlink Aggregator AggregatorInterface interface to be compatible. */ function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external; - + @@ -3536,7 +3615,7 @@ interface IRewardsController is IRewardsDistributor { ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts); } - --// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol -+// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol - - /** - * @title IncentivizedERC20 -@@ -3759,7 +3838,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed { - } - } - + -// downloads/GNOSIS/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/helpers/UiIncentiveDataProviderV3.sol +// downloads/CELO/UI_INCENTIVE_DATA_PROVIDER/UiIncentiveDataProviderV3/src/contracts/helpers/UiIncentiveDataProviderV3.sol - + contract UiIncentiveDataProviderV3 is IUiIncentiveDataProviderV3 { using UserConfiguration for DataTypes.UserConfigurationMap; @@ -3834,10 +3913,10 @@ contract UiIncentiveDataProviderV3 is IUiIncentiveDataProviderV3 { @@ -838,7 +53,7 @@ index 62824f1..63bc81b 100644 + rewardInformation.rewardPriceFeed = AggregatorInterface( rewardInformation.rewardOracleAddress ).latestAnswer(); - + @@ -3888,10 +3967,10 @@ contract UiIncentiveDataProviderV3 is IUiIncentiveDataProviderV3 { rewardInformation.rewardOracleAddress = vTokenIncentiveController.getRewardOracle( rewardInformation.rewardTokenAddress @@ -851,7 +66,7 @@ index 62824f1..63bc81b 100644 + rewardInformation.rewardPriceFeed = AggregatorInterface( rewardInformation.rewardOracleAddress ).latestAnswer(); - + @@ -3968,10 +4047,10 @@ contract UiIncentiveDataProviderV3 is IUiIncentiveDataProviderV3 { userRewardInformation.rewardOracleAddress = aTokenIncentiveController.getRewardOracle( userRewardInformation.rewardTokenAddress @@ -864,7 +79,7 @@ index 62824f1..63bc81b 100644 + userRewardInformation.rewardPriceFeed = AggregatorInterface( userRewardInformation.rewardOracleAddress ).latestAnswer(); - + @@ -4021,10 +4100,10 @@ contract UiIncentiveDataProviderV3 is IUiIncentiveDataProviderV3 { userRewardInformation.rewardOracleAddress = vTokenIncentiveController.getRewardOracle( userRewardInformation.rewardTokenAddress @@ -877,5 +92,5 @@ index 62824f1..63bc81b 100644 + userRewardInformation.rewardPriceFeed = AggregatorInterface( userRewardInformation.rewardOracleAddress ).latestAnswer(); - + ``` diff --git a/GNOSIS_CELO/UI_POOL_DATA_PROVIDER_DIFF.md b/GNOSIS_CELO/UI_POOL_DATA_PROVIDER_DIFF.md index 4f2c7a80..385144ee 100644 --- a/GNOSIS_CELO/UI_POOL_DATA_PROVIDER_DIFF.md +++ b/GNOSIS_CELO/UI_POOL_DATA_PROVIDER_DIFF.md @@ -3,339 +3,10 @@ diff --git a/./downloads/GNOSIS/UI_POOL_DATA_PROVIDER.sol b/./downloads/CELO/UI_ index 9db6a74..18a6e75 100644 --- a/./downloads/GNOSIS/UI_POOL_DATA_PROVIDER.sol +++ b/./downloads/CELO/UI_POOL_DATA_PROVIDER.sol -@@ -1,7 +1,55 @@ - // SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/dependencies/chainlink/AggregatorInterface.sol -+ -+// Chainlink Contracts v0.8 -+ -+interface AggregatorInterface { -+ function decimals() external view returns (uint8); -+ -+ function description() external view returns (string memory); -+ -+ function getRoundData( -+ uint80 _roundId -+ ) -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ function latestRoundData() -+ external -+ view -+ returns ( -+ uint80 roundId, -+ int256 answer, -+ uint256 startedAt, -+ uint256 updatedAt, -+ uint80 answeredInRound -+ ); -+ -+ 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); -+} -+ -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { - /** -@@ -52,8 +100,9 @@ library DataTypes { - uint128 variableBorrowIndex; - //the current variable borrow rate. Expressed in ray - uint128 currentVariableBorrowRate; -- // DEPRECATED on v3.2.0 -- uint128 __deprecatedStableBorrowRate; -+ /// @notice reused `__deprecatedStableBorrowRate` storage from pre 3.2 -+ // the current accumulate deficit in underlying tokens -+ uint128 deficit; - //timestamp of last update - uint40 lastUpdateTimestamp; - //the id of the reserve. Represents the position in the list of the active reserves -@@ -219,6 +268,11 @@ library DataTypes { - uint8 userEModeCategory; - } - -+ struct ExecuteEliminateDeficitParams { -+ address asset; -+ uint256 amount; -+ } -+ - struct ExecuteSetUserEModeParams { - uint256 reservesCount; - address oracle; -@@ -325,7 +379,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -426,9 +480,13 @@ library Errors { - string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range - string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state - string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IAaveIncentivesController.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IAaveIncentivesController.sol - - /** - * @title IAaveIncentivesController -@@ -447,26 +505,7 @@ interface IAaveIncentivesController { - function handleAction(address user, uint256 totalSupply, uint256 userBalance) external; - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/interfaces/IEACAggregatorProxy.sol -- --interface IEACAggregatorProxy { -- function decimals() external view returns (uint8); -- -- 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 timestamp); -- event NewRound(uint256 indexed roundId, address indexed startedBy); --} -- --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -542,7 +581,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -769,7 +808,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPriceOracleGetter.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPriceOracleGetter.sol - - /** - * @title IPriceOracleGetter -@@ -799,7 +838,7 @@ interface IPriceOracleGetter { - function getAssetPrice(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IScaledBalanceToken.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IScaledBalanceToken.sol - - /** - * @title IScaledBalanceToken -@@ -871,7 +910,7 @@ interface IScaledBalanceToken { - function getPreviousIndex(address user) external view returns (uint256); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/math/WadRayMath.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/math/WadRayMath.sol - - /** - * @title WadRayMath library -@@ -997,7 +1036,7 @@ library WadRayMath { - } - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol - - interface IERC20Detailed is IERC20 { - function name() external view returns (string memory); -@@ -1007,7 +1046,7 @@ interface IERC20Detailed is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/interfaces/IERC20DetailedBytes.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/interfaces/IERC20DetailedBytes.sol - - interface IERC20DetailedBytes is IERC20 { - function name() external view returns (bytes32); -@@ -1017,7 +1056,7 @@ interface IERC20DetailedBytes is IERC20 { - function decimals() external view returns (uint8); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPoolDataProvider.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPoolDataProvider.sol - - /** - * @title IPoolDataProvider -@@ -1263,9 +1302,16 @@ interface IPoolDataProvider { - * @return The reserve virtual underlying balance - */ - function getVirtualUnderlyingBalance(address asset) external view returns (uint256); -+ -+ /** -+ * @notice Returns the deficit of the reserve -+ * @param asset The address of the underlying asset of the reserve -+ * @return The reserve deficit -+ */ -+ function getReserveDeficit(address asset) external view returns (uint256); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IReserveInterestRateStrategy.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IReserveInterestRateStrategy.sol - - /** - * @title IReserveInterestRateStrategy -@@ -1292,7 +1338,7 @@ interface IReserveInterestRateStrategy { - ) external view returns (uint256, uint256); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IAaveOracle.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IAaveOracle.sol - - /** - * @title IAaveOracle -@@ -1360,7 +1406,7 @@ interface IAaveOracle is IPriceOracleGetter { - function getFallbackOracle() external view returns (address); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPool.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -1543,6 +1589,14 @@ interface IPool { - uint256 variableBorrowIndex - ); - -+ /** -+ * @dev Emitted when the deficit of a reserve is covered. -+ * @param reserve The address of the underlying asset of the reserve -+ * @param caller The caller that triggered the DeficitCovered event -+ * @param amountCovered The amount of deficit covered -+ */ -+ event DeficitCovered(address indexed reserve, address caller, uint256 amountCovered); -+ - /** - * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest. - * @param reserve The address of the reserve -@@ -1550,6 +1604,14 @@ interface IPool { - */ - event MintedToTreasury(address indexed reserve, uint256 amountMinted); - -+ /** -+ * @dev Emitted when deficit is realized on a liquidation. -+ * @param user The user address where the bad debt will be burned -+ * @param debtAsset The address of the underlying borrowed asset to be burned -+ * @param amountCreated The amount of deficit created -+ */ -+ event DeficitCreated(address indexed user, address indexed debtAsset, uint256 amountCreated); -+ - /** - * @notice Mints an `amount` of aTokens to the `onBehalfOf` - * @param asset The address of the underlying asset to mint -@@ -1917,16 +1979,6 @@ interface IPool { - */ - function getReserveData(address asset) external view returns (DataTypes.ReserveDataLegacy memory); - -- /** -- * @notice Returns the state and configuration of the reserve, including extra data included with Aave v3.1 -- * @dev DEPRECATED use independent getters instead (getReserveData, getLiquidationGracePeriod) -- * @param asset The address of the underlying asset of the reserve -- * @return The state and configuration data of the reserve with virtual accounting -- */ -- function getReserveDataExtended( -- address asset -- ) external view returns (DataTypes.ReserveData memory); -- - /** - * @notice Returns the virtual underlying balance of the reserve - * @param asset The address of the underlying asset of the reserve -@@ -2101,7 +2153,7 @@ interface IPool { - * @param asset The address of the underlying asset - * @return Timestamp when the liquidation grace period will end - **/ -- function getLiquidationGracePeriod(address asset) external returns (uint40); -+ function getLiquidationGracePeriod(address asset) external view returns (uint40); - - /** - * @notice Returns the total fee on flash loans -@@ -2155,6 +2207,37 @@ interface IPool { - */ - function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external; - -+ /** -+ * @notice It covers the deficit of a specified reserve by burning: -+ * - the equivalent aToken `amount` for assets with virtual accounting enabled -+ * - the equivalent `amount` of underlying for assets with virtual accounting disabled (e.g. GHO) -+ * @dev The deficit of a reserve can occur due to situations where borrowed assets are not repaid, leading to bad debt. -+ * @param asset The address of the underlying asset to cover the deficit. -+ * @param amount The amount to be covered, in aToken or underlying on non-virtual accounted assets -+ */ -+ function eliminateReserveDeficit(address asset, uint256 amount) external; -+ -+ /** -+ * @notice Returns the current deficit of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The current deficit of the reserve -+ */ -+ function getReserveDeficit(address asset) external view returns (uint256); -+ -+ /** -+ * @notice Returns the aToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the aToken -+ */ -+ function getReserveAToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Returns the variableDebtToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the variableDebtToken -+ */ -+ function getReserveVariableDebtToken(address asset) external view returns (address); -+ - /** - * @notice Gets the address of the external FlashLoanLogic - */ -@@ -2191,7 +2274,7 @@ interface IPool { - function getSupplyLogic() external view returns (address); - } - + -// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/interfaces/IUiPoolDataProviderV3.sol +// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/interfaces/IUiPoolDataProviderV3.sol - + interface IUiPoolDataProviderV3 { struct AggregatedReserveData { @@ -2241,6 +2324,8 @@ interface IUiPoolDataProviderV3 { @@ -345,595 +16,22 @@ index 9db6a74..18a6e75 100644 + // v3.3 + uint128 deficit; } - - struct UserReserveData { -@@ -2283,7 +2368,7 @@ interface IUiPoolDataProviderV3 { - function getEModes(IPoolAddressesProvider provider) external view returns (Emode[] memory); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -2291,26 +2376,26 @@ interface IUiPoolDataProviderV3 { - * @notice Implements the bitmap logic to handle the reserve configuration - */ - library ReserveConfiguration { -- uint256 internal constant LTV_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000; // prettier-ignore -- uint256 internal constant LIQUIDATION_THRESHOLD_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF; // prettier-ignore -- uint256 internal constant LIQUIDATION_BONUS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFF; // prettier-ignore -- uint256 internal constant DECIMALS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant ACTIVE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant FROZEN_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFF; // prettier-ignore -+ uint256 internal constant LTV_MASK = 0x000000000000000000000000000000000000000000000000000000000000FFFF; // prettier-ignore -+ uint256 internal constant LIQUIDATION_THRESHOLD_MASK = 0x00000000000000000000000000000000000000000000000000000000FFFF0000; // prettier-ignore -+ uint256 internal constant LIQUIDATION_BONUS_MASK = 0x0000000000000000000000000000000000000000000000000000FFFF00000000; // prettier-ignore -+ uint256 internal constant DECIMALS_MASK = 0x00000000000000000000000000000000000000000000000000FF000000000000; // prettier-ignore -+ uint256 internal constant ACTIVE_MASK = 0x0000000000000000000000000000000000000000000000000100000000000000; // prettier-ignore -+ uint256 internal constant FROZEN_MASK = 0x0000000000000000000000000000000000000000000000000200000000000000; // prettier-ignore -+ uint256 internal constant BORROWING_MASK = 0x0000000000000000000000000000000000000000000000000400000000000000; // prettier-ignore - // @notice there is an unoccupied hole of 1 bit at position 59 from pre 3.2 stableBorrowRateEnabled -- uint256 internal constant PAUSED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROWABLE_IN_ISOLATION_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant SILOED_BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant FLASHLOAN_ENABLED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant RESERVE_FACTOR_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROW_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant SUPPLY_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant LIQUIDATION_PROTOCOL_FEE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- // @notice there is an unoccupied hole of 8 bits from 168 to 176 left from pre 3.2 eModeCategory -- uint256 internal constant UNBACKED_MINT_CAP_MASK = 0xFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant DEBT_CEILING_MASK = 0xF0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant VIRTUAL_ACC_ACTIVE_MASK = 0xEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -+ uint256 internal constant PAUSED_MASK = 0x0000000000000000000000000000000000000000000000001000000000000000; // prettier-ignore -+ uint256 internal constant BORROWABLE_IN_ISOLATION_MASK = 0x0000000000000000000000000000000000000000000000002000000000000000; // prettier-ignore -+ uint256 internal constant SILOED_BORROWING_MASK = 0x0000000000000000000000000000000000000000000000004000000000000000; // prettier-ignore -+ uint256 internal constant FLASHLOAN_ENABLED_MASK = 0x0000000000000000000000000000000000000000000000008000000000000000; // prettier-ignore -+ uint256 internal constant RESERVE_FACTOR_MASK = 0x00000000000000000000000000000000000000000000FFFF0000000000000000; // prettier-ignore -+ uint256 internal constant BORROW_CAP_MASK = 0x00000000000000000000000000000000000FFFFFFFFF00000000000000000000; // prettier-ignore -+ uint256 internal constant SUPPLY_CAP_MASK = 0x00000000000000000000000000FFFFFFFFF00000000000000000000000000000; // prettier-ignore -+ uint256 internal constant LIQUIDATION_PROTOCOL_FEE_MASK = 0x0000000000000000000000FFFF00000000000000000000000000000000000000; // prettier-ignore -+ //@notice there is an unoccupied hole of 8 bits from 168 to 176 left from pre 3.2 eModeCategory -+ uint256 internal constant UNBACKED_MINT_CAP_MASK = 0x00000000000FFFFFFFFF00000000000000000000000000000000000000000000; // prettier-ignore -+ uint256 internal constant DEBT_CEILING_MASK = 0x0FFFFFFFFFF00000000000000000000000000000000000000000000000000000; // prettier-ignore -+ uint256 internal constant VIRTUAL_ACC_ACTIVE_MASK = 0x1000000000000000000000000000000000000000000000000000000000000000; // prettier-ignore - - /// @dev For the LTV, the start bit is 0 (up to 15), hence no bitshifting is needed - uint256 internal constant LIQUIDATION_THRESHOLD_START_BIT_POSITION = 16; -@@ -2354,7 +2439,7 @@ library ReserveConfiguration { - function setLtv(DataTypes.ReserveConfigurationMap memory self, uint256 ltv) internal pure { - require(ltv <= MAX_VALID_LTV, Errors.INVALID_LTV); - -- self.data = (self.data & LTV_MASK) | ltv; -+ self.data = (self.data & ~LTV_MASK) | ltv; - } - - /** -@@ -2363,7 +2448,7 @@ library ReserveConfiguration { - * @return The loan to value - */ - function getLtv(DataTypes.ReserveConfigurationMap memory self) internal pure returns (uint256) { -- return self.data & ~LTV_MASK; -+ return self.data & LTV_MASK; - } - - /** -@@ -2378,7 +2463,7 @@ library ReserveConfiguration { - require(threshold <= MAX_VALID_LIQUIDATION_THRESHOLD, Errors.INVALID_LIQ_THRESHOLD); - - self.data = -- (self.data & LIQUIDATION_THRESHOLD_MASK) | -+ (self.data & ~LIQUIDATION_THRESHOLD_MASK) | - (threshold << LIQUIDATION_THRESHOLD_START_BIT_POSITION); - } - -@@ -2390,7 +2475,7 @@ library ReserveConfiguration { - function getLiquidationThreshold( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION; -+ return (self.data & LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION; - } - - /** -@@ -2405,7 +2490,7 @@ library ReserveConfiguration { - require(bonus <= MAX_VALID_LIQUIDATION_BONUS, Errors.INVALID_LIQ_BONUS); - - self.data = -- (self.data & LIQUIDATION_BONUS_MASK) | -+ (self.data & ~LIQUIDATION_BONUS_MASK) | - (bonus << LIQUIDATION_BONUS_START_BIT_POSITION); - } - -@@ -2417,7 +2502,7 @@ library ReserveConfiguration { - function getLiquidationBonus( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION; -+ return (self.data & LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION; - } - - /** -@@ -2431,7 +2516,7 @@ library ReserveConfiguration { - ) internal pure { - require(decimals <= MAX_VALID_DECIMALS, Errors.INVALID_DECIMALS); - -- self.data = (self.data & DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION); -+ self.data = (self.data & ~DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION); - } - - /** -@@ -2442,7 +2527,7 @@ library ReserveConfiguration { - function getDecimals( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION; -+ return (self.data & DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION; - } - - /** -@@ -2452,7 +2537,7 @@ library ReserveConfiguration { - */ - function setActive(DataTypes.ReserveConfigurationMap memory self, bool active) internal pure { - self.data = -- (self.data & ACTIVE_MASK) | -+ (self.data & ~ACTIVE_MASK) | - (uint256(active ? 1 : 0) << IS_ACTIVE_START_BIT_POSITION); - } - -@@ -2462,7 +2547,7 @@ library ReserveConfiguration { - * @return The active state - */ - function getActive(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~ACTIVE_MASK) != 0; -+ return (self.data & ACTIVE_MASK) != 0; - } - - /** -@@ -2472,7 +2557,7 @@ library ReserveConfiguration { - */ - function setFrozen(DataTypes.ReserveConfigurationMap memory self, bool frozen) internal pure { - self.data = -- (self.data & FROZEN_MASK) | -+ (self.data & ~FROZEN_MASK) | - (uint256(frozen ? 1 : 0) << IS_FROZEN_START_BIT_POSITION); - } - -@@ -2482,7 +2567,7 @@ library ReserveConfiguration { - * @return The frozen state - */ - function getFrozen(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~FROZEN_MASK) != 0; -+ return (self.data & FROZEN_MASK) != 0; - } - - /** -@@ -2492,7 +2577,7 @@ library ReserveConfiguration { - */ - function setPaused(DataTypes.ReserveConfigurationMap memory self, bool paused) internal pure { - self.data = -- (self.data & PAUSED_MASK) | -+ (self.data & ~PAUSED_MASK) | - (uint256(paused ? 1 : 0) << IS_PAUSED_START_BIT_POSITION); - } - -@@ -2502,7 +2587,7 @@ library ReserveConfiguration { - * @return The paused state - */ - function getPaused(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~PAUSED_MASK) != 0; -+ return (self.data & PAUSED_MASK) != 0; - } - - /** -@@ -2519,7 +2604,7 @@ library ReserveConfiguration { - bool borrowable - ) internal pure { - self.data = -- (self.data & BORROWABLE_IN_ISOLATION_MASK) | -+ (self.data & ~BORROWABLE_IN_ISOLATION_MASK) | - (uint256(borrowable ? 1 : 0) << BORROWABLE_IN_ISOLATION_START_BIT_POSITION); - } - -@@ -2535,7 +2620,7 @@ library ReserveConfiguration { - function getBorrowableInIsolation( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~BORROWABLE_IN_ISOLATION_MASK) != 0; -+ return (self.data & BORROWABLE_IN_ISOLATION_MASK) != 0; - } - - /** -@@ -2549,7 +2634,7 @@ library ReserveConfiguration { - bool siloed - ) internal pure { - self.data = -- (self.data & SILOED_BORROWING_MASK) | -+ (self.data & ~SILOED_BORROWING_MASK) | - (uint256(siloed ? 1 : 0) << SILOED_BORROWING_START_BIT_POSITION); - } - -@@ -2562,7 +2647,7 @@ library ReserveConfiguration { - function getSiloedBorrowing( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~SILOED_BORROWING_MASK) != 0; -+ return (self.data & SILOED_BORROWING_MASK) != 0; - } - - /** -@@ -2575,7 +2660,7 @@ library ReserveConfiguration { - bool enabled - ) internal pure { - self.data = -- (self.data & BORROWING_MASK) | -+ (self.data & ~BORROWING_MASK) | - (uint256(enabled ? 1 : 0) << BORROWING_ENABLED_START_BIT_POSITION); - } - -@@ -2587,7 +2672,7 @@ library ReserveConfiguration { - function getBorrowingEnabled( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~BORROWING_MASK) != 0; -+ return (self.data & BORROWING_MASK) != 0; - } - - /** -@@ -2602,7 +2687,7 @@ library ReserveConfiguration { - require(reserveFactor <= MAX_VALID_RESERVE_FACTOR, Errors.INVALID_RESERVE_FACTOR); - - self.data = -- (self.data & RESERVE_FACTOR_MASK) | -+ (self.data & ~RESERVE_FACTOR_MASK) | - (reserveFactor << RESERVE_FACTOR_START_BIT_POSITION); - } - -@@ -2614,7 +2699,7 @@ library ReserveConfiguration { - function getReserveFactor( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION; -+ return (self.data & RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION; - } - - /** -@@ -2628,7 +2713,7 @@ library ReserveConfiguration { - ) internal pure { - require(borrowCap <= MAX_VALID_BORROW_CAP, Errors.INVALID_BORROW_CAP); - -- self.data = (self.data & BORROW_CAP_MASK) | (borrowCap << BORROW_CAP_START_BIT_POSITION); -+ self.data = (self.data & ~BORROW_CAP_MASK) | (borrowCap << BORROW_CAP_START_BIT_POSITION); - } - - /** -@@ -2639,7 +2724,7 @@ library ReserveConfiguration { - function getBorrowCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION; -+ return (self.data & BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION; - } - - /** -@@ -2653,7 +2738,7 @@ library ReserveConfiguration { - ) internal pure { - require(supplyCap <= MAX_VALID_SUPPLY_CAP, Errors.INVALID_SUPPLY_CAP); - -- self.data = (self.data & SUPPLY_CAP_MASK) | (supplyCap << SUPPLY_CAP_START_BIT_POSITION); -+ self.data = (self.data & ~SUPPLY_CAP_MASK) | (supplyCap << SUPPLY_CAP_START_BIT_POSITION); - } - - /** -@@ -2664,7 +2749,7 @@ library ReserveConfiguration { - function getSupplyCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION; -+ return (self.data & SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION; - } - - /** -@@ -2678,7 +2763,7 @@ library ReserveConfiguration { - ) internal pure { - require(ceiling <= MAX_VALID_DEBT_CEILING, Errors.INVALID_DEBT_CEILING); - -- self.data = (self.data & DEBT_CEILING_MASK) | (ceiling << DEBT_CEILING_START_BIT_POSITION); -+ self.data = (self.data & ~DEBT_CEILING_MASK) | (ceiling << DEBT_CEILING_START_BIT_POSITION); - } - - /** -@@ -2689,7 +2774,7 @@ library ReserveConfiguration { - function getDebtCeiling( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~DEBT_CEILING_MASK) >> DEBT_CEILING_START_BIT_POSITION; -+ return (self.data & DEBT_CEILING_MASK) >> DEBT_CEILING_START_BIT_POSITION; - } - - /** -@@ -2707,7 +2792,7 @@ library ReserveConfiguration { - ); - - self.data = -- (self.data & LIQUIDATION_PROTOCOL_FEE_MASK) | -+ (self.data & ~LIQUIDATION_PROTOCOL_FEE_MASK) | - (liquidationProtocolFee << LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION); - } - -@@ -2720,7 +2805,7 @@ library ReserveConfiguration { - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { - return -- (self.data & ~LIQUIDATION_PROTOCOL_FEE_MASK) >> LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION; -+ (self.data & LIQUIDATION_PROTOCOL_FEE_MASK) >> LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION; - } - - /** -@@ -2735,7 +2820,7 @@ library ReserveConfiguration { - require(unbackedMintCap <= MAX_VALID_UNBACKED_MINT_CAP, Errors.INVALID_UNBACKED_MINT_CAP); - - self.data = -- (self.data & UNBACKED_MINT_CAP_MASK) | -+ (self.data & ~UNBACKED_MINT_CAP_MASK) | - (unbackedMintCap << UNBACKED_MINT_CAP_START_BIT_POSITION); - } - -@@ -2747,7 +2832,7 @@ library ReserveConfiguration { - function getUnbackedMintCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~UNBACKED_MINT_CAP_MASK) >> UNBACKED_MINT_CAP_START_BIT_POSITION; -+ return (self.data & UNBACKED_MINT_CAP_MASK) >> UNBACKED_MINT_CAP_START_BIT_POSITION; - } - - /** -@@ -2760,7 +2845,7 @@ library ReserveConfiguration { - bool flashLoanEnabled - ) internal pure { - self.data = -- (self.data & FLASHLOAN_ENABLED_MASK) | -+ (self.data & ~FLASHLOAN_ENABLED_MASK) | - (uint256(flashLoanEnabled ? 1 : 0) << FLASHLOAN_ENABLED_START_BIT_POSITION); - } - -@@ -2772,7 +2857,7 @@ library ReserveConfiguration { - function getFlashLoanEnabled( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~FLASHLOAN_ENABLED_MASK) != 0; -+ return (self.data & FLASHLOAN_ENABLED_MASK) != 0; - } - - /** -@@ -2785,21 +2870,24 @@ library ReserveConfiguration { - bool active - ) internal pure { - self.data = -- (self.data & VIRTUAL_ACC_ACTIVE_MASK) | -+ (self.data & ~VIRTUAL_ACC_ACTIVE_MASK) | - (uint256(active ? 1 : 0) << VIRTUAL_ACC_START_BIT_POSITION); - } - - /** - * @notice Gets the virtual account active/not state of the reserve - * @dev The state should be true for all normal assets and should be false -- * only in special cases (ex. GHO) where an asset is minted instead of supplied. -+ * Virtual accounting being disabled means that the asset: -+ * - is GHO -+ * - can never be supplied -+ * - the interest rate strategy is not influenced by the virtual balance - * @param self The reserve configuration - * @return The active state - */ - function getIsVirtualAccActive( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~VIRTUAL_ACC_ACTIVE_MASK) != 0; -+ return (self.data & VIRTUAL_ACC_ACTIVE_MASK) != 0; - } - - /** -@@ -2816,10 +2904,10 @@ library ReserveConfiguration { - uint256 dataLocal = self.data; - - return ( -- (dataLocal & ~ACTIVE_MASK) != 0, -- (dataLocal & ~FROZEN_MASK) != 0, -- (dataLocal & ~BORROWING_MASK) != 0, -- (dataLocal & ~PAUSED_MASK) != 0 -+ (dataLocal & ACTIVE_MASK) != 0, -+ (dataLocal & FROZEN_MASK) != 0, -+ (dataLocal & BORROWING_MASK) != 0, -+ (dataLocal & PAUSED_MASK) != 0 - ); - } - -@@ -2838,11 +2926,11 @@ library ReserveConfiguration { - uint256 dataLocal = self.data; - - return ( -- dataLocal & ~LTV_MASK, -- (dataLocal & ~LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION, -- (dataLocal & ~LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION, -- (dataLocal & ~DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION, -- (dataLocal & ~RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION -+ dataLocal & LTV_MASK, -+ (dataLocal & LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION, -+ (dataLocal & LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION, -+ (dataLocal & DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION, -+ (dataLocal & RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION - ); - } - -@@ -2858,13 +2946,13 @@ library ReserveConfiguration { - uint256 dataLocal = self.data; - - return ( -- (dataLocal & ~BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION, -- (dataLocal & ~SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION -+ (dataLocal & BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION, -+ (dataLocal & SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION - ); - } - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol - - /** - * @title IDefaultInterestRateStrategyV2 -@@ -3022,7 +3110,7 @@ interface IDefaultInterestRateStrategyV2 is IReserveInterestRateStrategy { - function setInterestRateParams(address reserve, InterestRateData calldata rateData) external; - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/configuration/UserConfiguration.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/protocol/libraries/configuration/UserConfiguration.sol - - /** - * @title UserConfiguration library -@@ -3254,7 +3342,7 @@ library UserConfiguration { - } - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IInitializableAToken.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IInitializableAToken.sol - - /** - * @title IInitializableAToken -@@ -3307,7 +3395,7 @@ interface IInitializableAToken { - ) external; - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IInitializableDebtToken.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IInitializableDebtToken.sol - - /** - * @title IInitializableDebtToken -@@ -3356,7 +3444,7 @@ interface IInitializableDebtToken { - ) external; - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IVariableDebtToken.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IVariableDebtToken.sol - - /** - * @title IVariableDebtToken -@@ -3399,7 +3487,7 @@ interface IVariableDebtToken is IScaledBalanceToken, IInitializableDebtToken { - function UNDERLYING_ASSET_ADDRESS() external view returns (address); - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IAToken.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/interfaces/IAToken.sol - - /** - * @title IAToken -@@ -3533,7 +3621,7 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken { - function rescueTokens(address token, address to, uint256 amount) external; - } - --// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/AaveProtocolDataProvider.sol -+// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/AaveProtocolDataProvider.sol - - /** - * @title AaveProtocolDataProvider -@@ -3587,10 +3675,10 @@ contract AaveProtocolDataProvider is IPoolDataProvider { - address[] memory reserves = pool.getReservesList(); - TokenData[] memory aTokens = new TokenData[](reserves.length); - for (uint256 i = 0; i < reserves.length; i++) { -- DataTypes.ReserveDataLegacy memory reserveData = pool.getReserveData(reserves[i]); -+ address aTokenAddress = pool.getReserveAToken(reserves[i]); - aTokens[i] = TokenData({ -- symbol: IERC20Detailed(reserveData.aTokenAddress).symbol(), -- tokenAddress: reserveData.aTokenAddress -+ symbol: IERC20Detailed(aTokenAddress).symbol(), -+ tokenAddress: aTokenAddress - }); - } - return aTokens; -@@ -3678,12 +3766,12 @@ contract AaveProtocolDataProvider is IPoolDataProvider { - uint256 unbacked, - uint256 accruedToTreasuryScaled, - uint256 totalAToken, -- uint256 totalStableDebt, -+ uint256, - uint256 totalVariableDebt, - uint256 liquidityRate, - uint256 variableBorrowRate, -- uint256 stableBorrowRate, -- uint256 averageStableBorrowRate, -+ uint256, -+ uint256, - uint256 liquidityIndex, - uint256 variableBorrowIndex, - uint40 lastUpdateTimestamp -@@ -3712,18 +3800,15 @@ contract AaveProtocolDataProvider is IPoolDataProvider { - - /// @inheritdoc IPoolDataProvider - function getATokenTotalSupply(address asset) external view override returns (uint256) { -- DataTypes.ReserveDataLegacy memory reserve = IPool(ADDRESSES_PROVIDER.getPool()).getReserveData( -- asset -- ); -- return IERC20Detailed(reserve.aTokenAddress).totalSupply(); -+ address aTokenAddress = IPool(ADDRESSES_PROVIDER.getPool()).getReserveAToken(asset); -+ return IERC20Detailed(aTokenAddress).totalSupply(); - } - - /// @inheritdoc IPoolDataProvider - function getTotalDebt(address asset) external view override returns (uint256) { -- DataTypes.ReserveDataLegacy memory reserve = IPool(ADDRESSES_PROVIDER.getPool()).getReserveData( -- asset -- ); -- return IERC20Detailed(reserve.variableDebtTokenAddress).totalSupply(); -+ address variableDebtTokenAddress = IPool(ADDRESSES_PROVIDER.getPool()) -+ .getReserveVariableDebtToken(asset); -+ return IERC20Detailed(variableDebtTokenAddress).totalSupply(); - } - - /// @inheritdoc IPoolDataProvider -@@ -3777,12 +3862,10 @@ contract AaveProtocolDataProvider is IPoolDataProvider { - address variableDebtTokenAddress - ) - { -- DataTypes.ReserveDataLegacy memory reserve = IPool(ADDRESSES_PROVIDER.getPool()).getReserveData( -- asset -- ); -+ IPool pool = IPool(ADDRESSES_PROVIDER.getPool()); - - // @notice all stable debt related parameters deprecated in v3.2.0 -- return (reserve.aTokenAddress, address(0), reserve.variableDebtTokenAddress); -+ return (pool.getReserveAToken(asset), address(0), pool.getReserveVariableDebtToken(asset)); - } - - /// @inheritdoc IPoolDataProvider -@@ -3816,23 +3899,28 @@ contract AaveProtocolDataProvider is IPoolDataProvider { - function getVirtualUnderlyingBalance(address asset) external view override returns (uint256) { - return IPool(ADDRESSES_PROVIDER.getPool()).getVirtualUnderlyingBalance(asset); - } -+ -+ /// @inheritdoc IPoolDataProvider -+ function getReserveDeficit(address asset) external view override returns (uint256) { -+ return IPool(ADDRESSES_PROVIDER.getPool()).getReserveDeficit(asset); -+ } - } - + -// downloads/GNOSIS/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/UiPoolDataProviderV3.sol +// downloads/CELO/UI_POOL_DATA_PROVIDER/UiPoolDataProviderV3/src/contracts/helpers/UiPoolDataProviderV3.sol - + contract UiPoolDataProviderV3 is IUiPoolDataProviderV3 { using WadRayMath for uint256; using ReserveConfiguration for DataTypes.ReserveConfigurationMap; using UserConfiguration for DataTypes.UserConfigurationMap; - + - IEACAggregatorProxy public immutable networkBaseTokenPriceInUsdProxyAggregator; - IEACAggregatorProxy public immutable marketReferenceCurrencyPriceInUsdProxyAggregator; + AggregatorInterface public immutable networkBaseTokenPriceInUsdProxyAggregator; + AggregatorInterface public immutable marketReferenceCurrencyPriceInUsdProxyAggregator; uint256 public constant ETH_CURRENCY_UNIT = 1 ether; address public constant MKR_ADDRESS = 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2; - + constructor( - IEACAggregatorProxy _networkBaseTokenPriceInUsdProxyAggregator, - IEACAggregatorProxy _marketReferenceCurrencyPriceInUsdProxyAggregator @@ -944,7 +42,7 @@ index 9db6a74..18a6e75 100644 marketReferenceCurrencyPriceInUsdProxyAggregator = _marketReferenceCurrencyPriceInUsdProxyAggregator; @@ -3930,6 +4018,7 @@ contract UiPoolDataProviderV3 is IUiPoolDataProviderV3 { } catch {} - + // v3 only + reserveData.deficit = uint128(pool.getReserveDeficit(reserveData.underlyingAsset)); reserveData.debtCeiling = reserveConfigurationMap.getDebtCeiling(); diff --git a/GNOSIS_CELO/WALLET_BALANCE_PROVIDER_DIFF.md b/GNOSIS_CELO/WALLET_BALANCE_PROVIDER_DIFF.md index 991db9f9..7bf04f35 100644 --- a/GNOSIS_CELO/WALLET_BALANCE_PROVIDER_DIFF.md +++ b/GNOSIS_CELO/WALLET_BALANCE_PROVIDER_DIFF.md @@ -3,1325 +3,19 @@ diff --git a/./downloads/GNOSIS/WALLET_BALANCE_PROVIDER.sol b/./downloads/CELO/W index cc18346..71277ff 100644 --- a/./downloads/GNOSIS/WALLET_BALANCE_PROVIDER.sol +++ b/./downloads/CELO/WALLET_BALANCE_PROVIDER.sol -@@ -1,7 +1,7 @@ --// SPDX-License-Identifier: MIT -+// SPDX-License-Identifier: BUSL-1.1 - pragma solidity ^0.8.0 ^0.8.10; - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/dependencies/openzeppelin/contracts/Address.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/dependencies/openzeppelin/contracts/Address.sol - - // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) - -@@ -221,10 +221,14 @@ library Address { - } - } - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/protocol/libraries/types/DataTypes.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/protocol/libraries/types/DataTypes.sol - - library DataTypes { -- struct ReserveData { -+ /** -+ * This exists specifically to maintain the `getReserveData()` interface, since the new, internal -+ * `ReserveData` struct includes the reserve's `virtualUnderlyingBalance`. -+ */ -+ struct ReserveDataLegacy { - //stores the reserve configuration - ReserveConfigurationMap configuration; - //the liquidity index. Expressed in ray -@@ -235,7 +239,7 @@ library DataTypes { - uint128 variableBorrowIndex; - //the current variable borrow rate. Expressed in ray - uint128 currentVariableBorrowRate; -- //the current stable borrow rate. Expressed in ray -+ // DEPRECATED on v3.2.0 - uint128 currentStableBorrowRate; - //timestamp of last update - uint40 lastUpdateTimestamp; -@@ -243,7 +247,7 @@ library DataTypes { - uint16 id; - //aToken address - address aTokenAddress; -- //stableDebtToken address -+ // DEPRECATED on v3.2.0 - address stableDebtTokenAddress; - //variableDebtToken address - address variableDebtTokenAddress; -@@ -257,6 +261,44 @@ library DataTypes { - uint128 isolationModeTotalDebt; - } - -+ struct ReserveData { -+ //stores the reserve configuration -+ ReserveConfigurationMap configuration; -+ //the liquidity index. Expressed in ray -+ uint128 liquidityIndex; -+ //the current supply rate. Expressed in ray -+ uint128 currentLiquidityRate; -+ //variable borrow index. Expressed in ray -+ uint128 variableBorrowIndex; -+ //the current variable borrow rate. Expressed in ray -+ uint128 currentVariableBorrowRate; -+ /// @notice reused `__deprecatedStableBorrowRate` storage from pre 3.2 -+ // the current accumulate deficit in underlying tokens -+ uint128 deficit; -+ //timestamp of last update -+ uint40 lastUpdateTimestamp; -+ //the id of the reserve. Represents the position in the list of the active reserves -+ uint16 id; -+ //timestamp until when liquidations are not allowed on the reserve, if set to past liquidations will be allowed -+ uint40 liquidationGracePeriodUntil; -+ //aToken address -+ address aTokenAddress; -+ // DEPRECATED on v3.2.0 -+ address __deprecatedStableDebtTokenAddress; -+ //variableDebtToken address -+ address variableDebtTokenAddress; -+ //address of the interest rate strategy -+ address interestRateStrategyAddress; -+ //the current treasury balance, scaled -+ uint128 accruedToTreasury; -+ //the outstanding unbacked aTokens minted through the bridging feature -+ uint128 unbacked; -+ //the outstanding debt borrowed against this asset in isolation mode -+ uint128 isolationModeTotalDebt; -+ //the amount of underlying accounted for by the protocol -+ uint128 virtualUnderlyingBalance; -+ } -+ - struct ReserveConfigurationMap { - //bit 0-15: LTV - //bit 16-31: Liq. threshold -@@ -265,19 +307,20 @@ library DataTypes { - //bit 56: reserve is active - //bit 57: reserve is frozen - //bit 58: borrowing is enabled -- //bit 59: stable rate borrowing enabled -+ //bit 59: DEPRECATED: stable rate borrowing enabled - //bit 60: asset is paused - //bit 61: borrowing in isolation mode is enabled - //bit 62: siloed borrowing enabled - //bit 63: flashloaning enabled - //bit 64-79: reserve factor -- //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap -- //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap -- //bit 152-167 liquidation protocol fee -- //bit 168-175 eMode category -- //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled -- //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals -- //bit 252-255 unused -+ //bit 80-115: borrow cap in whole tokens, borrowCap == 0 => no cap -+ //bit 116-151: supply cap in whole tokens, supplyCap == 0 => no cap -+ //bit 152-167: liquidation protocol fee -+ //bit 168-175: DEPRECATED: eMode category -+ //bit 176-211: unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled -+ //bit 212-251: debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals -+ //bit 252: virtual accounting is enabled for the reserve -+ //bit 253-255 unused - - uint256 data; - } -@@ -291,30 +334,49 @@ library DataTypes { - uint256 data; - } - -- struct EModeCategory { -+ // DEPRECATED: kept for backwards compatibility, might be removed in a future version -+ struct EModeCategoryLegacy { - // each eMode category has a custom ltv and liquidation threshold - uint16 ltv; - uint16 liquidationThreshold; - uint16 liquidationBonus; -- // each eMode category may or may not have a custom oracle to override the individual assets price oracles -+ // DEPRECATED - address priceSource; - string label; - } - -+ struct CollateralConfig { -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ } -+ -+ struct EModeCategoryBaseConfiguration { -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ string label; -+ } -+ -+ struct EModeCategory { -+ // each eMode category has a custom ltv and liquidation threshold -+ uint16 ltv; -+ uint16 liquidationThreshold; -+ uint16 liquidationBonus; -+ uint128 collateralBitmap; -+ string label; -+ uint128 borrowableBitmap; -+ } -+ - enum InterestRateMode { - NONE, -- STABLE, -+ __DEPRECATED, - VARIABLE - } - - struct ReserveCache { - uint256 currScaledVariableDebt; - uint256 nextScaledVariableDebt; -- uint256 currPrincipalStableDebt; -- uint256 currAvgStableBorrowRate; -- uint256 currTotalStableDebt; -- uint256 nextAvgStableBorrowRate; -- uint256 nextTotalStableDebt; - uint256 currLiquidityIndex; - uint256 nextLiquidityIndex; - uint256 currVariableBorrowIndex; -@@ -324,10 +386,8 @@ library DataTypes { - uint256 reserveFactor; - ReserveConfigurationMap reserveConfiguration; - address aTokenAddress; -- address stableDebtTokenAddress; - address variableDebtTokenAddress; - uint40 reserveLastUpdateTimestamp; -- uint40 stableDebtLastUpdateTimestamp; - } - - struct ExecuteLiquidationCallParams { -@@ -357,7 +417,6 @@ library DataTypes { - InterestRateMode interestRateMode; - uint16 referralCode; - bool releaseUnderlying; -- uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; -@@ -381,6 +440,11 @@ library DataTypes { - uint8 userEModeCategory; - } - -+ struct ExecuteEliminateDeficitParams { -+ address asset; -+ uint256 amount; -+ } -+ - struct ExecuteSetUserEModeParams { - uint256 reservesCount; - address oracle; -@@ -409,9 +473,9 @@ library DataTypes { - uint16 referralCode; - uint256 flashLoanPremiumToProtocol; - uint256 flashLoanPremiumTotal; -- uint256 maxStableRateBorrowSizePercent; - uint256 reservesCount; - address addressesProvider; -+ address pool; - uint8 userEModeCategory; - bool isAuthorizedFlashBorrower; - } -@@ -450,7 +514,6 @@ library DataTypes { - address userAddress; - uint256 amount; - InterestRateMode interestRateMode; -- uint256 maxStableLoanPercent; - uint256 reservesCount; - address oracle; - uint8 userEModeCategory; -@@ -471,18 +534,16 @@ library DataTypes { - uint256 unbacked; - uint256 liquidityAdded; - uint256 liquidityTaken; -- uint256 totalStableDebt; -- uint256 totalVariableDebt; -- uint256 averageStableBorrowRate; -+ uint256 totalDebt; - uint256 reserveFactor; - address reserve; -- address aToken; -+ bool usingVirtualBalance; -+ uint256 virtualUnderlyingBalance; - } - - struct InitReserveParams { - address asset; - address aTokenAddress; -- address stableDebtAddress; - address variableDebtAddress; - address interestRateStrategyAddress; - uint16 reservesCount; -@@ -490,7 +551,7 @@ library DataTypes { - } - } - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/protocol/libraries/helpers/Errors.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/protocol/libraries/helpers/Errors.sol - - /** - * @title Errors library -@@ -528,17 +589,14 @@ library Errors { - string public constant RESERVE_FROZEN = '28'; // 'Action cannot be performed because the reserve is frozen' - string public constant RESERVE_PAUSED = '29'; // 'Action cannot be performed because the reserve is paused' - string public constant BORROWING_NOT_ENABLED = '30'; // 'Borrowing is not enabled' -- string public constant STABLE_BORROWING_NOT_ENABLED = '31'; // 'Stable borrowing is not enabled' - string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '32'; // 'User cannot withdraw more than the available balance' - string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '33'; // 'Invalid interest rate mode selected' - string public constant COLLATERAL_BALANCE_IS_ZERO = '34'; // 'The collateral balance is 0' - string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '35'; // 'Health factor is lesser than the liquidation threshold' - string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '36'; // 'There is not enough collateral to cover a new borrow' - string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '37'; // 'Collateral is (mostly) the same currency that is being borrowed' -- string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '38'; // 'The requested amount is greater than the max loan size in stable rate mode' - string public constant NO_DEBT_OF_SELECTED_TYPE = '39'; // 'For repayment of a specific type of debt, the user needs to have debt that type' - string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '40'; // 'To repay on behalf of a user an explicit amount to repay is needed' -- string public constant NO_OUTSTANDING_STABLE_DEBT = '41'; // 'User does not have outstanding stable rate debt on this reserve' - string public constant NO_OUTSTANDING_VARIABLE_DEBT = '42'; // 'User does not have outstanding variable rate debt on this reserve' - string public constant UNDERLYING_BALANCE_ZERO = '43'; // 'The underlying balance needs to be greater than 0' - string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '44'; // 'Interest rate rebalance conditions were not met' -@@ -551,7 +609,6 @@ library Errors { - string public constant UNBACKED_MINT_CAP_EXCEEDED = '52'; // 'Unbacked mint cap is exceeded' - string public constant DEBT_CEILING_EXCEEDED = '53'; // 'Debt ceiling is exceeded' - string public constant UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO = '54'; // 'Claimable rights over underlying not zero (aToken supply or accruedToTreasury)' -- string public constant STABLE_DEBT_NOT_ZERO = '55'; // 'Stable debt supply is not zero' - string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '56'; // 'Variable debt supply is not zero' - string public constant LTV_VALIDATION_FAILED = '57'; // 'Ltv validation failed' - string public constant INCONSISTENT_EMODE_CATEGORY = '58'; // 'Inconsistent eMode category' -@@ -580,17 +637,28 @@ library Errors { - string public constant DEBT_CEILING_NOT_ZERO = '81'; // 'Debt ceiling is not zero' - string public constant ASSET_NOT_LISTED = '82'; // 'Asset is not listed' - string public constant INVALID_OPTIMAL_USAGE_RATIO = '83'; // 'Invalid optimal usage ratio' -- string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '84'; // 'Invalid optimal stable to total debt ratio' - string public constant UNDERLYING_CANNOT_BE_RESCUED = '85'; // 'The underlying asset cannot be rescued' - string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '86'; // 'Reserve has already been added to reserve list' - string public constant POOL_ADDRESSES_DO_NOT_MATCH = '87'; // 'The token implementation pool address and the pool address provided by the initializing pool do not match' -- string public constant STABLE_BORROWING_ENABLED = '88'; // 'Stable borrowing is enabled' - string public constant SILOED_BORROWING_VIOLATION = '89'; // 'User is trying to borrow multiple assets including a siloed one' - string public constant RESERVE_DEBT_NOT_ZERO = '90'; // the total debt of the reserve needs to be 0 - string public constant FLASHLOAN_DISABLED = '91'; // FlashLoaning for this asset is disabled -+ string public constant INVALID_MAX_RATE = '92'; // The expect maximum borrow rate is invalid -+ string public constant WITHDRAW_TO_ATOKEN = '93'; // Withdrawing to the aToken is not allowed -+ string public constant SUPPLY_TO_ATOKEN = '94'; // Supplying to the aToken is not allowed -+ string public constant SLOPE_2_MUST_BE_GTE_SLOPE_1 = '95'; // Variable interest rate slope 2 can not be lower than slope 1 -+ string public constant CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN = '96'; // 'The caller of the function is not a risk, pool or emergency admin' -+ string public constant LIQUIDATION_GRACE_SENTINEL_CHECK_FAILED = '97'; // 'Liquidation grace sentinel validation failed' -+ string public constant INVALID_GRACE_PERIOD = '98'; // Grace period above a valid range -+ string public constant INVALID_FREEZE_STATE = '99'; // Reserve is already in the passed freeze state -+ string public constant NOT_BORROWABLE_IN_EMODE = '100'; // Asset not borrowable in eMode -+ string public constant CALLER_NOT_UMBRELLA = '101'; // The caller of the function is not the umbrella contract -+ string public constant RESERVE_NOT_IN_DEFICIT = '102'; // The reserve is not in deficit -+ string public constant MUST_NOT_LEAVE_DUST = '103'; // Below a certain threshold liquidators need to take the full position -+ string public constant USER_CANNOT_HAVE_DEBT = '104'; // Thrown when a user tries to interact with a method that requires a position without debt - } - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/dependencies/openzeppelin/contracts/IERC20.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol - - /** - * @dev Interface of the ERC20 standard as defined in the EIP. -@@ -666,7 +734,7 @@ interface IERC20 { - event Approval(address indexed owner, address indexed spender, uint256 value); - } - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/interfaces/IPoolAddressesProvider.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/interfaces/IPoolAddressesProvider.sol - - /** - * @title IPoolAddressesProvider -@@ -893,7 +961,7 @@ interface IPoolAddressesProvider { - function setPoolDataProvider(address newDataProvider) external; - } - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/dependencies/gnosis/contracts/GPv2SafeERC20.sol - - /// @title Gnosis Protocol v2 Safe ERC20 Transfer Library - /// @author Gnosis Developers -@@ -1006,7 +1074,7 @@ library GPv2SafeERC20 { - } - } - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/interfaces/IPool.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/interfaces/IPool.sol - - /** - * @title IPool -@@ -1071,7 +1139,7 @@ interface IPool { - * initiator of the transaction on flashLoan() - * @param onBehalfOf The address that will be getting the debt - * @param amount The amount borrowed out -- * @param interestRateMode The rate mode: 1 for Stable, 2 for Variable -+ * @param interestRateMode The rate mode: 2 for Variable, 1 is deprecated (changed on v3.2.0) - * @param borrowRate The numeric rate at which the user has borrowed, expressed in ray - * @param referralCode The referral code used - */ -@@ -1101,18 +1169,6 @@ interface IPool { - bool useATokens - ); - -- /** -- * @dev Emitted on swapBorrowRateMode() -- * @param reserve The address of the underlying asset of the reserve -- * @param user The address of the user swapping his rate mode -- * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable -- */ -- event SwapBorrowRateMode( -- address indexed reserve, -- address indexed user, -- DataTypes.InterestRateMode interestRateMode -- ); -- - /** - * @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets - * @param asset The address of the underlying asset of the reserve -@@ -1141,20 +1197,14 @@ interface IPool { - */ - event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user); - -- /** -- * @dev Emitted on rebalanceStableBorrowRate() -- * @param reserve The address of the underlying asset of the reserve -- * @param user The address of the user for which the rebalance has been executed -- */ -- event RebalanceStableBorrowRate(address indexed reserve, address indexed user); -- - /** - * @dev Emitted on flashLoan() - * @param target The address of the flash loan receiver contract - * @param initiator The address initiating the flash loan - * @param asset The address of the asset being flash borrowed - * @param amount The amount flash borrowed -- * @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt -+ * @param interestRateMode The flashloan mode: 0 for regular flashloan, -+ * 1 for Stable (Deprecated on v3.2.0), 2 for Variable - * @param premium The fee flash borrowed - * @param referralCode The referral code used - */ -@@ -1193,7 +1243,7 @@ interface IPool { - * @dev Emitted when the state of a reserve is updated. - * @param reserve The address of the underlying asset of the reserve - * @param liquidityRate The next liquidity rate -- * @param stableBorrowRate The next stable borrow rate -+ * @param stableBorrowRate The next stable borrow rate @note deprecated on v3.2.0 - * @param variableBorrowRate The next variable borrow rate - * @param liquidityIndex The next liquidity index - * @param variableBorrowIndex The next variable borrow index -@@ -1207,6 +1257,14 @@ interface IPool { - uint256 variableBorrowIndex - ); - -+ /** -+ * @dev Emitted when the deficit of a reserve is covered. -+ * @param reserve The address of the underlying asset of the reserve -+ * @param caller The caller that triggered the DeficitCovered event -+ * @param amountCovered The amount of deficit covered -+ */ -+ event DeficitCovered(address indexed reserve, address caller, uint256 amountCovered); -+ - /** - * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest. - * @param reserve The address of the reserve -@@ -1214,6 +1272,14 @@ interface IPool { - */ - event MintedToTreasury(address indexed reserve, uint256 amountMinted); - -+ /** -+ * @dev Emitted when deficit is realized on a liquidation. -+ * @param user The user address where the bad debt will be burned -+ * @param debtAsset The address of the underlying borrowed asset to be burned -+ * @param amountCreated The amount of deficit created -+ */ -+ event DeficitCreated(address indexed user, address indexed debtAsset, uint256 amountCreated); -+ - /** - * @notice Mints an `amount` of aTokens to the `onBehalfOf` - * @param asset The address of the underlying asset to mint -@@ -1292,13 +1358,12 @@ interface IPool { - - /** - * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower -- * already supplied enough collateral, or he was given enough allowance by a credit delegator on the -- * corresponding debt token (StableDebtToken or VariableDebtToken) -+ * already supplied enough collateral, or he was given enough allowance by a credit delegator on the VariableDebtToken - * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet -- * and 100 stable/variable debt tokens, depending on the `interestRateMode` -+ * and 100 variable debt tokens - * @param asset The address of the underlying asset to borrow - * @param amount The amount to be borrowed -- * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man - * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself -@@ -1315,11 +1380,11 @@ interface IPool { - - /** - * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned -- * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address -+ * - E.g. User repays 100 USDC, burning 100 variable debt tokens of the `onBehalfOf` address - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed -@@ -1338,7 +1403,7 @@ interface IPool { - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode 2 for Variable, 1 is deprecated on v3.2.0 - * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the - * user calling the function if he wants to reduce/remove his own debt, or the address of any other - * other borrower whose debt should be removed -@@ -1362,13 +1427,13 @@ interface IPool { - /** - * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the - * equivalent debt tokens -- * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens -+ * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable debt tokens - * @dev Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken - * balance is not enough to cover the whole debt - * @param asset The address of the borrowed underlying asset previously borrowed - * @param amount The amount to repay - * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode` -- * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable -+ * @param interestRateMode DEPRECATED in v3.2.0 - * @return The final amount repaid - */ - function repayWithATokens( -@@ -1377,24 +1442,6 @@ interface IPool { - uint256 interestRateMode - ) external returns (uint256); - -- /** -- * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa -- * @param asset The address of the underlying asset borrowed -- * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable -- */ -- function swapBorrowRateMode(address asset, uint256 interestRateMode) external; -- -- /** -- * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve. -- * - Users can be rebalanced if the following conditions are satisfied: -- * 1. Usage ratio is above 95% -- * 2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too -- * much has been borrowed at a stable rate and suppliers are not earning enough -- * @param asset The address of the underlying asset borrowed -- * @param user The address of the user to be rebalanced -- */ -- function rebalanceStableBorrowRate(address asset, address user) external; -- - /** - * @notice Allows suppliers to enable/disable a specific supplied asset as collateral - * @param asset The address of the underlying asset supplied -@@ -1431,9 +1478,9 @@ interface IPool { - * @param amounts The amounts of the assets being flash-borrowed - * @param interestRateModes Types of the debt to open if the flash loan is not returned: - * 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver -- * 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address -+ * 1 -> Deprecated on v3.2.0 - * 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address -- * @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2 -+ * @param onBehalfOf The address that will receive the debt in the case of using 2 on `modes` - * @param params Variadic packed params to pass to the receiver as extra information - * @param referralCode The code used to register the integrator originating the operation, for potential rewards. - * 0 if the action is executed directly by the user, without any middle-man -@@ -1498,14 +1545,12 @@ interface IPool { - * @dev Only callable by the PoolConfigurator contract - * @param asset The address of the underlying asset of the reserve - * @param aTokenAddress The address of the aToken that will be assigned to the reserve -- * @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve - * @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve - * @param interestRateStrategyAddress The address of the interest rate strategy contract - */ - function initReserve( - address asset, - address aTokenAddress, -- address stableDebtAddress, - address variableDebtAddress, - address interestRateStrategyAddress - ) external; -@@ -1513,6 +1558,7 @@ interface IPool { - /** - * @notice Drop a reserve - * @dev Only callable by the PoolConfigurator contract -+ * @dev Does not reset eMode flags, which must be considered when reusing the same reserve id for a different reserve. - * @param asset The address of the underlying asset of the reserve - */ - function dropReserve(address asset) external; -@@ -1528,6 +1574,22 @@ interface IPool { - address rateStrategyAddress - ) external; - -+ /** -+ * @notice Accumulates interest to all indexes of the reserve -+ * @dev Only callable by the PoolConfigurator contract -+ * @dev To be used when required by the configurator, for example when updating interest rates strategy data -+ * @param asset The address of the underlying asset of the reserve -+ */ -+ function syncIndexesState(address asset) external; -+ -+ /** -+ * @notice Updates interest rates on the reserve data -+ * @dev Only callable by the PoolConfigurator contract -+ * @dev To be used when required by the configurator, for example when updating interest rates strategy data -+ * @param asset The address of the underlying asset of the reserve -+ */ -+ function syncRatesState(address asset) external; -+ - /** - * @notice Sets the configuration bitmap of the reserve as a whole - * @dev Only callable by the PoolConfigurator contract -@@ -1583,7 +1645,14 @@ interface IPool { - * @param asset The address of the underlying asset of the reserve - * @return The state and configuration data of the reserve - */ -- function getReserveData(address asset) external view returns (DataTypes.ReserveData memory); -+ function getReserveData(address asset) external view returns (DataTypes.ReserveDataLegacy memory); -+ -+ /** -+ * @notice Returns the virtual underlying balance of the reserve -+ * @param asset The address of the underlying asset of the reserve -+ * @return The reserve virtual underlying balance -+ */ -+ function getVirtualUnderlyingBalance(address asset) external view returns (uint128); - - /** - * @notice Validates and finalizes an aToken transfer -@@ -1611,6 +1680,13 @@ interface IPool { - */ - function getReservesList() external view returns (address[] memory); - -+ /** -+ * @notice Returns the number of initialized reserves -+ * @dev It includes dropped reserves -+ * @return The count -+ */ -+ function getReservesCount() external view returns (uint256); -+ - /** - * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct - * @param id The id of the reserve as stored in the DataTypes.ReserveData struct -@@ -1646,20 +1722,70 @@ interface IPool { - ) external; - - /** -- * @notice Configures a new category for the eMode. -+ * @notice Configures a new or alters an existing collateral configuration of an eMode. - * @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category. - * The category 0 is reserved as it's the default for volatile assets - * @param id The id of the category - * @param config The configuration of the category - */ -- function configureEModeCategory(uint8 id, DataTypes.EModeCategory memory config) external; -+ function configureEModeCategory( -+ uint8 id, -+ DataTypes.EModeCategoryBaseConfiguration memory config -+ ) external; -+ -+ /** -+ * @notice Replaces the current eMode collateralBitmap. -+ * @param id The id of the category -+ * @param collateralBitmap The collateralBitmap of the category -+ */ -+ function configureEModeCategoryCollateralBitmap(uint8 id, uint128 collateralBitmap) external; -+ -+ /** -+ * @notice Replaces the current eMode borrowableBitmap. -+ * @param id The id of the category -+ * @param borrowableBitmap The borrowableBitmap of the category -+ */ -+ function configureEModeCategoryBorrowableBitmap(uint8 id, uint128 borrowableBitmap) external; - - /** - * @notice Returns the data of an eMode category -+ * @dev DEPRECATED use independent getters instead - * @param id The id of the category - * @return The configuration data of the category - */ -- function getEModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory); -+ function getEModeCategoryData( -+ uint8 id -+ ) external view returns (DataTypes.EModeCategoryLegacy memory); -+ -+ /** -+ * @notice Returns the label of an eMode category -+ * @param id The id of the category -+ * @return The label of the category -+ */ -+ function getEModeCategoryLabel(uint8 id) external view returns (string memory); -+ -+ /** -+ * @notice Returns the collateral config of an eMode category -+ * @param id The id of the category -+ * @return The ltv,lt,lb of the category -+ */ -+ function getEModeCategoryCollateralConfig( -+ uint8 id -+ ) external view returns (DataTypes.CollateralConfig memory); -+ -+ /** -+ * @notice Returns the collateralBitmap of an eMode category -+ * @param id The id of the category -+ * @return The collateralBitmap of the category -+ */ -+ function getEModeCategoryCollateralBitmap(uint8 id) external view returns (uint128); -+ -+ /** -+ * @notice Returns the borrowableBitmap of an eMode category -+ * @param id The id of the category -+ * @return The borrowableBitmap of the category -+ */ -+ function getEModeCategoryBorrowableBitmap(uint8 id) external view returns (uint128); - - /** - * @notice Allows a user to use the protocol in eMode -@@ -1682,10 +1808,20 @@ interface IPool { - function resetIsolationModeTotalDebt(address asset) external; - - /** -- * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate -- * @return The percentage of available liquidity to borrow, expressed in bps -- */ -- function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256); -+ * @notice Sets the liquidation grace period of the given asset -+ * @dev To enable a liquidation grace period, a timestamp in the future should be set, -+ * To disable a liquidation grace period, any timestamp in the past works, like 0 -+ * @param asset The address of the underlying asset to set the liquidationGracePeriod -+ * @param until Timestamp when the liquidation grace period will end -+ **/ -+ function setLiquidationGracePeriod(address asset, uint40 until) external; -+ -+ /** -+ * @notice Returns the liquidation grace period of the given asset -+ * @param asset The address of the underlying asset -+ * @return Timestamp when the liquidation grace period will end -+ **/ -+ function getLiquidationGracePeriod(address asset) external view returns (uint40); - - /** - * @notice Returns the total fee on flash loans -@@ -1738,9 +1874,75 @@ interface IPool { - * 0 if the action is executed directly by the user, without any middle-man - */ - function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external; -+ -+ /** -+ * @notice It covers the deficit of a specified reserve by burning: -+ * - the equivalent aToken `amount` for assets with virtual accounting enabled -+ * - the equivalent `amount` of underlying for assets with virtual accounting disabled (e.g. GHO) -+ * @dev The deficit of a reserve can occur due to situations where borrowed assets are not repaid, leading to bad debt. -+ * @param asset The address of the underlying asset to cover the deficit. -+ * @param amount The amount to be covered, in aToken or underlying on non-virtual accounted assets -+ */ -+ function eliminateReserveDeficit(address asset, uint256 amount) external; -+ -+ /** -+ * @notice Returns the current deficit of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The current deficit of the reserve -+ */ -+ function getReserveDeficit(address asset) external view returns (uint256); -+ -+ /** -+ * @notice Returns the aToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the aToken -+ */ -+ function getReserveAToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Returns the variableDebtToken address of a reserve. -+ * @param asset The address of the underlying asset of the reserve -+ * @return The address of the variableDebtToken -+ */ -+ function getReserveVariableDebtToken(address asset) external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external FlashLoanLogic -+ */ -+ function getFlashLoanLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external BorrowLogic -+ */ -+ function getBorrowLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external BridgeLogic -+ */ -+ function getBridgeLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external EModeLogic -+ */ -+ function getEModeLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external LiquidationLogic -+ */ -+ function getLiquidationLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external PoolLogic -+ */ -+ function getPoolLogic() external view returns (address); -+ -+ /** -+ * @notice Gets the address of the external SupplyLogic -+ */ -+ function getSupplyLogic() external view returns (address); - } - --// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/core/contracts/protocol/libraries/configuration/ReserveConfiguration.sol -+// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/protocol/libraries/configuration/ReserveConfiguration.sol - - /** - * @title ReserveConfiguration library -@@ -1748,25 +1950,26 @@ interface IPool { - * @notice Implements the bitmap logic to handle the reserve configuration - */ - library ReserveConfiguration { -- uint256 internal constant LTV_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000; // prettier-ignore -- uint256 internal constant LIQUIDATION_THRESHOLD_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF; // prettier-ignore -- uint256 internal constant LIQUIDATION_BONUS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFF; // prettier-ignore -- uint256 internal constant DECIMALS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant ACTIVE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant FROZEN_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant STABLE_BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant PAUSED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROWABLE_IN_ISOLATION_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant SILOED_BORROWING_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant FLASHLOAN_ENABLED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant RESERVE_FACTOR_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant BORROW_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant SUPPLY_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant LIQUIDATION_PROTOCOL_FEE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant EMODE_CATEGORY_MASK = 0xFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant UNBACKED_MINT_CAP_MASK = 0xFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -- uint256 internal constant DEBT_CEILING_MASK = 0xF0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // prettier-ignore -+ uint256 internal constant LTV_MASK = 0x000000000000000000000000000000000000000000000000000000000000FFFF; // prettier-ignore -+ uint256 internal constant LIQUIDATION_THRESHOLD_MASK = 0x00000000000000000000000000000000000000000000000000000000FFFF0000; // prettier-ignore -+ uint256 internal constant LIQUIDATION_BONUS_MASK = 0x0000000000000000000000000000000000000000000000000000FFFF00000000; // prettier-ignore -+ uint256 internal constant DECIMALS_MASK = 0x00000000000000000000000000000000000000000000000000FF000000000000; // prettier-ignore -+ uint256 internal constant ACTIVE_MASK = 0x0000000000000000000000000000000000000000000000000100000000000000; // prettier-ignore -+ uint256 internal constant FROZEN_MASK = 0x0000000000000000000000000000000000000000000000000200000000000000; // prettier-ignore -+ uint256 internal constant BORROWING_MASK = 0x0000000000000000000000000000000000000000000000000400000000000000; // prettier-ignore -+ // @notice there is an unoccupied hole of 1 bit at position 59 from pre 3.2 stableBorrowRateEnabled -+ uint256 internal constant PAUSED_MASK = 0x0000000000000000000000000000000000000000000000001000000000000000; // prettier-ignore -+ uint256 internal constant BORROWABLE_IN_ISOLATION_MASK = 0x0000000000000000000000000000000000000000000000002000000000000000; // prettier-ignore -+ uint256 internal constant SILOED_BORROWING_MASK = 0x0000000000000000000000000000000000000000000000004000000000000000; // prettier-ignore -+ uint256 internal constant FLASHLOAN_ENABLED_MASK = 0x0000000000000000000000000000000000000000000000008000000000000000; // prettier-ignore -+ uint256 internal constant RESERVE_FACTOR_MASK = 0x00000000000000000000000000000000000000000000FFFF0000000000000000; // prettier-ignore -+ uint256 internal constant BORROW_CAP_MASK = 0x00000000000000000000000000000000000FFFFFFFFF00000000000000000000; // prettier-ignore -+ uint256 internal constant SUPPLY_CAP_MASK = 0x00000000000000000000000000FFFFFFFFF00000000000000000000000000000; // prettier-ignore -+ uint256 internal constant LIQUIDATION_PROTOCOL_FEE_MASK = 0x0000000000000000000000FFFF00000000000000000000000000000000000000; // prettier-ignore -+ //@notice there is an unoccupied hole of 8 bits from 168 to 176 left from pre 3.2 eModeCategory -+ uint256 internal constant UNBACKED_MINT_CAP_MASK = 0x00000000000FFFFFFFFF00000000000000000000000000000000000000000000; // prettier-ignore -+ uint256 internal constant DEBT_CEILING_MASK = 0x0FFFFFFFFFF00000000000000000000000000000000000000000000000000000; // prettier-ignore -+ uint256 internal constant VIRTUAL_ACC_ACTIVE_MASK = 0x1000000000000000000000000000000000000000000000000000000000000000; // prettier-ignore - - /// @dev For the LTV, the start bit is 0 (up to 15), hence no bitshifting is needed - uint256 internal constant LIQUIDATION_THRESHOLD_START_BIT_POSITION = 16; -@@ -1775,7 +1978,6 @@ library ReserveConfiguration { - uint256 internal constant IS_ACTIVE_START_BIT_POSITION = 56; - uint256 internal constant IS_FROZEN_START_BIT_POSITION = 57; - uint256 internal constant BORROWING_ENABLED_START_BIT_POSITION = 58; -- uint256 internal constant STABLE_BORROWING_ENABLED_START_BIT_POSITION = 59; - uint256 internal constant IS_PAUSED_START_BIT_POSITION = 60; - uint256 internal constant BORROWABLE_IN_ISOLATION_START_BIT_POSITION = 61; - uint256 internal constant SILOED_BORROWING_START_BIT_POSITION = 62; -@@ -1784,9 +1986,10 @@ library ReserveConfiguration { - uint256 internal constant BORROW_CAP_START_BIT_POSITION = 80; - uint256 internal constant SUPPLY_CAP_START_BIT_POSITION = 116; - uint256 internal constant LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION = 152; -- uint256 internal constant EMODE_CATEGORY_START_BIT_POSITION = 168; -+ //@notice there is an unoccupied hole of 8 bits from 168 to 176 left from pre 3.2 eModeCategory - uint256 internal constant UNBACKED_MINT_CAP_START_BIT_POSITION = 176; - uint256 internal constant DEBT_CEILING_START_BIT_POSITION = 212; -+ uint256 internal constant VIRTUAL_ACC_START_BIT_POSITION = 252; - - uint256 internal constant MAX_VALID_LTV = 65535; - uint256 internal constant MAX_VALID_LIQUIDATION_THRESHOLD = 65535; -@@ -1796,7 +1999,6 @@ library ReserveConfiguration { - uint256 internal constant MAX_VALID_BORROW_CAP = 68719476735; - uint256 internal constant MAX_VALID_SUPPLY_CAP = 68719476735; - uint256 internal constant MAX_VALID_LIQUIDATION_PROTOCOL_FEE = 65535; -- uint256 internal constant MAX_VALID_EMODE_CATEGORY = 255; - uint256 internal constant MAX_VALID_UNBACKED_MINT_CAP = 68719476735; - uint256 internal constant MAX_VALID_DEBT_CEILING = 1099511627775; - -@@ -1811,7 +2013,7 @@ library ReserveConfiguration { - function setLtv(DataTypes.ReserveConfigurationMap memory self, uint256 ltv) internal pure { - require(ltv <= MAX_VALID_LTV, Errors.INVALID_LTV); - -- self.data = (self.data & LTV_MASK) | ltv; -+ self.data = (self.data & ~LTV_MASK) | ltv; - } - - /** -@@ -1820,7 +2022,7 @@ library ReserveConfiguration { - * @return The loan to value - */ - function getLtv(DataTypes.ReserveConfigurationMap memory self) internal pure returns (uint256) { -- return self.data & ~LTV_MASK; -+ return self.data & LTV_MASK; - } - - /** -@@ -1835,7 +2037,7 @@ library ReserveConfiguration { - require(threshold <= MAX_VALID_LIQUIDATION_THRESHOLD, Errors.INVALID_LIQ_THRESHOLD); - - self.data = -- (self.data & LIQUIDATION_THRESHOLD_MASK) | -+ (self.data & ~LIQUIDATION_THRESHOLD_MASK) | - (threshold << LIQUIDATION_THRESHOLD_START_BIT_POSITION); - } - -@@ -1847,7 +2049,7 @@ library ReserveConfiguration { - function getLiquidationThreshold( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION; -+ return (self.data & LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION; - } - - /** -@@ -1862,7 +2064,7 @@ library ReserveConfiguration { - require(bonus <= MAX_VALID_LIQUIDATION_BONUS, Errors.INVALID_LIQ_BONUS); - - self.data = -- (self.data & LIQUIDATION_BONUS_MASK) | -+ (self.data & ~LIQUIDATION_BONUS_MASK) | - (bonus << LIQUIDATION_BONUS_START_BIT_POSITION); - } - -@@ -1874,7 +2076,7 @@ library ReserveConfiguration { - function getLiquidationBonus( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION; -+ return (self.data & LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION; - } - - /** -@@ -1888,7 +2090,7 @@ library ReserveConfiguration { - ) internal pure { - require(decimals <= MAX_VALID_DECIMALS, Errors.INVALID_DECIMALS); - -- self.data = (self.data & DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION); -+ self.data = (self.data & ~DECIMALS_MASK) | (decimals << RESERVE_DECIMALS_START_BIT_POSITION); - } - - /** -@@ -1899,7 +2101,7 @@ library ReserveConfiguration { - function getDecimals( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION; -+ return (self.data & DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION; - } - - /** -@@ -1909,7 +2111,7 @@ library ReserveConfiguration { - */ - function setActive(DataTypes.ReserveConfigurationMap memory self, bool active) internal pure { - self.data = -- (self.data & ACTIVE_MASK) | -+ (self.data & ~ACTIVE_MASK) | - (uint256(active ? 1 : 0) << IS_ACTIVE_START_BIT_POSITION); - } - -@@ -1919,7 +2121,7 @@ library ReserveConfiguration { - * @return The active state - */ - function getActive(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~ACTIVE_MASK) != 0; -+ return (self.data & ACTIVE_MASK) != 0; - } - - /** -@@ -1929,7 +2131,7 @@ library ReserveConfiguration { - */ - function setFrozen(DataTypes.ReserveConfigurationMap memory self, bool frozen) internal pure { - self.data = -- (self.data & FROZEN_MASK) | -+ (self.data & ~FROZEN_MASK) | - (uint256(frozen ? 1 : 0) << IS_FROZEN_START_BIT_POSITION); - } - -@@ -1939,7 +2141,7 @@ library ReserveConfiguration { - * @return The frozen state - */ - function getFrozen(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~FROZEN_MASK) != 0; -+ return (self.data & FROZEN_MASK) != 0; - } - - /** -@@ -1949,7 +2151,7 @@ library ReserveConfiguration { - */ - function setPaused(DataTypes.ReserveConfigurationMap memory self, bool paused) internal pure { - self.data = -- (self.data & PAUSED_MASK) | -+ (self.data & ~PAUSED_MASK) | - (uint256(paused ? 1 : 0) << IS_PAUSED_START_BIT_POSITION); - } - -@@ -1959,7 +2161,7 @@ library ReserveConfiguration { - * @return The paused state - */ - function getPaused(DataTypes.ReserveConfigurationMap memory self) internal pure returns (bool) { -- return (self.data & ~PAUSED_MASK) != 0; -+ return (self.data & PAUSED_MASK) != 0; - } - - /** -@@ -1976,7 +2178,7 @@ library ReserveConfiguration { - bool borrowable - ) internal pure { - self.data = -- (self.data & BORROWABLE_IN_ISOLATION_MASK) | -+ (self.data & ~BORROWABLE_IN_ISOLATION_MASK) | - (uint256(borrowable ? 1 : 0) << BORROWABLE_IN_ISOLATION_START_BIT_POSITION); - } - -@@ -1992,7 +2194,7 @@ library ReserveConfiguration { - function getBorrowableInIsolation( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~BORROWABLE_IN_ISOLATION_MASK) != 0; -+ return (self.data & BORROWABLE_IN_ISOLATION_MASK) != 0; - } - - /** -@@ -2006,7 +2208,7 @@ library ReserveConfiguration { - bool siloed - ) internal pure { - self.data = -- (self.data & SILOED_BORROWING_MASK) | -+ (self.data & ~SILOED_BORROWING_MASK) | - (uint256(siloed ? 1 : 0) << SILOED_BORROWING_START_BIT_POSITION); - } - -@@ -2019,7 +2221,7 @@ library ReserveConfiguration { - function getSiloedBorrowing( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~SILOED_BORROWING_MASK) != 0; -+ return (self.data & SILOED_BORROWING_MASK) != 0; - } - - /** -@@ -2032,7 +2234,7 @@ library ReserveConfiguration { - bool enabled - ) internal pure { - self.data = -- (self.data & BORROWING_MASK) | -+ (self.data & ~BORROWING_MASK) | - (uint256(enabled ? 1 : 0) << BORROWING_ENABLED_START_BIT_POSITION); - } - -@@ -2044,32 +2246,7 @@ library ReserveConfiguration { - function getBorrowingEnabled( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~BORROWING_MASK) != 0; -- } -- -- /** -- * @notice Enables or disables stable rate borrowing on the reserve -- * @param self The reserve configuration -- * @param enabled True if the stable rate borrowing needs to be enabled, false otherwise -- */ -- function setStableRateBorrowingEnabled( -- DataTypes.ReserveConfigurationMap memory self, -- bool enabled -- ) internal pure { -- self.data = -- (self.data & STABLE_BORROWING_MASK) | -- (uint256(enabled ? 1 : 0) << STABLE_BORROWING_ENABLED_START_BIT_POSITION); -- } -- -- /** -- * @notice Gets the stable rate borrowing state of the reserve -- * @param self The reserve configuration -- * @return The stable rate borrowing state -- */ -- function getStableRateBorrowingEnabled( -- DataTypes.ReserveConfigurationMap memory self -- ) internal pure returns (bool) { -- return (self.data & ~STABLE_BORROWING_MASK) != 0; -+ return (self.data & BORROWING_MASK) != 0; - } - - /** -@@ -2084,7 +2261,7 @@ library ReserveConfiguration { - require(reserveFactor <= MAX_VALID_RESERVE_FACTOR, Errors.INVALID_RESERVE_FACTOR); - - self.data = -- (self.data & RESERVE_FACTOR_MASK) | -+ (self.data & ~RESERVE_FACTOR_MASK) | - (reserveFactor << RESERVE_FACTOR_START_BIT_POSITION); - } - -@@ -2096,7 +2273,7 @@ library ReserveConfiguration { - function getReserveFactor( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION; -+ return (self.data & RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION; - } - - /** -@@ -2110,7 +2287,7 @@ library ReserveConfiguration { - ) internal pure { - require(borrowCap <= MAX_VALID_BORROW_CAP, Errors.INVALID_BORROW_CAP); - -- self.data = (self.data & BORROW_CAP_MASK) | (borrowCap << BORROW_CAP_START_BIT_POSITION); -+ self.data = (self.data & ~BORROW_CAP_MASK) | (borrowCap << BORROW_CAP_START_BIT_POSITION); - } - - /** -@@ -2121,7 +2298,7 @@ library ReserveConfiguration { - function getBorrowCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION; -+ return (self.data & BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION; - } - - /** -@@ -2135,7 +2312,7 @@ library ReserveConfiguration { - ) internal pure { - require(supplyCap <= MAX_VALID_SUPPLY_CAP, Errors.INVALID_SUPPLY_CAP); - -- self.data = (self.data & SUPPLY_CAP_MASK) | (supplyCap << SUPPLY_CAP_START_BIT_POSITION); -+ self.data = (self.data & ~SUPPLY_CAP_MASK) | (supplyCap << SUPPLY_CAP_START_BIT_POSITION); - } - - /** -@@ -2146,7 +2323,7 @@ library ReserveConfiguration { - function getSupplyCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION; -+ return (self.data & SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION; - } - - /** -@@ -2160,7 +2337,7 @@ library ReserveConfiguration { - ) internal pure { - require(ceiling <= MAX_VALID_DEBT_CEILING, Errors.INVALID_DEBT_CEILING); - -- self.data = (self.data & DEBT_CEILING_MASK) | (ceiling << DEBT_CEILING_START_BIT_POSITION); -+ self.data = (self.data & ~DEBT_CEILING_MASK) | (ceiling << DEBT_CEILING_START_BIT_POSITION); - } - - /** -@@ -2171,7 +2348,7 @@ library ReserveConfiguration { - function getDebtCeiling( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~DEBT_CEILING_MASK) >> DEBT_CEILING_START_BIT_POSITION; -+ return (self.data & DEBT_CEILING_MASK) >> DEBT_CEILING_START_BIT_POSITION; - } - - /** -@@ -2189,7 +2366,7 @@ library ReserveConfiguration { - ); - - self.data = -- (self.data & LIQUIDATION_PROTOCOL_FEE_MASK) | -+ (self.data & ~LIQUIDATION_PROTOCOL_FEE_MASK) | - (liquidationProtocolFee << LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION); - } - -@@ -2202,7 +2379,7 @@ library ReserveConfiguration { - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { - return -- (self.data & ~LIQUIDATION_PROTOCOL_FEE_MASK) >> LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION; -+ (self.data & LIQUIDATION_PROTOCOL_FEE_MASK) >> LIQUIDATION_PROTOCOL_FEE_START_BIT_POSITION; - } - - /** -@@ -2217,7 +2394,7 @@ library ReserveConfiguration { - require(unbackedMintCap <= MAX_VALID_UNBACKED_MINT_CAP, Errors.INVALID_UNBACKED_MINT_CAP); - - self.data = -- (self.data & UNBACKED_MINT_CAP_MASK) | -+ (self.data & ~UNBACKED_MINT_CAP_MASK) | - (unbackedMintCap << UNBACKED_MINT_CAP_START_BIT_POSITION); - } - -@@ -2229,57 +2406,62 @@ library ReserveConfiguration { - function getUnbackedMintCap( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (uint256) { -- return (self.data & ~UNBACKED_MINT_CAP_MASK) >> UNBACKED_MINT_CAP_START_BIT_POSITION; -+ return (self.data & UNBACKED_MINT_CAP_MASK) >> UNBACKED_MINT_CAP_START_BIT_POSITION; - } - - /** -- * @notice Sets the eMode asset category -+ * @notice Sets the flashloanable flag for the reserve - * @param self The reserve configuration -- * @param category The asset category when the user selects the eMode -+ * @param flashLoanEnabled True if the asset is flashloanable, false otherwise - */ -- function setEModeCategory( -+ function setFlashLoanEnabled( - DataTypes.ReserveConfigurationMap memory self, -- uint256 category -+ bool flashLoanEnabled - ) internal pure { -- require(category <= MAX_VALID_EMODE_CATEGORY, Errors.INVALID_EMODE_CATEGORY); -- -- self.data = (self.data & EMODE_CATEGORY_MASK) | (category << EMODE_CATEGORY_START_BIT_POSITION); -+ self.data = -+ (self.data & ~FLASHLOAN_ENABLED_MASK) | -+ (uint256(flashLoanEnabled ? 1 : 0) << FLASHLOAN_ENABLED_START_BIT_POSITION); - } - - /** -- * @dev Gets the eMode asset category -+ * @notice Gets the flashloanable flag for the reserve - * @param self The reserve configuration -- * @return The eMode category for the asset -+ * @return The flashloanable flag - */ -- function getEModeCategory( -+ function getFlashLoanEnabled( - DataTypes.ReserveConfigurationMap memory self -- ) internal pure returns (uint256) { -- return (self.data & ~EMODE_CATEGORY_MASK) >> EMODE_CATEGORY_START_BIT_POSITION; -+ ) internal pure returns (bool) { -+ return (self.data & FLASHLOAN_ENABLED_MASK) != 0; - } - - /** -- * @notice Sets the flashloanable flag for the reserve -+ * @notice Sets the virtual account active/not state of the reserve - * @param self The reserve configuration -- * @param flashLoanEnabled True if the asset is flashloanable, false otherwise -+ * @param active The active state - */ -- function setFlashLoanEnabled( -+ function setVirtualAccActive( - DataTypes.ReserveConfigurationMap memory self, -- bool flashLoanEnabled -+ bool active - ) internal pure { - self.data = -- (self.data & FLASHLOAN_ENABLED_MASK) | -- (uint256(flashLoanEnabled ? 1 : 0) << FLASHLOAN_ENABLED_START_BIT_POSITION); -+ (self.data & ~VIRTUAL_ACC_ACTIVE_MASK) | -+ (uint256(active ? 1 : 0) << VIRTUAL_ACC_START_BIT_POSITION); - } - - /** -- * @notice Gets the flashloanable flag for the reserve -+ * @notice Gets the virtual account active/not state of the reserve -+ * @dev The state should be true for all normal assets and should be false -+ * Virtual accounting being disabled means that the asset: -+ * - is GHO -+ * - can never be supplied -+ * - the interest rate strategy is not influenced by the virtual balance - * @param self The reserve configuration -- * @return The flashloanable flag -+ * @return The active state - */ -- function getFlashLoanEnabled( -+ function getIsVirtualAccActive( - DataTypes.ReserveConfigurationMap memory self - ) internal pure returns (bool) { -- return (self.data & ~FLASHLOAN_ENABLED_MASK) != 0; -+ return (self.data & VIRTUAL_ACC_ACTIVE_MASK) != 0; - } - - /** -@@ -2288,20 +2470,18 @@ library ReserveConfiguration { - * @return The state flag representing active - * @return The state flag representing frozen - * @return The state flag representing borrowing enabled -- * @return The state flag representing stableRateBorrowing enabled - * @return The state flag representing paused - */ - function getFlags( - DataTypes.ReserveConfigurationMap memory self -- ) internal pure returns (bool, bool, bool, bool, bool) { -+ ) internal pure returns (bool, bool, bool, bool) { - uint256 dataLocal = self.data; - - return ( -- (dataLocal & ~ACTIVE_MASK) != 0, -- (dataLocal & ~FROZEN_MASK) != 0, -- (dataLocal & ~BORROWING_MASK) != 0, -- (dataLocal & ~STABLE_BORROWING_MASK) != 0, -- (dataLocal & ~PAUSED_MASK) != 0 -+ (dataLocal & ACTIVE_MASK) != 0, -+ (dataLocal & FROZEN_MASK) != 0, -+ (dataLocal & BORROWING_MASK) != 0, -+ (dataLocal & PAUSED_MASK) != 0 - ); - } - -@@ -2313,20 +2493,18 @@ library ReserveConfiguration { - * @return The state param representing liquidation bonus - * @return The state param representing reserve decimals - * @return The state param representing reserve factor -- * @return The state param representing eMode category - */ - function getParams( - DataTypes.ReserveConfigurationMap memory self -- ) internal pure returns (uint256, uint256, uint256, uint256, uint256, uint256) { -+ ) internal pure returns (uint256, uint256, uint256, uint256, uint256) { - uint256 dataLocal = self.data; - - return ( -- dataLocal & ~LTV_MASK, -- (dataLocal & ~LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION, -- (dataLocal & ~LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION, -- (dataLocal & ~DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION, -- (dataLocal & ~RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION, -- (dataLocal & ~EMODE_CATEGORY_MASK) >> EMODE_CATEGORY_START_BIT_POSITION -+ dataLocal & LTV_MASK, -+ (dataLocal & LIQUIDATION_THRESHOLD_MASK) >> LIQUIDATION_THRESHOLD_START_BIT_POSITION, -+ (dataLocal & LIQUIDATION_BONUS_MASK) >> LIQUIDATION_BONUS_START_BIT_POSITION, -+ (dataLocal & DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION, -+ (dataLocal & RESERVE_FACTOR_MASK) >> RESERVE_FACTOR_START_BIT_POSITION - ); - } - -@@ -2342,13 +2520,13 @@ library ReserveConfiguration { - uint256 dataLocal = self.data; - - return ( -- (dataLocal & ~BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION, -- (dataLocal & ~SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION -+ (dataLocal & BORROW_CAP_MASK) >> BORROW_CAP_START_BIT_POSITION, -+ (dataLocal & SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION - ); - } - } - + -// downloads/GNOSIS/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/periphery/contracts/misc/WalletBalanceProvider.sol +// downloads/CELO/WALLET_BALANCE_PROVIDER/WalletBalanceProvider/src/contracts/helpers/WalletBalanceProvider.sol - + /** * @title WalletBalanceProvider contract @@ -2433,7 +2611,7 @@ contract WalletBalanceProvider { reservesWithEth[j] ); - + - (bool isActive, , , , ) = configuration.getFlags(); + (bool isActive, , , ) = configuration.getFlags(); - + if (!isActive) { balances[j] = 0; ```