From cad1618bbd1687f16a4afe84612b69624668ff97 Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Mon, 9 Jun 2025 11:33:57 +0100 Subject: [PATCH] updated Carrot hard fork for testnet; merged treasury mint into Carrot HF --- src/cryptonote_config.h | 3 +-- src/cryptonote_core/blockchain.cpp | 1 - src/cryptonote_core/cryptonote_tx_utils.cpp | 8 ++++---- src/hardforks/hardforks.cpp | 5 +---- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 0567211ba..8af492a77 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -242,8 +242,7 @@ #define HF_VERSION_AUDIT1_PAUSE 7 #define HF_VERSION_AUDIT2 8 #define HF_VERSION_AUDIT2_PAUSE 9 -#define HF_VERSION_TREASURY_SAL1_MINT 10 -#define HF_VERSION_CARROT 11 +#define HF_VERSION_CARROT 10 #define HF_VERSION_REQUIRE_VIEW_TAGS 255 #define HF_VERSION_ENABLE_CONVERT 255 diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 4f00e20f4..489c3fb36 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1503,7 +1503,6 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl case HF_VERSION_AUDIT1_PAUSE: case HF_VERSION_AUDIT2: case HF_VERSION_AUDIT2_PAUSE: - case HF_VERSION_TREASURY_SAL1_MINT: case HF_VERSION_CARROT: if (b.miner_tx.amount_burnt > 0) { CHECK_AND_ASSERT_MES(money_in_use + b.miner_tx.amount_burnt > money_in_use, false, "miner transaction is overflowed by amount_burnt"); diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 0904c3523..1563616de 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -343,13 +343,13 @@ namespace cryptonote const std::vector& hardforks, const uint8_t hf_version ) { - if (hf_version >= HF_VERSION_TREASURY_SAL1_MINT) { + if (hf_version >= HF_VERSION_CARROT) { // find the hardfork height const auto& hf = std::find_if(hardforks.begin(), hardforks.end(), [](const hardfork_t& hf) { - return hf.version == HF_VERSION_TREASURY_SAL1_MINT; + return hf.version == HF_VERSION_CARROT; }); - // since we are at least at the hard fork HF_VERSION_TREASURY_SAL1_MINT, we assume height >= hf->height + // since we are at least at the hard fork HF_VERSION_CARROT, we assume height >= hf->height const auto diff = height - hf->height; const auto mint_period = get_config(nettype).TREASURY_SAL1_MINT_PERIOD; @@ -557,7 +557,7 @@ namespace cryptonote case HF_VERSION_AUDIT1_PAUSE: case HF_VERSION_AUDIT2: case HF_VERSION_AUDIT2_PAUSE: - case HF_VERSION_TREASURY_SAL1_MINT: + case HF_VERSION_CARROT: // SRCG: subtract 20% that will be rewarded to staking users CHECK_AND_ASSERT_MES(tx.amount_burnt == 0, false, "while creating outs: amount_burnt is nonzero"); tx.amount_burnt = amount / 5; diff --git a/src/hardforks/hardforks.cpp b/src/hardforks/hardforks.cpp index c4a7bd33f..1abab57e6 100644 --- a/src/hardforks/hardforks.cpp +++ b/src/hardforks/hardforks.cpp @@ -90,11 +90,8 @@ const hardfork_t testnet_hard_forks[] = { // version 9 (audit 1 complete, whitelist controlling payouts) starts from block 1000 { 9, 1000, 0, 1739280000 }, - // version 10 treasury mint starts from block 1100 + // version 10 Carrot - including treasury mint - starts from block 1100 {10, 1100, 0, 1739780005 }, - - // version 11 carrot starts from block 1500 - {11, 1500, 0, 1739780010 }, }; const size_t num_testnet_hard_forks = sizeof(testnet_hard_forks) / sizeof(testnet_hard_forks[0]); const uint64_t testnet_hard_fork_version_1_till = ((uint64_t)-1);