Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base test for incentive #443

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
15 changes: 15 additions & 0 deletions src/DssSpell.t.base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,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 @@ -961,6 +965,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
Loading