Skip to content

Commit

Permalink
fix: v2 v3 engine rates import generator
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlymite committed Oct 25, 2023
1 parent 60aa9c8 commit 11ef02c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions generator/features/rateUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const rateUpdatesV2: FeatureModule<RateStrategyUpdate[]> = {
.map(
(cfg, ix) => `rateStrategies[${ix}] = IAaveV2ConfigEngine.RateStrategyUpdate({
asset: ${cfg.asset},
params: Rates.RateStrategyParams({
params: IV2RateStrategyFactory.RateStrategyParams({
optimalUtilizationRate: ${cfg.params.optimalUtilizationRate},
baseVariableBorrowRate: ${cfg.params.baseVariableBorrowRate},
variableRateSlope1: ${cfg.params.variableRateSlope1},
Expand Down Expand Up @@ -149,7 +149,7 @@ export const rateUpdatesV3: FeatureModule<RateStrategyUpdate[]> = {
.map(
(cfg, ix) => `rateStrategies[${ix}] = IAaveV3ConfigEngine.RateStrategyUpdate({
asset: ${cfg.asset},
params: Rates.RateStrategyParams({
params: IV3RateStrategyFactory.RateStrategyParams({
optimalUsageRatio: ${cfg.params.optimalUtilizationRate},
baseVariableBorrowRate: ${cfg.params.baseVariableBorrowRate},
variableRateSlope1: ${cfg.params.variableRateSlope1},
Expand Down
4 changes: 2 additions & 2 deletions generator/utils/importsResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export function prefixWithImports(code: string) {
if (findMatch(code, 'IAaveV3ConfigEngine')) {
imports += `import {IAaveV3ConfigEngine} from 'aave-helpers/v3-config-engine/IAaveV3ConfigEngine.sol';\n`;
}
if (findMatch(code, 'Rates')) {
imports += `import {IV3RateStrategyFactory as Rates} from 'aave-helpers/v3-config-engine/IV3RateStrategyFactory.sol';\n`;
if (findMatch(code, 'IV3RateStrategyFactory')) {
imports += `import {IV3RateStrategyFactory} from 'aave-helpers/v3-config-engine/IV3RateStrategyFactory.sol';\n`;
}
// v2 config engine imports
if (findMatch(code, 'IAaveV2ConfigEngine')) {
Expand Down

0 comments on commit 11ef02c

Please sign in to comment.