rippled
Loading...
Searching...
No Matches
AMMClawback.h
1#pragma once
2
3#include <xrpld/app/tx/detail/Transactor.h>
4
5namespace xrpl {
6class Sandbox;
7class AMMClawback : public Transactor
8{
9public:
11
12 explicit AMMClawback(ApplyContext& ctx) : Transactor(ctx)
13 {
14 }
15
16 static std::uint32_t
18
19 static NotTEC
20 preflight(PreflightContext const& ctx);
21
22 static TER
23 preclaim(PreclaimContext const& ctx);
24
25 TER
26 doApply() override;
27
28private:
29 TER
31
46 SLE const& ammSle,
47 AccountID const& holder,
48 AccountID const& ammAccount,
49 STAmount const& amountBalance,
50 STAmount const& amount2Balance,
51 STAmount const& lptAMMBalance,
52 STAmount const& holdLPtokens,
53 STAmount const& amount);
54};
55
56} // namespace xrpl
static NotTEC preflight(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
static constexpr ConsequencesFactoryType ConsequencesFactory
Definition AMMClawback.h:10
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
AMMClawback(ApplyContext &ctx)
Definition AMMClawback.h:12
TER applyGuts(Sandbox &view)
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...
TER doApply() override
State information when applying a tx.
Discardable, editable view to a ledger.
Definition Sandbox.h:15
ApplyView & view()
Definition Transactor.h:128
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:53
State information when preflighting a tx.
Definition Transactor.h:15