@@ -62,7 +62,8 @@ interface GemLike {
6262 function transfer (address , uint256 ) external ;
6363}
6464
65- interface Univ2FactoryLike {
65+ interface UniV2FactoryLike {
66+ function getPair (address , address ) external view returns (address );
6667 function createPair (address , address ) external returns (address );
6768}
6869
@@ -123,8 +124,11 @@ contract FlapperUniV2Test is DssTest {
123124 vat = VatLike (ChainlogLike (LOG).getAddress ("MCD_VAT " ));
124125 vow = VowLike (ChainlogLike (LOG).getAddress ("MCD_VOW " ));
125126
126- UNIV2_USDS_IMX_PAIR = Univ2FactoryLike (UNIV2_FACTORY).createPair (USDS, IMX);
127-
127+ UNIV2_USDS_IMX_PAIR = UniV2FactoryLike (UNIV2_FACTORY).getPair (USDS, IMX);
128+ if (UNIV2_USDS_IMX_PAIR == address (0 )) {
129+ UNIV2_USDS_IMX_PAIR = UniV2FactoryLike (UNIV2_FACTORY).createPair (USDS, IMX);
130+ }
131+
128132 splitter = new SplitterMock (USDS_JOIN);
129133 vm.startPrank (PAUSE_PROXY);
130134 vow.file ("hump " , 50_000_000 * RAD);
@@ -399,7 +403,7 @@ contract FlapperUniV2Test is DssTest {
399403 vm.revertTo (initialState);
400404
401405 // New version
402- vm.prank (PAUSE_PROXY); vow.file ("bump " , totalUsdsConsumed * RAY); // The current flapper gets the total vat.Usds to consume.
406+ vm.prank (PAUSE_PROXY); vow.file ("bump " , totalUsdsConsumed * RAY); // The current flapper gets the total vat.dai to consume.
403407 doExec (address (flapper), SKY, UNIV2_SKY_USDS_PAIR);
404408 uint256 boughtLpNewVersion = GemLike (UNIV2_SKY_USDS_PAIR).balanceOf (PAUSE_PROXY) - initialLp;
405409
0 commit comments