File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/contracts/extensions/v3-config-engine/libraries Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,13 @@ library EModeEngine {
103103 keccak256 (abi.encode (updates[i].label)) !=
104104 keccak256 (abi.encode (EngineFlags.KEEP_CURRENT_STRING));
105105
106- if (notAllKeepCurrent && atLeastOneKeepCurrent) {
107- DataTypes.CollateralConfig memory cfg = pool.getEModeCategoryCollateralConfig (
108- updates[i].eModeCategory
109- );
106+ DataTypes.CollateralConfig memory cfg = pool.getEModeCategoryCollateralConfig (
107+ updates[i].eModeCategory
108+ );
109+ // should only be able to update existing eModes, not create new ones
110+ require (cfg.liquidationThreshold != 0 , 'INVALID_UPDATE ' );
110111
112+ if (notAllKeepCurrent && atLeastOneKeepCurrent) {
111113 if (updates[i].ltv == EngineFlags.KEEP_CURRENT) {
112114 updates[i].ltv = cfg.ltv;
113115 }
You can’t perform that action at this time.
0 commit comments