@@ -20,24 +20,27 @@ abstract contract ConfiguredScript is Script {
2020
2121 struct Config {
2222 uint256 chainId;
23- address collateral;
23+
24+ address collateralToken;
2425 address loanToken;
2526 address yieldToken;
26- address marketOracle;
27- address marketIrm;
28- uint256 marketLltv;
29- uint24 feeYieldDebt;
30- uint24 feeAssetDebt;
27+
3128 uint256 healthFactorMin;
32- uint256 healthFactorMax;
3329 uint256 healthFactorMinTarget;
30+ uint256 healthFactorMax;
3431 uint256 healthFactorMaxTarget;
3532 uint256 yieldFactorMax;
36- address yieldOracle;
33+
3734 address swapFactory;
38- address yieldDebtPool;
39- address assetDebtPool;
40- uint256 recoveryDelay;
35+ address collateralLoanPool;
36+ uint24 collateralLoanPoolFee;
37+ address yieldLoanPool;
38+ uint24 yieldLoanPoolFee;
39+
40+ address marketOracle;
41+ address marketIrm;
42+ uint256 marketLltv;
43+ address yieldOracle;
4144 }
4245
4346 function _loadConfig () internal view returns (Config memory c ) {
@@ -51,33 +54,33 @@ abstract contract ConfiguredScript is Script {
5154 c.chainId == block .chainid , string .concat ("config chainId does not match RPC chain (network= " , network, ") " )
5255 );
5356
54- c.collateral = vm.parseTomlAddress (toml, ".collateral " );
57+ c.collateralToken = vm.parseTomlAddress (toml, ".collateralToken " );
5558 c.loanToken = vm.parseTomlAddress (toml, ".loanToken " );
5659 c.yieldToken = vm.parseTomlAddress (toml, ".yieldToken " );
57- c.marketOracle = vm.parseTomlAddress (toml, ".marketOracle " );
58- c.marketIrm = vm.parseTomlAddress (toml, ".marketIrm " );
59- c.marketLltv = vm.parseTomlUint (toml, ".marketLltv " );
60- c.feeYieldDebt = uint24 (vm.parseTomlUint (toml, ".feeYieldDebt " ));
61- c.feeAssetDebt = uint24 (vm.parseTomlUint (toml, ".feeAssetDebt " ));
60+
6261 c.healthFactorMin = vm.parseTomlUint (toml, ".healthFactorMin " );
6362 c.healthFactorMax = vm.parseTomlUint (toml, ".healthFactorMax " );
6463 c.healthFactorMinTarget = vm.parseTomlUint (toml, ".healthFactorMinTarget " );
6564 c.healthFactorMaxTarget = vm.parseTomlUint (toml, ".healthFactorMaxTarget " );
6665 c.yieldFactorMax = vm.parseTomlUint (toml, ".yieldFactorMax " );
67- c.yieldOracle = vm. parseTomlAddress (toml, " .yieldOracle " );
66+
6867 c.swapFactory = vm.parseTomlAddress (toml, ".swapFactory " );
69- c.yieldDebtPool = vm.parseTomlAddress (toml, ".yieldDebtPool " );
70- // Derived from the factory rather than a separate config field: the canonical
71- // collateral/loan pool at the asset/debt fee tier, which harvest's leg 2 routes
72- // through. Existence is asserted in `_requirePoolsExist`.
73- c.assetDebtPool = IUniswapV3Factory (c.swapFactory).getPool (c.collateral, c.loanToken, c.feeAssetDebt);
74- c.recoveryDelay = vm.parseTomlUint (toml, ".recoveryDelay " );
68+ c.collateralLoanPool =
69+ IUniswapV3Factory (c.swapFactory).getPool (c.collateralToken, c.loanToken, c.collateralLoanPoolFee);
70+ c.collateralLoanPoolFee = uint24 (vm.parseTomlUint (toml, ".collateralLoanPoolFee " ));
71+ c.yieldLoanPool = IUniswapV3Factory (c.swapFactory).getPool (c.yieldToken, c.loanToken, c.yieldLoanPoolFee);
72+ c.yieldLoanPoolFee = uint24 (vm.parseTomlUint (toml, ".yieldLoanPoolFee " ));
73+
74+ c.marketOracle = vm.parseTomlAddress (toml, ".marketOracle " );
75+ c.marketIrm = vm.parseTomlAddress (toml, ".marketIrm " );
76+ c.marketLltv = vm.parseTomlUint (toml, ".marketLltv " );
77+ c.yieldOracle = vm.parseTomlAddress (toml, ".yieldOracle " );
7578 }
7679
7780 function _marketParams (Config memory c ) internal pure returns (MarketParams memory ) {
7881 return MarketParams ({
7982 loanToken: c.loanToken,
80- collateralToken: c.collateral ,
83+ collateralToken: c.collateralToken ,
8184 oracle: c.marketOracle,
8285 irm: c.marketIrm,
8386 lltv: c.marketLltv
@@ -100,10 +103,10 @@ abstract contract ConfiguredScript is Script {
100103
101104 /// @dev Both FlowSwap pools the vault trades on must exist.
102105 function _requirePoolsExist (Config memory c ) internal view {
103- address yieldPool = IUniswapV3Factory (c.swapFactory).getPool (c.yieldToken, c.loanToken, c.feeYieldDebt );
106+ address yieldPool = IUniswapV3Factory (c.swapFactory).getPool (c.yieldToken, c.loanToken, c.yieldLoanPoolFee );
104107 require (yieldPool != address (0 ), "yield/debt pool missing " );
105- require (yieldPool == c.yieldDebtPool , "config yieldDebtPool does not match factory " );
106- require (c.assetDebtPool != address (0 ), "asset/debt pool missing " );
108+ require (yieldPool == c.yieldLoanPool , "config yieldLoanPool does not match factory " );
109+ require (c.collateralLoanPool != address (0 ), "asset/debt pool missing " );
107110 }
108111
109112 /// @dev The account whose key signs broadcast transactions. Must be
0 commit comments