Skip to content

Commit 0677919

Browse files
committed
Minor changes
1 parent a75d34d commit 0677919

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

deploy/FlapperInit.sol

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ interface SplitterLike {
6060
function usdsJoin() external view returns (address);
6161
function hop() external view returns (uint256);
6262
function rely(address) external;
63-
function deny(address) external;
6463
function file(bytes32, uint256) external;
6564
function file(bytes32, address) external;
6665
}
@@ -72,15 +71,13 @@ interface FarmLike {
7271
}
7372

7473
interface KickerLike {
74+
function vat() external view returns (address);
75+
function vow() external view returns (address);
76+
function splitter() external view returns (address);
7577
function file(bytes32, uint256) external;
7678
function file(bytes32, int256) external;
7779
}
7880

79-
interface VowLike {
80-
function sump() external view returns (uint256);
81-
function file(bytes32, uint256) external;
82-
}
83-
8481
struct FlapperUniV2Config {
8582
uint256 want;
8683
address pip;
@@ -233,17 +230,21 @@ library FlapperInit {
233230
) internal {
234231
require(cfg.kbump % RAY == 0, "kbump not multiple of RAY");
235232

236-
VowLike vow = VowLike(dss.chainlog.getAddress("MCD_VOW"));
237-
require(vow.sump() == type(uint256).max, "flop is not inactive");
233+
address splitter = dss.chainlog.getAddress("MCD_SPLIT");
234+
require(KickerLike(kicker).vat() == address(dss.vat), "vat missmatch");
235+
require(KickerLike(kicker).vow() == address(dss.vow), "vow missmatch");
236+
require(KickerLike(kicker).splitter() == splitter, "splitter missmatch");
237+
238+
require(dss.vow.sump() == type(uint256).max, "flop is not inactive");
238239

239-
vow.file("bump", 0);
240-
vow.file("hump", type(uint256).max);
240+
dss.vow.file("bump", 0);
241+
dss.vow.file("hump", type(uint256).max);
241242

242243
KickerLike(kicker).file("khump", cfg.khump);
243244
KickerLike(kicker).file("kbump", cfg.kbump);
244245

245246
dss.vat.rely(kicker);
246-
SplitterLike(dss.chainlog.getAddress("MCD_SPLIT")).rely(kicker);
247+
SplitterLike(splitter).rely(kicker);
247248

248249
dss.chainlog.setAddress(cfg.chainlogKey, kicker);
249250
}

src/Kicker.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ contract Kicker {
3131
// --- storage variables ---
3232

3333
mapping(address usr => uint256 allowed) public wards;
34-
uint256 public kbump; // Fixed lot size [rad]
35-
int256 public khump; // Allowance limit [rad]
34+
uint256 public kbump; // Fixed lot size [rad]
35+
int256 public khump; // Flap threshold [rad]
3636

3737
// --- immutables ---
3838

@@ -102,7 +102,7 @@ contract Kicker {
102102
// --- execution ---
103103

104104
function flap() external returns (uint256 id) {
105-
require(_toInt256(vat.dai(vow)) >= _toInt256(vat.sin(vow)) + _toInt256(kbump) + khump, "Kicker/insufficient-allowance");
105+
require(_toInt256(vat.dai(vow)) >= _toInt256(vat.sin(vow)) + _toInt256(kbump) + khump, "Kicker/flap-threshold-reached");
106106
vat.suck(vow, address(this), kbump);
107107
id = splitter.kick(kbump, 0);
108108
}

test/Kicker.t.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ interface VowLike {
3939
function bump() external view returns (uint256);
4040
function hump() external view returns (uint256);
4141
function Sin() external view returns (uint256);
42-
function Ash() external view returns (uint256);
4342
function heal(uint256) external;
4443
function flap() external;
4544
function cage() external;
@@ -363,7 +362,7 @@ contract KickerTest is DssTest {
363362
assertEq(vat.sin(address(vow)), 17_500e45);
364363
assertEq(vat.dai(address(vow)), 0);
365364

366-
vm.expectRevert("Kicker/insufficient-allowance");
365+
vm.expectRevert("Kicker/flap-threshold-reached");
367366
kicker.flap();
368367
}
369368

0 commit comments

Comments
 (0)