Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Modernize the PSM and add negative fees #6

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Modernize the PSM and add negative fees #6

wants to merge 20 commits into from

Conversation

hexonaut
Copy link
Contributor

@hexonaut hexonaut commented Jun 5, 2022

This update does a few things:

  • Merge the GemJoin logic into the Psm so there is only one contract now
  • Switch to forge
  • Upgrade to solc 0.8.14
  • Use dss-test
  • vow is no longer immutable
  • Add support for negative fees
  • Add integration tests
  • Removed unnecessary hope/nope - can extract gems in other ways

Some discussion:

  • I've removed the cage() as I don't really see what it gives us beyond what the debt ceiling control already give us and it saves an SLOAD. If there is some use I'm not seeing please let me know.
  • Now that tin and tout can go negative - do we want to prevent them from ever crossing? It's fairly obvious we don't want to do this as you will be able to drain the surplus buffer if this ever happened, but it would make it so you have to set the tin and tout in a specific order to not trigger the preventative revert. I'm leaning towards preventing this just to be super safe.
  • Should add FV as I much prefer to deploy this with optimizations turned on.
  • Should think about upgradability.
  • Do we want to pre-mint the DAI? Requires adding cure and custom oracles support for Global Settlement, but will save a lot of gas.
  • Do we care about rounding against the user for fees? Current implementation will round against the protocol in some cases.

@hexonaut hexonaut marked this pull request as ready for review June 5, 2022 17:37
@hexonaut hexonaut self-assigned this Jun 5, 2022
@hexonaut hexonaut requested a review from gbalabasquer June 5, 2022 17:38
@hexonaut hexonaut requested a review from talbaneth June 5, 2022 18:23
@hexonaut hexonaut requested a review from kmbarry1 June 5, 2022 18:26
src/psm.sol Outdated Show resolved Hide resolved
test.sh Outdated Show resolved Hide resolved
test.sh Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@hexonaut
Copy link
Contributor Author

hexonaut commented Aug 3, 2022

Added another PR to support assets that are not priced at $1: #7

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

Successfully merging this pull request may close these issues.

2 participants