-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Amendment fixFrozenLPTokenTransfer
: Prohibit transfer of LPToken when an asset is frozen
#5227
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5227 +/- ##
=======================================
Coverage 78.0% 78.0%
=======================================
Files 789 789
Lines 66953 66996 +43
Branches 8107 8111 +4
=======================================
+ Hits 52218 52254 +36
- Misses 14735 14742 +7
|
caa857c
to
7a0d1d7
Compare
7a0d1d7
to
efa1823
Compare
fixFrozenLPTokenTransfer
: Prohibit transfer of LPToken when an asset is frozen
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.
It looks functionally fine to me. Just left some comments about style, code coverage and redundant header files included.
account, | ||
(*sleAmm)[sfAsset].get<Issue>(), | ||
(*sleAmm)[sfAsset2].get<Issue>())) | ||
{ |
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.
don't need curly braces
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.
going to leave the braces here for readability since the if condition is fairly long
src, | ||
(*sleAmm)[sfAsset].get<Issue>(), | ||
(*sleAmm)[sfAsset2].get<Issue>())) | ||
{ |
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.
don't need curly braces
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.
going leaving the braces here for readability
@@ -304,7 +348,13 @@ accountHolds( | |||
} | |||
amount.setIssuer(issuer); | |||
} | |||
JLOG(j.trace()) << "accountHolds:" << " account=" << to_string(account) | |||
else | |||
{ |
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.
don't need {}
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.
going to leave here for readability since if
has braces
auto const sle = view.read(keylet::line(lpAccount, ammAccount, currency)); | ||
if (!sle) | ||
{ | ||
amount.clear(Issue{currency, ammAccount}); |
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.
is this line covered? do we need to add an extra test to cover 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.
its a copy paste of original accountHolds. This line will be covered by existing amm test cases that check for the balance of LPToken holders
High Level Overview of Change
New Definition
Background
Prior to this amendment, a blacklisted account that owns frozen LPTokens could still transfer them through mechanisms such as Payments, Checks, Offers, or NFTs. This loophole allowed the recipient of these LPTokens to redeem or withdraw the underlying assets of the pool, bypassing the restrictions that should have applied to the blacklisted account. This behavior undermines the freezing mechanism's integrity and creates inconsistencies in asset control.
Note: this amendment only works with the existing regular freeze, and has no correlation with deep-freeze
Example
Amendment changes
This amendment ensures that frozen LPTokens cannot be transferred. Below are the changes to specific transaction types:
Payments
OfferCreate
CheckCash
NFTokenCreateOffer
NFTokenAcceptOffer
Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)