xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
protocol
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
12
namespace
xrpl
{
13
14
// Various protocol and system specific constant globals.
15
16
/* The name of the system. */
17
static
inline
std::string
const
&
18
systemName
()
19
{
20
static
std::string
const
kName =
"xrpld"
;
21
return
kName;
22
}
23
27
31
constexpr
XRPAmount
kInitialXrp
{100'000'000'000 *
kDropsPerXrp
};
32
static_assert
(
kInitialXrp
.
drops
() == 100'000'000'000'000'000);
33
static_assert
(
Number::kMaxRep
>=
kInitialXrp
.
drops
());
34
38
inline
bool
39
isLegalAmount
(
XRPAmount
const
& amount)
40
{
41
return
amount <=
kInitialXrp
;
42
}
43
48
inline
bool
49
isLegalAmountSigned
(
XRPAmount
const
& amount)
50
{
51
return
amount >= -
kInitialXrp
&& amount <=
kInitialXrp
;
52
}
53
54
/* The currency code for the native currency. */
55
static
inline
std::string
const
&
56
systemCurrencyCode
()
57
{
58
static
std::string
const
kCode =
"XRP"
;
59
return
kCode;
60
}
61
65
static
constexpr
std::uint32_t
kXrpLedgerEarliestSeq
{32570u};
66
71
static
constexpr
std::uint32_t
kXrpLedgerEarliestFees
{562177u};
72
76
constexpr
std::ratio<80, 100>
kAmendmentMajorityCalcThreshold
;
77
81
constexpr
std::chrono::seconds
const
kDefaultAmendmentMajorityTime
=
Weeks
{2};
82
83
}
// namespace xrpl
84
88
inline
constexpr
std::uint16_t
kDefaultPeerPort{2459};
std::string
chrono
xrpl::Number::kMaxRep
static constexpr InternalRep kMaxRep
Definition
Number.h:364
xrpl::XRPAmount
Definition
XRPAmount.h:28
xrpl::XRPAmount::drops
constexpr value_type drops() const
Returns the number of drops.
Definition
XRPAmount.h:170
cstdint
std::chrono::seconds
std::uint32_t
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::isLegalAmount
bool isLegalAmount(XRPAmount const &amount)
Returns true if the amount does not exceed the initial XRP in existence.
Definition
SystemParameters.h:39
xrpl::kDropsPerXrp
constexpr XRPAmount kDropsPerXrp
Number of drops per 1 XRP.
Definition
XRPAmount.h:254
xrpl::kDefaultAmendmentMajorityTime
constexpr std::chrono::seconds const kDefaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
Definition
SystemParameters.h:81
xrpl::kAmendmentMajorityCalcThreshold
constexpr std::ratio< 80, 100 > kAmendmentMajorityCalcThreshold
The minimum amount of support an amendment should have.
Definition
SystemParameters.h:76
xrpl::kXrpLedgerEarliestFees
static constexpr std::uint32_t kXrpLedgerEarliestFees
The XRP Ledger mainnet's earliest ledger with a FeeSettings object.
Definition
SystemParameters.h:71
xrpl::systemName
static std::string const & systemName()
Definition
SystemParameters.h:18
xrpl::isLegalAmountSigned
bool isLegalAmountSigned(XRPAmount const &amount)
Returns true if the absolute value of the amount does not exceed the initial XRP in existence.
Definition
SystemParameters.h:49
xrpl::systemCurrencyCode
static std::string const & systemCurrencyCode()
Definition
SystemParameters.h:56
xrpl::Weeks
std::chrono::duration< int, std::ratio_multiply< Days::period, std::ratio< 7 > > > Weeks
Definition
chrono.h:22
xrpl::kInitialXrp
constexpr XRPAmount kInitialXrp
Configure the native currency.
Definition
SystemParameters.h:31
xrpl::kXrpLedgerEarliestSeq
static constexpr std::uint32_t kXrpLedgerEarliestSeq
The XRP ledger network's earliest allowed sequence.
Definition
SystemParameters.h:65
ratio
string
Generated by
1.17.0