Defi Stablecoin course question: do we really need _revertIfHealthFactorIsBroken(msg.sender);
in the liquidate
function?
#3385
thurendous
started this conversation in
General
Replies: 1 comment 8 replies
-
Yes, there was an audit for the protocol, and yeah, you can argue that line of code is unnecessary, but it is a safety check that will keep the protocol invariant. I am unsure what you mean when you said, |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having the course of Stablecoin course now. And Patrick use the code below as the liquidation function implementation.
I am quite skeptic about the last line of the code.
Do you think
revertIfHealthFactorIsBroken(msg.sender);
is necessary or not?I think this one is not necessary because:
msg.sender
's health factor has nothing to do with the currentuser
's liquidation process.By deleting this line, the protocol can become more robust.
How do you think??
Did Patrick make some change about this one? Also there was an audit I think.
https://github.com/Cyfrin/foundry-defi-stablecoin-cu/blob/1415a29efaa9ca092b940432261f6961ba292ac1/src/DSCEngine.sol#L202C1-L249C6
Beta Was this translation helpful? Give feedback.
All reactions