xrpld
Loading...
Searching...
No Matches
xrpl::ValidClawback Class Reference

Invariant: Token holder's trustline/MPT balance cannot be invalid after Clawback. More...

#include <InvariantCheck.h>

Collaboration diagram for xrpl::ValidClawback:

Classes

struct  EntryChange

Public Member Functions

void visitEntry (bool, SLE::const_ref, SLE::const_ref)
bool finalize (STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &) const

Private Attributes

std::uint32_t trustlinesChanged_ = 0
std::uint32_t mptokensChanged_ = 0
EntryChange iou_
EntryChange mpt_

Detailed Description

Invariant: Token holder's trustline/MPT balance cannot be invalid after Clawback.

We iterate all the trust lines affected by this transaction and ensure that no more than one trustline is modified, and also holder's balance is non-negative. When featureMPTokensV2 is enabled, also verify the holder's raw trustline/MPToken balance decreased by the clawed amount.

Definition at line 336 of file InvariantCheck.h.

Member Function Documentation

◆ visitEntry()

void xrpl::ValidClawback::visitEntry ( bool isDelete,
SLE::const_ref before,
SLE::const_ref after )

Definition at line 830 of file InvariantCheck.cpp.

◆ finalize()

bool xrpl::ValidClawback::finalize ( STTx const & tx,
TER const result,
XRPAmount const ,
ReadView const & view,
beast::Journal const & j ) const
nodiscard

Definition at line 852 of file InvariantCheck.cpp.

Member Data Documentation

◆ trustlinesChanged_

std::uint32_t xrpl::ValidClawback::trustlinesChanged_ = 0
private

Definition at line 344 of file InvariantCheck.h.

◆ mptokensChanged_

std::uint32_t xrpl::ValidClawback::mptokensChanged_ = 0
private

Definition at line 345 of file InvariantCheck.h.

◆ iou_

EntryChange xrpl::ValidClawback::iou_
private

Definition at line 346 of file InvariantCheck.h.

◆ mpt_

EntryChange xrpl::ValidClawback::mpt_
private

Definition at line 347 of file InvariantCheck.h.