Skip to content

Commit

Permalink
ZeroB2M amendment (#293)
Browse files Browse the repository at this point in the history
* ZeroB2M amendment

Co-authored-by: Denis Angell <dangell@transia.co>
  • Loading branch information
RichardAH and dangell7 committed Mar 21, 2024
1 parent d24c134 commit 7cd8f0a
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 39 deletions.
8 changes: 7 additions & 1 deletion src/ripple/app/tx/impl/Import.cpp
Expand Up @@ -1224,7 +1224,13 @@ Import::doApply()
create ? STAmount(bonusAmount) : STAmount(mSourceBalance);

uint64_t creditDrops = burn.xrp().drops();
if (elapsed < 2'000'000)

if (view().rules().enabled(featureZeroB2M))
{
// B2M xrp is disabled by amendment
creditDrops = 0;
}
else if (elapsed < 2'000'000)
{
// first 2MM ledgers
// the ratio is 1:1
Expand Down
3 changes: 2 additions & 1 deletion src/ripple/protocol/Feature.h
Expand Up @@ -74,7 +74,7 @@ namespace detail {
// Feature.cpp. Because it's only used to reserve storage, and determine how
// large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than
// the actual number of amendments. A LogicError on startup will verify this.
static constexpr std::size_t numFeatures = 68;
static constexpr std::size_t numFeatures = 69;

/** Amendments that this server supports and the default voting behavior.
Whether they are enabled depends on the Rules defined in the validated
Expand Down Expand Up @@ -356,6 +356,7 @@ extern uint256 const featureHooksUpdate1;
extern uint256 const fixXahauV1;
extern uint256 const fixXahauV2;
extern uint256 const featureRemit;
extern uint256 const featureZeroB2M;

} // namespace ripple

Expand Down
1 change: 1 addition & 0 deletions src/ripple/protocol/impl/Feature.cpp
Expand Up @@ -462,6 +462,7 @@ REGISTER_FEATURE(HooksUpdate1, Supported::yes, VoteBehavior::De
REGISTER_FIX (fixXahauV1, Supported::yes, VoteBehavior::DefaultNo);
REGISTER_FIX (fixXahauV2, Supported::yes, VoteBehavior::DefaultNo);
REGISTER_FEATURE(Remit, Supported::yes, VoteBehavior::DefaultNo);
REGISTER_FEATURE(ZeroB2M, Supported::yes, VoteBehavior::DefaultNo);

// The following amendments are obsolete, but must remain supported
// because they could potentially get enabled.
Expand Down

0 comments on commit 7cd8f0a

Please sign in to comment.