rippled
Loading...
Searching...
No Matches
AMMClawback.h
1#ifndef XRPL_TX_AMMCLAWBACK_H_INCLUDED
2#define XRPL_TX_AMMCLAWBACK_H_INCLUDED
3
4#include <xrpld/app/tx/detail/Transactor.h>
5
6namespace ripple {
7class Sandbox;
8class AMMClawback : public Transactor
9{
10public:
12
13 explicit AMMClawback(ApplyContext& ctx) : Transactor(ctx)
14 {
15 }
16
17 static std::uint32_t
19
20 static NotTEC
21 preflight(PreflightContext const& ctx);
22
23 static TER
24 preclaim(PreclaimContext const& ctx);
25
26 TER
27 doApply() override;
28
29private:
30 TER
32
47 SLE const& ammSle,
48 AccountID const& holder,
49 AccountID const& ammAccount,
50 STAmount const& amountBalance,
51 STAmount const& amount2Balance,
52 STAmount const& lptAMMBalance,
53 STAmount const& holdLPtokens,
54 STAmount const& amount);
55};
56
57} // namespace ripple
58
59#endif
static constexpr ConsequencesFactoryType ConsequencesFactory
Definition AMMClawback.h:11
TER doApply() override
TER applyGuts(Sandbox &view)
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
AMMClawback(ApplyContext &ctx)
Definition AMMClawback.h:13
static NotTEC preflight(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
std::tuple< TER, STAmount, STAmount, std::optional< STAmount > > equalWithdrawMatchingOneAmount(Sandbox &view, SLE const &ammSle, AccountID const &holder, AccountID const &ammAccount, STAmount const &amountBalance, STAmount const &amount2Balance, STAmount const &lptAMMBalance, STAmount const &holdLPtokens, STAmount const &amount)
Withdraw both assets by providing maximum amount of asset1, asset2's amount will be calculated accord...
State information when applying a tx.
Discardable, editable view to a ledger.
Definition Sandbox.h:16
ApplyView & view()
Definition Transactor.h:144
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:61
State information when preflighting a tx.
Definition Transactor.h:16