From f126131f335c340d0656d6e879a5c428eea2b780 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Wed, 25 Oct 2023 20:57:03 +0530 Subject: [PATCH] chore: change emodeId to uint8 (#274) --- scripts/generator/protocolV3Generator.ts | 2 +- scripts/generator/utils.ts | 2 +- src/AaveV3Arbitrum.sol | 6 +++--- src/AaveV3ArbitrumGoerli.sol | 4 ++-- src/AaveV3Avalanche.sol | 6 +++--- src/AaveV3Base.sol | 4 ++-- src/AaveV3Ethereum.sol | 4 ++-- src/AaveV3Fantom.sol | 4 ++-- src/AaveV3FantomTestnet.sol | 4 ++-- src/AaveV3Fuji.sol | 4 ++-- src/AaveV3GoerliGho.sol | 4 ++-- src/AaveV3Harmony.sol | 4 ++-- src/AaveV3Metis.sol | 2 +- src/AaveV3Mumbai.sol | 4 ++-- src/AaveV3Optimism.sol | 6 +++--- src/AaveV3OptimismGoerli.sol | 4 ++-- src/AaveV3Polygon.sol | 8 ++++---- src/AaveV3ScrollAlpha.sol | 4 ++-- src/AaveV3ScrollSepolia.sol | 4 ++-- src/AaveV3Sepolia.sol | 4 ++-- 20 files changed, 42 insertions(+), 42 deletions(-) diff --git a/scripts/generator/protocolV3Generator.ts b/scripts/generator/protocolV3Generator.ts index 84116590..0e5d8717 100644 --- a/scripts/generator/protocolV3Generator.ts +++ b/scripts/generator/protocolV3Generator.ts @@ -236,7 +236,7 @@ function generateEmodes(chainId: ChainId, eModes: Map, libraryNa const formatted = sorted.reduce((acc, [value, label]) => { acc[`${label ? label.toUpperCase().replace('-', '_').replace(' ', '_') : 'NONE'}`] = { value, - type: 'uint256', + type: 'uint8', }; return acc; }, {} as Addresses); diff --git a/scripts/generator/utils.ts b/scripts/generator/utils.ts index c6c6d7f1..b018377d 100644 --- a/scripts/generator/utils.ts +++ b/scripts/generator/utils.ts @@ -31,7 +31,7 @@ export function addressInfoToSolidityLibraryConstant( entry: AddressInfo, ) { if (typeof entry === 'object') { - if (entry.type === 'uint256') { + if (entry.type === 'uint256' || entry.type === 'uint8') { return `${entry.type} internal constant ${key} = ${entry.value};\n`; } const blockExplorerLinkComment = getExplorerLink(entry.chainId || chainId, entry.value); diff --git a/src/AaveV3Arbitrum.sol b/src/AaveV3Arbitrum.sol index eb5f9664..35213949 100644 --- a/src/AaveV3Arbitrum.sol +++ b/src/AaveV3Arbitrum.sol @@ -415,9 +415,9 @@ library AaveV3ArbitrumAssets { } library AaveV3ArbitrumEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; - uint256 internal constant ETH_CORRELATED = 2; + uint8 internal constant ETH_CORRELATED = 2; } diff --git a/src/AaveV3ArbitrumGoerli.sol b/src/AaveV3ArbitrumGoerli.sol index c9117d89..b2a1e63a 100644 --- a/src/AaveV3ArbitrumGoerli.sol +++ b/src/AaveV3ArbitrumGoerli.sol @@ -244,7 +244,7 @@ library AaveV3ArbitrumGoerliAssets { } library AaveV3ArbitrumGoerliEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3Avalanche.sol b/src/AaveV3Avalanche.sol index 78aed2f9..3b91fb3f 100644 --- a/src/AaveV3Avalanche.sol +++ b/src/AaveV3Avalanche.sol @@ -358,9 +358,9 @@ library AaveV3AvalancheAssets { } library AaveV3AvalancheEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; - uint256 internal constant AVAX_CORRELATED = 2; + uint8 internal constant AVAX_CORRELATED = 2; } diff --git a/src/AaveV3Base.sol b/src/AaveV3Base.sol index d147474a..88ea66e4 100644 --- a/src/AaveV3Base.sol +++ b/src/AaveV3Base.sol @@ -163,7 +163,7 @@ library AaveV3BaseAssets { } library AaveV3BaseEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant ETH_CORRELATED = 1; + uint8 internal constant ETH_CORRELATED = 1; } diff --git a/src/AaveV3Ethereum.sol b/src/AaveV3Ethereum.sol index d75859bd..c0331088 100644 --- a/src/AaveV3Ethereum.sol +++ b/src/AaveV3Ethereum.sol @@ -623,7 +623,7 @@ library AaveV3EthereumAssets { } library AaveV3EthereumEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant ETH_CORRELATED = 1; + uint8 internal constant ETH_CORRELATED = 1; } diff --git a/src/AaveV3Fantom.sol b/src/AaveV3Fantom.sol index ee5efde1..8391f9e8 100644 --- a/src/AaveV3Fantom.sol +++ b/src/AaveV3Fantom.sol @@ -288,7 +288,7 @@ library AaveV3FantomAssets { } library AaveV3FantomEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3FantomTestnet.sol b/src/AaveV3FantomTestnet.sol index 3e0e2af6..c279c1be 100644 --- a/src/AaveV3FantomTestnet.sol +++ b/src/AaveV3FantomTestnet.sol @@ -282,7 +282,7 @@ library AaveV3FantomTestnetAssets { } library AaveV3FantomTestnetEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3Fuji.sol b/src/AaveV3Fuji.sol index 3b14841c..9958eb65 100644 --- a/src/AaveV3Fuji.sol +++ b/src/AaveV3Fuji.sol @@ -241,7 +241,7 @@ library AaveV3FujiAssets { } library AaveV3FujiEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3GoerliGho.sol b/src/AaveV3GoerliGho.sol index 0abeb668..5ea0530a 100644 --- a/src/AaveV3GoerliGho.sol +++ b/src/AaveV3GoerliGho.sol @@ -198,7 +198,7 @@ library AaveV3GoerliGhoAssets { } library AaveV3GoerliGhoEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLE_EMODE = 1; + uint8 internal constant STABLE_EMODE = 1; } diff --git a/src/AaveV3Harmony.sol b/src/AaveV3Harmony.sol index a7b8cd0e..48b8371c 100644 --- a/src/AaveV3Harmony.sol +++ b/src/AaveV3Harmony.sol @@ -243,7 +243,7 @@ library AaveV3HarmonyAssets { } library AaveV3HarmonyEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3Metis.sol b/src/AaveV3Metis.sol index 3d0ba504..282d1435 100644 --- a/src/AaveV3Metis.sol +++ b/src/AaveV3Metis.sol @@ -189,5 +189,5 @@ library AaveV3MetisAssets { } library AaveV3MetisEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; } diff --git a/src/AaveV3Mumbai.sol b/src/AaveV3Mumbai.sol index cb305d3d..8e56aefb 100644 --- a/src/AaveV3Mumbai.sol +++ b/src/AaveV3Mumbai.sol @@ -406,7 +406,7 @@ library AaveV3MumbaiAssets { } library AaveV3MumbaiEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3Optimism.sol b/src/AaveV3Optimism.sol index 1c0e5f65..2c053d5d 100644 --- a/src/AaveV3Optimism.sol +++ b/src/AaveV3Optimism.sol @@ -373,9 +373,9 @@ library AaveV3OptimismAssets { } library AaveV3OptimismEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; - uint256 internal constant ETH_CORRELATED = 2; + uint8 internal constant ETH_CORRELATED = 2; } diff --git a/src/AaveV3OptimismGoerli.sol b/src/AaveV3OptimismGoerli.sol index ec118da6..218e2be7 100644 --- a/src/AaveV3OptimismGoerli.sol +++ b/src/AaveV3OptimismGoerli.sol @@ -244,7 +244,7 @@ library AaveV3OptimismGoerliAssets { } library AaveV3OptimismGoerliEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3Polygon.sol b/src/AaveV3Polygon.sol index 54aae783..acfce3f4 100644 --- a/src/AaveV3Polygon.sol +++ b/src/AaveV3Polygon.sol @@ -516,11 +516,11 @@ library AaveV3PolygonAssets { } library AaveV3PolygonEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; - uint256 internal constant MATIC_CORRELATED = 2; + uint8 internal constant MATIC_CORRELATED = 2; - uint256 internal constant ETH_CORRELATED = 3; + uint8 internal constant ETH_CORRELATED = 3; } diff --git a/src/AaveV3ScrollAlpha.sol b/src/AaveV3ScrollAlpha.sol index eec95ffb..2b49699c 100644 --- a/src/AaveV3ScrollAlpha.sol +++ b/src/AaveV3ScrollAlpha.sol @@ -244,7 +244,7 @@ library AaveV3ScrollAlphaAssets { } library AaveV3ScrollAlphaEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3ScrollSepolia.sol b/src/AaveV3ScrollSepolia.sol index c3c45c2d..9464588c 100644 --- a/src/AaveV3ScrollSepolia.sol +++ b/src/AaveV3ScrollSepolia.sol @@ -244,7 +244,7 @@ library AaveV3ScrollSepoliaAssets { } library AaveV3ScrollSepoliaEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; } diff --git a/src/AaveV3Sepolia.sol b/src/AaveV3Sepolia.sol index 155dc0b3..ccef0ea3 100644 --- a/src/AaveV3Sepolia.sol +++ b/src/AaveV3Sepolia.sol @@ -241,7 +241,7 @@ library AaveV3SepoliaAssets { } library AaveV3SepoliaEModes { - uint256 internal constant NONE = 0; + uint8 internal constant NONE = 0; - uint256 internal constant STABLECOINS = 1; + uint8 internal constant STABLECOINS = 1; }