You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following function behaviors may be unexpected and must be taken into account when writing contracts that integrate with Liquity V2:
The repayBold and adjustTrove functions in BorrowerOperations can be used to repay debt. If the amount specified to repay would result in the trove falling below MIN_DEBT, then only the amount required to reach MIN_DEBT will be repaid. The remaining amount will be left with the caller. Integrators must not expect a revert if the amount specified is impossible to repay exactly and must return leftover amounts in the calling contract to the user.
The withdrawFromSP function in StabilityPool takes an _amount parameter. If the user has a BOLD deposit that is smaller than _amount, the user's full balance will be withdrawn. Integrators must not expect a revert if _amount is impossible to withdraw and must account for the actual withdrawal amount.
Any operation on a trove within a batch can influence other troves in the same batch. For instance, if we retrieve the data for Trove A by calling getLatestTroveData, then close another trove within the same batch, and subsequently call getLatestTroveData for Trove A again, the debt of trove A may have increased due to rounding errors. Integrators must expect that the state of a trove can change between calls, even if the trove itself is not directly modified.
The text was updated successfully, but these errors were encountered:
The following function behaviors may be unexpected and must be taken into account when writing contracts that integrate with Liquity V2:
The repayBold and adjustTrove functions in BorrowerOperations can be used to repay debt. If the amount specified to repay would result in the trove falling below
MIN_DEBT
, then only the amount required to reachMIN_DEBT
will be repaid. The remaining amount will be left with the caller. Integrators must not expect a revert if the amount specified is impossible to repay exactly and must return leftover amounts in the calling contract to the user.The
withdrawFromSP
function in StabilityPool takes an_amount
parameter. If the user has a BOLD deposit that is smaller than _amount, the user's full balance will be withdrawn. Integrators must not expect a revert if_amount
is impossible to withdraw and must account for the actual withdrawal amount.Any operation on a trove within a batch can influence other troves in the same batch. For instance, if we retrieve the data for Trove A by calling
getLatestTroveData
, then close another trove within the same batch, and subsequently call getLatestTroveData for Trove A again, the debt of trove A may have increased due to rounding errors. Integrators must expect that the state of a trove can change between calls, even if the trove itself is not directly modified.The text was updated successfully, but these errors were encountered: