xrpld
Loading...
Searching...
No Matches
SystemParameters.h
1#pragma once
2
3#include <xrpl/basics/Number.h>
4#include <xrpl/basics/chrono.h>
5#include <xrpl/protocol/XRPAmount.h>
6
7#include <chrono>
8#include <cstdint>
9#include <ratio>
10#include <string>
11
12namespace xrpl {
13
14// Various protocol and system specific constant globals.
15
16/* The name of the system. */
17static inline std::string const&
19{
20 static std::string const kName = "xrpld";
21 return kName;
22}
23
27
31constexpr XRPAmount kInitialXrp{100'000'000'000 * kDropsPerXrp};
32static_assert(kInitialXrp.drops() == 100'000'000'000'000'000);
33static_assert(Number::kMaxRep >= kInitialXrp.drops());
34
38inline bool
40{
41 return amount <= kInitialXrp;
42}
43
48inline bool
50{
51 return amount >= -kInitialXrp && amount <= kInitialXrp;
52}
53
54/* The currency code for the native currency. */
55static inline std::string const&
57{
58 static std::string const kCode = "XRP";
59 return kCode;
60}
61
65static constexpr std::uint32_t kXrpLedgerEarliestSeq{32570u};
66
71static constexpr std::uint32_t kXrpLedgerEarliestFees{562177u};
72
77
82
83} // namespace xrpl
84
88inline constexpr std::uint16_t kDefaultPeerPort{2459};
static constexpr internalrep kMaxRep
Definition Number.h:364
constexpr value_type drops() const
Returns the number of drops.
Definition XRPAmount.h:170
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:254
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:22
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.