Skip to content

Commit

Permalink
Add base test for incentive (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
SidestreamStrongStrawberry authored Jan 27, 2025
1 parent 68f5cff commit ace5d05
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/DssSpell.t.base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ contract DssSpellTestBase is Config, DssTest {

// wait
assertEq(vow.wait(), values.vow_wait, "TestError/vow-wait");

// Ensure there is enough time for the governance to unwind SBE LP tokens instead of starting a Flop auction
assertGe(vow.wait(), pause.delay() * 2, "TestError/vow-wait-too-short");

{
// dump values in WAD
uint256 normalizedDump = values.vow_dump * WAD;
Expand Down Expand Up @@ -969,6 +973,17 @@ contract DssSpellTestBase is Config, DssTest {
address engine = LockstakeClipperLike(address(clip)).engine();
assertNotEq(engine, address(0), _concat("TestError/clip-engine-is-not-set-", ilk));
}
{
// Ensure liquidation penalty is always bigger than combined keeper incentives
(,,, uint256 line, uint256 dust) = vat.ilks(ilk);
if (line != 0 && clip.stopped() == 0) {
(, uint256 chop,,) = dog.ilks(ilk);
uint256 tab = dust * chop / WAD;
uint256 penaltyAmount = tab - dust;
uint256 incentiveAmount = uint256(clip.tip()) + (tab * uint256(clip.chip()) / WAD);
assertGe(penaltyAmount, incentiveAmount, _concat("TestError/too-low-dog-chop-", ilk));
}
}
}
if (reg.class(ilk) < 3) {
{
Expand Down

0 comments on commit ace5d05

Please sign in to comment.