rippled
Loading...
Searching...
No Matches
SystemParameters.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_PROTOCOL_SYSTEMPARAMETERS_H_INCLUDED
21#define RIPPLE_PROTOCOL_SYSTEMPARAMETERS_H_INCLUDED
22
23#include <xrpl/basics/chrono.h>
24#include <xrpl/protocol/XRPAmount.h>
25
26#include <cstdint>
27#include <string>
28
29namespace ripple {
30
31// Various protocol and system specific constant globals.
32
33/* The name of the system. */
34static inline std::string const&
36{
37 static std::string const name = "ripple";
38 return name;
39}
40
44constexpr XRPAmount INITIAL_XRP{100'000'000'000 * DROPS_PER_XRP};
45
47inline bool
49{
50 return amount <= INITIAL_XRP;
51}
52
55inline bool
57{
58 return amount >= -INITIAL_XRP && amount <= INITIAL_XRP;
59}
60
61/* The currency code for the native currency. */
62static inline std::string const&
64{
65 static std::string const code = "XRP";
66 return code;
67}
68
70static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ{32570u};
71
74static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES{562177u};
75
78
81
82} // namespace ripple
83
85inline std::uint16_t constexpr DEFAULT_PEER_PORT{2459};
86
87#endif
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
static std::string const & systemName()
constexpr std::chrono::seconds const defaultAmendmentMajorityTime
The minimum amount of time an amendment must hold a majority.
bool isLegalAmount(XRPAmount const &amount)
Returns true if the amount does not exceed the initial XRP in existence.
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ
The XRP ledger network's earliest allowed sequence.
static std::string const & systemCurrencyCode()
bool isLegalAmountSigned(XRPAmount const &amount)
Returns true if the absolute value of the amount does not exceed the initial XRP in existence.
constexpr XRPAmount INITIAL_XRP
Configure the native currency.
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES
The XRP Ledger mainnet's earliest ledger with a FeeSettings object.
constexpr std::ratio< 80, 100 > amendmentMajorityCalcThreshold
The minimum amount of support an amendment should have.
constexpr XRPAmount DROPS_PER_XRP
Number of drops per 1 XRP.
Definition XRPAmount.h:259