@@ -4,7 +4,7 @@ import {ICurvePool} from "src/interfaces/ICurvePool.sol";
44import {CurveDolaLPHelper} from "src/util/CurveDolaLPHelper.sol " ;
55import "test/marketForkTests/CrvUSDDolaConvexMarketForkTest.t.sol " ;
66import {console} from "forge-std/console.sol " ;
7- import {IMultiMarketTransformHelper } from "src/interfaces/IMultiMarketTransformHelper .sol " ;
7+ import {IMultiMarketConvertHelper } from "src/interfaces/IMultiMarketConvertHelper .sol " ;
88
99contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
1010 CurveDolaLPHelper helper;
@@ -27,15 +27,16 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
2727 vm.stopPrank ();
2828 }
2929
30- function test_transformToCollateral () public {
30+ function test_convertToCollateral () public {
3131 uint256 amount = 100 ether ;
3232 // Estimate LP amount
3333 uint256 [2 ] memory amounts = [amount, 0 ];
3434 uint estLpAmount = dolaCrvUSD.calc_token_amount (amounts, true );
3535
3636 DOLA.approve (address (helper), amount);
37- uint256 lpAmount = helper.transformToCollateral (
37+ uint256 lpAmount = helper.convertToCollateral (
3838 amount,
39+ address (this ),
3940 abi.encode (address (market), uint (1 ))
4041 );
4142 assertEq (
@@ -45,14 +46,14 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
4546 assertEq (lpAmount, estLpAmount);
4647 }
4748
48- function test_transformToCollateral_receiver () public {
49+ function test_convertToCollateral_receiver () public {
4950 uint256 amount = 100 ether ;
5051 // Estimate LP amount
5152 uint256 [2 ] memory amounts = [amount, 0 ];
5253 uint estLpAmount = dolaCrvUSD.calc_token_amount (amounts, true );
5354
5455 DOLA.approve (address (helper), amount);
55- uint256 lpAmount = helper.transformToCollateral (
56+ uint256 lpAmount = helper.convertToCollateral (
5657 amount,
5758 receiver,
5859 abi.encode (address (market), uint (1 ))
@@ -61,14 +62,14 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
6162 assertEq (lpAmount, estLpAmount);
6263 }
6364
64- function test_transformToCollateralAndDeposit () public {
65+ function test_convertToCollateralAndDeposit () public {
6566 uint256 amount = 100 ether ;
6667 // Estimate LP amount
6768 uint256 [2 ] memory amounts = [amount, 0 ];
6869 uint estLpAmount = dolaCrvUSD.calc_token_amount (amounts, true );
6970
7071 DOLA.approve (address (helper), amount);
71- uint256 lpAmount = helper.transformToCollateralAndDeposit (
72+ uint256 lpAmount = helper.convertToCollateralAndDeposit (
7273 amount,
7374 address (this ),
7475 abi.encode (address (market), uint (1 ))
@@ -82,14 +83,14 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
8283 assertEq (lpAmount, estLpAmount);
8384 }
8485
85- function test_transformToCollateralAndDeposit_receiver () public {
86+ function test_convertToCollateralAndDeposit_receiver () public {
8687 uint256 amount = 100 ether ;
8788 // Estimate LP amount
8889 uint256 [2 ] memory amounts = [amount, 0 ];
8990 uint estLpAmount = dolaCrvUSD.calc_token_amount (amounts, true );
9091
9192 DOLA.approve (address (helper), amount);
92- uint256 lpAmount = helper.transformToCollateralAndDeposit (
93+ uint256 lpAmount = helper.convertToCollateralAndDeposit (
9394 amount,
9495 receiver,
9596 abi.encode (address (market), uint (1 ))
@@ -102,14 +103,15 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
102103 assertEq (lpAmount, estLpAmount);
103104 }
104105
105- function test_transformFromCollateral () public {
106- test_transformToCollateral ();
106+ function test_convertFromCollateral () public {
107+ test_convertToCollateral ();
107108 uint256 amount = IERC20 (address (dolaCrvUSD)).balanceOf (address (this ));
108109 // Estimate DOLA amount
109110 uint estDolaAmount = dolaCrvUSD.calc_withdraw_one_coin (amount, 0 );
110111 uint dolaBalBefore = DOLA.balanceOf (address (this ));
111112 IERC20 (address (dolaCrvUSD)).approve (address (helper), amount);
112- uint256 dolaAmount = helper.transformFromCollateral (
113+ uint256 dolaAmount = helper.convertFromCollateral (
114+ address (0 ),
113115 amount,
114116 abi.encode (address (market), uint (1 ))
115117 );
@@ -118,14 +120,14 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
118120 assertEq (dolaAmount, estDolaAmount);
119121 }
120122
121- function test_transformFromCollateral_receiver () public {
122- test_transformToCollateral ();
123+ function test_convertFromCollateral_receiver () public {
124+ test_convertToCollateral ();
123125 uint256 amount = IERC20 (address (dolaCrvUSD)).balanceOf (address (this ));
124126 // Estimate DOLA amount
125127 uint estDolaAmount = dolaCrvUSD.calc_withdraw_one_coin (amount, 0 );
126128
127129 IERC20 (address (dolaCrvUSD)).approve (address (helper), amount);
128- uint256 dolaAmount = helper.transformFromCollateral (
130+ uint256 dolaAmount = helper.convertFromCollateral (
129131 amount,
130132 receiver,
131133 abi.encode (address (market), uint (1 ))
@@ -135,8 +137,8 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
135137 assertEq (dolaAmount, estDolaAmount);
136138 }
137139
138- function test_withdrawAndTransformFromCollateral () public {
139- test_transformToCollateralAndDeposit_receiver ();
140+ function test_withdrawAndConvertFromCollateral () public {
141+ test_convertToCollateralAndDeposit_receiver ();
140142 uint256 amount = ConvexEscrowV2 (address (market.predictEscrow (receiver)))
141143 .balance ();
142144 // Estimate DOLA amount
@@ -163,15 +165,15 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
163165
164166 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (23 , hash);
165167
166- IMultiMarketTransformHelper .Permit
167- memory permit = IMultiMarketTransformHelper .Permit (
168+ IMultiMarketConvertHelper .Permit
169+ memory permit = IMultiMarketConvertHelper .Permit (
168170 block .timestamp ,
169171 v,
170172 r,
171173 s
172174 );
173175 vm.prank (receiver);
174- uint256 dolaAmount = helper.withdrawAndTransformFromCollateral (
176+ uint256 dolaAmount = helper.withdrawAndConvertFromCollateral (
175177 amount,
176178 receiver,
177179 permit,
@@ -182,8 +184,8 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
182184 assertEq (dolaAmount, estDolaAmount);
183185 }
184186
185- function test_withdrawAndTransformFromCollateral_other_receiver () public {
186- test_transformToCollateralAndDeposit_receiver ();
187+ function test_withdrawAndConvertFromCollateral_other_receiver () public {
188+ test_convertToCollateralAndDeposit_receiver ();
187189 uint256 amount = ConvexEscrowV2 (address (market.predictEscrow (receiver)))
188190 .balance ();
189191 // Estimate DOLA amount
@@ -211,15 +213,15 @@ contract CurveDolaLPHelperTest is CrvUSDDolaConvexMarketForkTest {
211213
212214 (uint8 v , bytes32 r , bytes32 s ) = vm.sign (23 , hash);
213215
214- IMultiMarketTransformHelper .Permit
215- memory permit = IMultiMarketTransformHelper .Permit (
216+ IMultiMarketConvertHelper .Permit
217+ memory permit = IMultiMarketConvertHelper .Permit (
216218 block .timestamp ,
217219 v,
218220 r,
219221 s
220222 );
221223 vm.prank (receiver);
222- uint256 dolaAmount = helper.withdrawAndTransformFromCollateral (
224+ uint256 dolaAmount = helper.withdrawAndConvertFromCollateral (
223225 amount,
224226 address (this ),
225227 permit,
0 commit comments