xrpld
Loading...
Searching...
No Matches
tx/transactors/dex/AMMCreate.h
1#pragma once
2
3#include <xrpl/tx/Transactor.h>
4
5namespace xrpl {
6
37class AMMCreate : public Transactor
38{
39public:
41
42 explicit AMMCreate(ApplyContext& ctx) : Transactor(ctx)
43 {
44 }
45
46 static bool
48
49 static NotTEC
50 preflight(PreflightContext const& ctx);
51
52 static XRPAmount
53 calculateBaseFee(ReadView const& view, STTx const& tx);
54
55 static TER
56 preclaim(PreclaimContext const& ctx);
57
59 TER
60 doApply() override;
61
62 void
63 visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override;
64
65 [[nodiscard]] bool
67 STTx const& tx,
68 TER result,
69 XRPAmount fee,
70 ReadView const& view,
71 beast::Journal const& j) override;
72};
73
74} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:38
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
bool finalizeInvariants(STTx const &tx, TER result, XRPAmount fee, ReadView const &view, beast::Journal const &j) override
Check transaction-specific post-conditions after all entries have been visited.
TER doApply() override
Attempt to create the AMM instance.
static bool checkExtraFeatures(PreflightContext const &ctx)
Definition AMMCreate.cpp:42
static TER preclaim(PreclaimContext const &ctx)
Definition AMMCreate.cpp:95
static NotTEC preflight(PreflightContext const &ctx)
Definition AMMCreate.cpp:55
static constexpr auto kConsequencesFactory
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Definition AMMCreate.cpp:88
State information when applying a tx.
A view into a ledger.
Definition ReadView.h:31
std::shared_ptr< STLedgerEntry const > const & const_ref
ApplyView & view()
Definition Transactor.h:136
Transactor(Transactor const &)=delete
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
TERSubset< CanCvtToNotTEC > NotTEC
Definition TER.h:594
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition View.cpp:554
TERSubset< CanCvtToTER > TER
Definition TER.h:634
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:18