-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: sd as 18 decimals #312
Conversation
8521361
to
3ab42ac
Compare
test: update tests accordingly
3ab42ac
to
10834be
Compare
@smol-ninja nevermind for now the fail inv test, we will change the |
test: update tests accordingly
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.
Thank you for making all these changes. Clearly this is a big PR and has more impacts than I imagined. A few comments:
- I can see two variations of
scaled
naming:scaledABC
andabcScaled
. I suppose you are usingabcScaled
for function names (ongoingDebtScaledOf
andgetSnapshotDebtScaled
) whereasscaledABC
for variables names. If so, there are inconsistencies at a few places such as use ofsnapshotDebtScaled
variable ingetSnapshotDebtScaled
function. Lets stick to one convention so that there is no confusion when deciding for a variable names that requires 18 decimal format.
My suggestion would be to either use scaledABC
format or ABCScaled
format for all variables and function naming and not both. Whats your preference?
- Would it be more consistent if we use the same naming convention for snapshot debt getter as well i.e.
snapshotDebtOf
similar toongoingDebtOf
? Its the only function that looks out of touch since it leans more towards getters defined inISablierFlow
thanISablierFlowBase
. If you are aligned, we can consider refactoring it in the next release of Flow.
tests/integration/concrete/deposit-and-pause/depositAndPause.t.sol
Outdated
Show resolved
Hide resolved
tests/integration/concrete/refund-and-pause/refundAndPause.t.sol
Outdated
Show resolved
Hide resolved
7ac5945
to
8793cf1
Compare
One more comment: Technical doc is now outdated given that
Wdyt? if you think you want it to have numbers as well then we will have to update them as well as charts (I suppose charts are outdated too right?) |
489ccbe
to
8793cf1
Compare
actually, my intention was to only have one, and that is
ofc, we should have just one, as said above. how would you keep consistency and still have a good function name? my preference is
i think that would be misleading. snapshot debt is a state variable, while the other is a function that calculates an amount in real time. we should definitely keep the "get" keyword for all getters, as it only reads a state, and having "Of" points out that it’s different from the classic getters (dynamic function) |
Got it. Then lets use |
8793cf1
to
0eaef87
Compare
test: use `ONE_MONTH_DEBT_18D` constant Co-authored-by: smol-ninja <[email protected]>
0eaef87
to
663e9e8
Compare
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.
Last few suggestions then looks good here.
Co-authored-by: smol-ninja <[email protected]>
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.
Fanstatic. Less goooo 🚀
Closes #302
Changes
ongoingDebt
toongoingDebtScaled
uint256
type in this functionsnapshotDebt
tosnapshotDebtScaled
withdraw
function accordinglydepletionTime
function1
value (i.e. for USDC it would be1e12
)uint256
in scale/descale function from testsuint128
touint256
compared touint256
touint128
ONE_MONTH_DEBT_18D
constant forsnapshotDebt
tests