From 8956443b27747d8020d58b122b5d2803f26d94aa Mon Sep 17 00:00:00 2001 From: Mikael <26343374+0xmikko@users.noreply.github.com> Date: Thu, 18 Jul 2024 06:08:49 +0200 Subject: [PATCH] fix: contractType update --- contracts/compressors/PoolCompressor.sol | 3 ++- contracts/types/CreditFacadeState.sol | 2 +- contracts/types/CreditManagerState.sol | 2 +- contracts/types/InterestRateModelState.sol | 2 +- contracts/types/LossLiquidatorState.sol | 2 +- contracts/types/MarketData.sol | 1 + contracts/types/PoolQuotaKeeperState.sol | 1 + contracts/types/PoolState.sol | 2 +- contracts/types/PriceOracleState.sol | 1 + contracts/types/RateKeeperState.sol | 2 +- 10 files changed, 11 insertions(+), 7 deletions(-) diff --git a/contracts/compressors/PoolCompressor.sol b/contracts/compressors/PoolCompressor.sol index e4c246a..a7331b8 100644 --- a/contracts/compressors/PoolCompressor.sol +++ b/contracts/compressors/PoolCompressor.sol @@ -153,10 +153,11 @@ contract PoolCompressorV3 { result.version = _rateKeeper.version(); if (result.version == 3_00) { - result.rateKeeperType = uint16(RateKeeperType.Gauge); + result.contractType = "RK_GAUGE"; _pqk = IPoolQuotaKeeperV3(PoolV3(IGaugeV3(rateKeeper).pool()).poolQuotaKeeper()); result.serialisedData = GaugeSerializer(gaugeSerializer).serialize(rateKeeper); } else { + // TODO: add querying data for 3.1 // resuilt.rateKeeperType = uint16(_rateKeeper.rateKeeperType()); // _pqk = IPoolQuotaKeeperV3(IGaugeV3(rateKeeper).quotaKeeper()); } diff --git a/contracts/types/CreditFacadeState.sol b/contracts/types/CreditFacadeState.sol index a05d59a..956cfda 100644 --- a/contracts/types/CreditFacadeState.sol +++ b/contracts/types/CreditFacadeState.sol @@ -5,8 +5,8 @@ pragma solidity ^0.8.17; struct CreditFacadeState { address addr; - uint16 creditFacadeType; uint256 version; + bytes32 contractType; address creditManager; address creditConfigurator; uint256 minDebt; diff --git a/contracts/types/CreditManagerState.sol b/contracts/types/CreditManagerState.sol index 01273c2..54c64bd 100644 --- a/contracts/types/CreditManagerState.sol +++ b/contracts/types/CreditManagerState.sol @@ -5,8 +5,8 @@ pragma solidity ^0.8.17; struct CreditManagerState { address addr; - uint16 creditManagerType; uint256 version; + bytes32 contractType; string name; address creditFacade; // V2 only: address of creditFacade address creditConfigurator; // V2 only: address of creditConfigurator diff --git a/contracts/types/InterestRateModelState.sol b/contracts/types/InterestRateModelState.sol index 5815716..878fdf8 100644 --- a/contracts/types/InterestRateModelState.sol +++ b/contracts/types/InterestRateModelState.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.17; struct InterestRateModelState { address addr; - uint16 modelType; uint256 version; + bytes32 contractType; bytes serializedParams; } diff --git a/contracts/types/LossLiquidatorState.sol b/contracts/types/LossLiquidatorState.sol index f6fa634..245ca5e 100644 --- a/contracts/types/LossLiquidatorState.sol +++ b/contracts/types/LossLiquidatorState.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.17; struct LossLiquidatorState { address addr; - uint16 lossLiquidatorType; uint256 version; + bytes32 contractType; bytes serialisedData; } diff --git a/contracts/types/MarketData.sol b/contracts/types/MarketData.sol index 61b0d37..6129db8 100644 --- a/contracts/types/MarketData.sol +++ b/contracts/types/MarketData.sol @@ -25,6 +25,7 @@ struct MarketData { address[] emergencyLiquidators; } // LossLiquidatorPolicy +// ControllerTimelock (?) struct TokenBalance { address token; diff --git a/contracts/types/PoolQuotaKeeperState.sol b/contracts/types/PoolQuotaKeeperState.sol index 2ad88dc..9882329 100644 --- a/contracts/types/PoolQuotaKeeperState.sol +++ b/contracts/types/PoolQuotaKeeperState.sol @@ -6,6 +6,7 @@ pragma solidity ^0.8.17; struct PoolQuotaKeeperState { address addr; uint256 version; + bytes32 contractType; address rateKeeper; QuotaTokenParams[] quotas; address[] creditManagers; diff --git a/contracts/types/PoolState.sol b/contracts/types/PoolState.sol index 6b46a9e..cd191bd 100644 --- a/contracts/types/PoolState.sol +++ b/contracts/types/PoolState.sol @@ -6,8 +6,8 @@ pragma solidity ^0.8.17; struct PoolState { // contract properties address addr; - uint16 poolType; uint256 version; + bytes32 contractType; // // ERC20 Properties string symbol; diff --git a/contracts/types/PriceOracleState.sol b/contracts/types/PriceOracleState.sol index 299de1c..f803159 100644 --- a/contracts/types/PriceOracleState.sol +++ b/contracts/types/PriceOracleState.sol @@ -6,6 +6,7 @@ pragma solidity ^0.8.17; struct PriceOracleState { address addr; uint256 version; + bytes32 contractType; PriceFeedMapEntry priceFeedMapping; PriceFeedTreeNode priceFeedStructure; } diff --git a/contracts/types/RateKeeperState.sol b/contracts/types/RateKeeperState.sol index f58679f..d7e554e 100644 --- a/contracts/types/RateKeeperState.sol +++ b/contracts/types/RateKeeperState.sol @@ -5,8 +5,8 @@ pragma solidity ^0.8.17; struct RateKeeperState { address addr; - uint16 rateKeeperType; uint256 version; + bytes32 contractType; Rate[] rates; bytes serialisedData; }