Skip to content

Commit 7629509

Browse files
committed
Some fixes
1 parent 556ba2a commit 7629509

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

deploy/FlapperInit.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ interface PairLike {
5151
}
5252

5353
interface UsdsJoinLike {
54-
function dai() external view returns (address); // TODO: Replace when new join is ready by the new getter
54+
function usds() external view returns (address);
5555
}
5656

5757
interface SplitterLike {
@@ -158,7 +158,7 @@ library FlapperInit {
158158
FarmLike farm = FarmLike(farm_);
159159
SplitterLike splitter = SplitterLike(cfg.splitter);
160160

161-
require(farm.rewardsToken() == UsdsJoinLike(cfg.usdsJoin).dai(), "Farm rewards not usds");
161+
require(farm.rewardsToken() == UsdsJoinLike(cfg.usdsJoin).usds(), "Farm rewards not usds");
162162
// Staking token is checked in the Lockstake script
163163

164164
// The following two checks enforce the initSplitter function has to be called first

test/FlapperUniV2.t.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

test/FlapperUniV2SwapOnly.t.sol

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ interface GemLike {
6060
function transfer(address, uint256) external;
6161
}
6262

63-
interface Univ2FactoryLike {
63+
interface UniV2FactoryLike {
64+
function getPair(address, address) external view returns (address);
6465
function createPair(address, address) external returns (address);
6566
}
6667

@@ -121,7 +122,10 @@ contract FlapperUniV2SwapOnlyTest is DssTest {
121122
vat = VatLike(ChainlogLike(LOG).getAddress("MCD_VAT"));
122123
vow = VowLike(ChainlogLike(LOG).getAddress("MCD_VOW"));
123124

124-
UNIV2_USDS_IMX_PAIR = Univ2FactoryLike(UNIV2_FACTORY).createPair(USDS, IMX);
125+
UNIV2_USDS_IMX_PAIR = UniV2FactoryLike(UNIV2_FACTORY).getPair(USDS, IMX);
126+
if(UNIV2_USDS_IMX_PAIR == address(0)) {
127+
UNIV2_USDS_IMX_PAIR = UniV2FactoryLike(UNIV2_FACTORY).createPair(USDS, IMX);
128+
}
125129

126130
splitter = new SplitterMock(USDS_JOIN);
127131
vm.startPrank(PAUSE_PROXY);

0 commit comments

Comments
 (0)