xrpld
Loading...
Searching...
No Matches
SystemParameters.h
1#pragma once
2
3#include <xrpl/basics/chrono.h>
4#include <xrpl/protocol/XRPAmount.h>
5
6#include <cstdint>
7#include <string>
8
9namespace xrpl {
10
11// Various protocol and system specific constant globals.
12
13/* The name of the system. */
14static inline std::string const&
16{
17 static std::string const kName = "xrpld";
18 return kName;
19}
20
22
24constexpr XRPAmount kInitialXrp{100'000'000'000 * kDropsPerXrp};
25static_assert(kInitialXrp.drops() == 100'000'000'000'000'000);
26static_assert(Number::kMaxRep >= kInitialXrp.drops());
27
29inline bool
31{
32 return amount <= kInitialXrp;
33}
34
37inline bool
39{
40 return amount >= -kInitialXrp && amount <= kInitialXrp;
41}
42
43/* The currency code for the native currency. */
44static inline std::string const&
46{
47 static std::string const kCode = "XRP";
48 return kCode;
49}
50
52static constexpr std::uint32_t kXrpLedgerEarliestSeq{32570u};
53
56static constexpr std::uint32_t kXrpLedgerEarliestFees{562177u};
57
60
63
64} // namespace xrpl
65
67inline constexpr std::uint16_t kDefaultPeerPort{2459};
static constexpr internalrep kMaxRep
Definition Number.h:319
constexpr value_type drops() const
Returns the number of drops.
Definition XRPAmount.h:159
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
bool isLegalAmount(XRPAmount const &amount)
Returns true if the amount does not exceed the initial XRP in existence.
constexpr XRPAmount kDropsPerXrp
Number of drops per 1 XRP.
Definition XRPAmount.h:240
constexpr std::chrono::seconds const kDefaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
constexpr std::ratio< 80, 100 > kAmendmentMajorityCalcThreshold
The minimum amount of support an amendment should have.
static constexpr std::uint32_t kXrpLedgerEarliestFees
The XRP Ledger mainnet's earliest ledger with a FeeSettings object.
std::chrono::duration< int, std::ratio_multiply< days::period, std::ratio< 7 > > > weeks
Definition chrono.h:21
static std::string const & systemName()
bool isLegalAmountSigned(XRPAmount const &amount)
Returns true if the absolute value of the amount does not exceed the initial XRP in existence.
static std::string const & systemCurrencyCode()
constexpr XRPAmount kInitialXrp
Configure the native currency.
static constexpr std::uint32_t kXrpLedgerEarliestSeq
The XRP ledger network's earliest allowed sequence.