rippled
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 name = "ripple";
18 return name;
19}
20
24constexpr XRPAmount INITIAL_XRP{100'000'000'000 * DROPS_PER_XRP};
25static_assert(INITIAL_XRP.drops() == 100'000'000'000'000'000);
26static_assert(Number::maxRep >= INITIAL_XRP.drops());
27
29inline bool
31{
32 return amount <= INITIAL_XRP;
33}
34
37inline bool
39{
40 return amount >= -INITIAL_XRP && amount <= INITIAL_XRP;
41}
42
43/* The currency code for the native currency. */
44static inline std::string const&
46{
47 static std::string const code = "XRP";
48 return code;
49}
50
52static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ{32570u};
53
56static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES{562177u};
57
60
63
64} // namespace xrpl
65
67inline std::uint16_t constexpr DEFAULT_PEER_PORT{2459};
static constexpr internalrep maxRep
Definition Number.h:220
constexpr value_type drops() const
Returns the number of drops.
Definition XRPAmount.h:157
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES
The XRP Ledger mainnet's earliest ledger with a FeeSettings object.
bool isLegalAmount(XRPAmount const &amount)
Returns true if the amount does not exceed the initial XRP in existence.
constexpr std::chrono::seconds const defaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
static std::string const & systemName()
constexpr XRPAmount DROPS_PER_XRP
Number of drops per 1 XRP.
Definition XRPAmount.h:237
constexpr std::ratio< 80, 100 > amendmentMajorityCalcThreshold
The minimum amount of support an amendment should have.
constexpr XRPAmount INITIAL_XRP
Configure the native currency.
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()
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ
The XRP ledger network's earliest allowed sequence.