Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Temple Loving Care #2
Temple Loving Care #2
Changes from 7 commits
12cf342
36a2d6c
7e6bb9e
2dd68a4
48ce56b
c51ee11
56e6fc7
b55b415
8b9149d
e727c16
aa27eca
fdee032
7a58613
fcdb1c9
a69c5a8
4ad3376
22699e0
a954dff
5af95e3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also - can't easily migrate user positions if we need a v2. pros/cons of making this upgradeable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - is this a fixed price rather than some oracle/on-chain price? At a minimum should have a setter? Would be good if you can explain how this works.
Also:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be
<= 365 days
correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, something like 8 hours seems ideal here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An invariant exists where
debtAddress.balanceOf(address(this)) >= debtBalance
Should have an assert for this whenever we increment/decrement?
At a minimum add fuzz testing for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to track
collateralBalance
separately? When it's required, could just useIERC20(collateralAddress).balanceOf(address(this))
The risk is that it could get out of sync (although would then have to deal with others donating/sending collateral without calling this function)
At a minimium should have an invariant assertion whenever we increment/decrement that
IERC20(collateralAddress).balanceOf(address(this)) >= collateralBalance
I think the other invariant which should always hold is:
Could fuzz test that perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I am removing tracking collateralBalance. Not that useful anyways