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

Conversation

SidestreamStrongStrawberry
Copy link
Collaborator

src/DssSpell.t.base.sol Outdated Show resolved Hide resolved
src/DssSpell.t.base.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@SidestreamColdMelon SidestreamColdMelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed sanity checks

Numbers that are fetched for ETH-A from etherscan

  • vat.ilks(ilk).dust = 7500.000000000000000000000000000000000000000000000 [RAD]
  • dog.chop(ilk) = 1.130000000000000000 [WAD]
  • clip.tip = 250.000000000000000000000000000000000000000000000 [RAD]
  • clip.chip = 0.001000000000000000 [WAD]

Values calculated in this test (logged during the review)

  • tab = 8475.000000000000000000000000000000000000000000000 [RAD]
    • ✅ Sounds reasonable (7500 * 1.13)
  • penaltyAmount = 975.000000000000000000000000000000000000000000000 [RAD]
    • ✅ Sounds reasonable (7500 * 0.13)
  • incentiveAmount = 258.475000000000000000000000000000000000000000000 [RAD]
    • ✅ Sounds reasonable (250 + 7500 * 1.13 * 0.001)

Overall

  • ✅ Both penaltyAmount and incentiveAmount values are in the same RAD denomination
  • ✅ Asserting that penaltyAmount is greater or equal to incentiveAmount makes sense to prevent "infinite money" draining attack
  • ✅ Skipping the assert when line == 0 makes sense, since no new vaults can be opened, therefore draining is not possible
  • ✅ Skipping the assert when clip.stopped() != 0 makes sense, since no new auctions can be started, therefore draining is not possible
  • ✅ Asserting that flop delay is longer than GSM delay makes sense to allow potential (theoretical) unwinding of USDS/SKY LP tokens via out-of-schedule spell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants