Skip to content

Commit

Permalink
chore: change emodeId to uint8 (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlymite authored Oct 25, 2023
1 parent f5608ec commit f126131
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion scripts/generator/protocolV3Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function generateEmodes(chainId: ChainId, eModes: Map<number, string>, libraryNa
const formatted = sorted.reduce((acc, [value, label]) => {
acc[`${label ? label.toUpperCase().replace('-', '_').replace(' ', '_') : 'NONE'}`] = {
value,
type: 'uint256',
type: 'uint8',
};
return acc;
}, {} as Addresses);
Expand Down
2 changes: 1 addition & 1 deletion scripts/generator/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/AaveV3Arbitrum.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3ArbitrumGoerli.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 3 additions & 3 deletions src/AaveV3Avalanche.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3Base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3Ethereum.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3Fantom.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3FantomTestnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3Fuji.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3GoerliGho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3Harmony.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/AaveV3Metis.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ library AaveV3MetisAssets {
}

library AaveV3MetisEModes {
uint256 internal constant NONE = 0;
uint8 internal constant NONE = 0;
}
4 changes: 2 additions & 2 deletions src/AaveV3Mumbai.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 3 additions & 3 deletions src/AaveV3Optimism.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3OptimismGoerli.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
8 changes: 4 additions & 4 deletions src/AaveV3Polygon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3ScrollAlpha.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3ScrollSepolia.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/AaveV3Sepolia.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit f126131

Please sign in to comment.