From 34b2f9b315972bbe16464fa3420d90fc736809d4 Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Tue, 7 May 2024 14:34:19 +0100 Subject: [PATCH] commenced removal of pricing_record touchpoints for MVP release --- src/blockchain_db/blockchain_db.cpp | 18 +- src/blockchain_db/blockchain_db.h | 4 +- src/blockchain_db/lmdb/db_lmdb.cpp | 18 +- src/blockchain_utilities/CMakeLists.txt | 18 +- .../blockchain_ancestry.cpp | 2 +- .../blockchain_blackball.cpp | 2 +- src/blockchain_utilities/blockchain_depth.cpp | 2 +- .../blockchain_export.cpp | 2 +- .../blockchain_import.cpp | 2 +- src/blockchain_utilities/blockchain_prune.cpp | 2 +- .../blockchain_prune_known_spent_data.cpp | 2 +- src/blockchain_utilities/blockchain_stats.cpp | 4 +- src/blockchain_utilities/blockchain_usage.cpp | 2 +- src/common/dns_utils.h | 2 +- src/common/updates.cpp | 2 +- src/crypto/crypto.cpp | 7 + src/crypto/crypto.h | 2 + src/cryptonote_basic/cryptonote_basic.h | 6 +- .../cryptonote_boost_serialization.h | 4 +- .../cryptonote_format_utils.cpp | 40 +-- src/cryptonote_basic/verification_context.h | 1 + src/cryptonote_config.h | 46 +-- src/cryptonote_core/blockchain.cpp | 38 +- src/cryptonote_core/blockchain.h | 3 + src/cryptonote_core/cryptonote_tx_utils.cpp | 59 ++- src/cryptonote_core/cryptonote_tx_utils.h | 2 +- src/cryptonote_core/tx_pool.cpp | 7 + src/cryptonote_protocol/enums.h | 3 +- src/daemon/CMakeLists.txt | 2 +- src/daemon/command_line_args.h | 2 +- src/daemon/command_server.cpp | 2 +- src/daemon/executor.cpp | 4 +- src/daemon/main.cpp | 6 +- src/daemonizer/posix_daemonizer.inl | 2 +- src/daemonizer/windows_daemonizer.inl | 2 +- src/debug_utilities/CMakeLists.txt | 6 +- src/debug_utilities/cn_deserialize.cpp | 2 +- src/debug_utilities/dns_checks.cpp | 2 +- src/gen_multisig/CMakeLists.txt | 2 +- src/gen_ssl_cert/CMakeLists.txt | 2 +- src/gen_ssl_cert/gen_ssl_cert.cpp | 4 +- src/multisig/multisig.cpp | 2 +- src/multisig/multisig_tx_builder_ringct.cpp | 6 +- src/oracle/asset_types.h | 26 +- src/oracle/pricing_record.cpp | 16 +- src/oracle/pricing_record.h | 12 +- src/ringct/rctSigs.cpp | 14 +- src/ringct/rctTypes.h | 3 + src/serialization/json_object.cpp | 8 +- src/serialization/pricing_record.h | 8 +- src/simplewallet/CMakeLists.txt | 2 +- src/simplewallet/simplewallet.cpp | 339 ++++++------------ src/simplewallet/simplewallet.h | 4 +- src/version.cpp.in | 6 +- src/wallet/CMakeLists.txt | 2 +- src/wallet/wallet2.cpp | 35 +- src/wallet/wallet2.h | 2 +- src/wallet/wallet_args.cpp | 6 +- src/wallet/wallet_rpc_server.cpp | 14 +- 59 files changed, 400 insertions(+), 443 deletions(-) diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp index 404cf4e9f..b9d247779 100644 --- a/src/blockchain_db/blockchain_db.cpp +++ b/src/blockchain_db/blockchain_db.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project -// Portions Copyright (c) 2023, Fulmo (author: SRCG) +// Portions Copyright (c) 2023, Salvium (author: SRCG) // // All rights reserved. // @@ -365,29 +365,29 @@ uint64_t BlockchainDB::add_block( const std::pair& blck } // SRCG: This is the code that calculates the total slippage for the block - // Now convert all of the residual balances into FULM + // Now convert all of the residual balances into SAL boost::multiprecision::int128_t slippage_total_128 = 0; uint64_t slippage_total = 0; for (const auto& tally: slippage_counts) { boost::multiprecision::int128_t slippage_amount_128 = 0; - if (tally.first == "FULM") { + if (tally.first == "SAL") { slippage_amount_128 = tally.second; } else { - // Sanity check - do we have a price for both source asset type and FULM in the PR? - boost::multiprecision::int128_t fulm_price = blk.pricing_record["FULM"]; + // Sanity check - do we have a price for both source asset type and SAL in the PR? + boost::multiprecision::int128_t sal_price = blk.pricing_record["SAL"]; boost::multiprecision::int128_t asset_price = blk.pricing_record[tally.first]; - if (fulm_price == 0) { + if (sal_price == 0) { // No price available - bail out, because block is invalid - throw std::runtime_error("Asset type 'FULM' is not present in available pricing record"); + throw std::runtime_error("Asset type 'SAL' is not present in available pricing record"); } if (asset_price == 0) { // No price available - bail out, because block is invalid throw std::runtime_error("Asset type '" + tally.first + "' is not present in available pricing record"); } - // Convert the FUSD amount into FULM + // Convert the VSD amount into SAL boost::multiprecision::int128_t tally_128 = tally.second; tally_128 *= asset_price; - tally_128 /= fulm_price; + tally_128 /= sal_price; slippage_amount_128 = tally_128.convert_to(); } slippage_total_128 += slippage_amount_128; diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h index 29dd3aa38..845536d8c 100644 --- a/src/blockchain_db/blockchain_db.h +++ b/src/blockchain_db/blockchain_db.h @@ -424,8 +424,8 @@ private: * @param cumulative_difficulty the accumulated difficulty after this block * @param coins_generated the number of coins generated total after this block * @param blk_hash the hash of the block - * @param slippage_total the total value (expressed in FULM coins) of all slippage for this block - * @param yield_total the total of FULM coins that have been locked for yield in this block + * @param slippage_total the total value (expressed in SAL coins) of all slippage for this block + * @param yield_total the total of SAL coins that have been locked for yield in this block */ virtual void add_block( const block& blk, size_t block_weight, diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index d38b2c5e4..b48e61f09 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2023, The Monero Project -// Portions Copyright (c) 2023, Fulmo (author: SRCG) +// Portions Copyright (c) 2023, Salvium (author: SRCG) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are @@ -1188,10 +1188,10 @@ uint64_t BlockchainLMDB::add_transaction_data(const crypto::hash& blk_hash, cons boost::multiprecision::int128_t final_source_tally = source_tally - tx.amount_burnt; boost::multiprecision::int128_t coinbase = get_block_already_generated_coins(m_height-1); if (source_tally == 0 && result == MDB_NOTFOUND) { - if (tx.source_asset_type == "FULM") { + if (tx.source_asset_type == "SAL") { final_source_tally += coinbase; } else { - throw0(DB_ERROR("burn underflow - asset balance is zero for non-FULM asset")); + throw0(DB_ERROR("burn underflow - asset balance is zero for non-SAL asset")); } } write_circulating_supply_data(m_cur_circ_supply_tally, source_idx, final_source_tally); @@ -1222,7 +1222,7 @@ uint64_t BlockchainLMDB::add_transaction_data(const crypto::hash& blk_hash, cons boost::multiprecision::int128_t final_source_tally = source_tally + asset.second; boost::multiprecision::int128_t coinbase = get_block_already_generated_coins(m_height-1); if (source_tally == 0 && result == MDB_NOTFOUND) { - if (tx.source_asset_type == "FULM") { + if (tx.source_asset_type == "SAL") { final_source_tally += coinbase; } } @@ -1943,7 +1943,7 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags) mdb_env_close(m_env); m_open = false; MFATAL("Existing lmdb database needs to be converted, which cannot be done on a read-only database."); - MFATAL("Please run fulmod once to convert the database."); + MFATAL("Please run salviumd once to convert the database."); return; } // Note that there was a schema change within version 0 as well. @@ -3394,7 +3394,7 @@ std::map BlockchainLMDB::get_circulating_supply() const } uint64_t m_coinbase = get_block_already_generated_coins(m_height-1); - LOG_PRINT_L3("BlockchainLMDB::" << __func__ << " - mined supply for FULM = " << m_coinbase); + LOG_PRINT_L3("BlockchainLMDB::" << __func__ << " - mined supply for SAL = " << m_coinbase); check_open(); TXN_PREFIX_RDONLY(); @@ -3420,9 +3420,9 @@ std::map BlockchainLMDB::get_circulating_supply() const const std::string currency_label = cryptonote::asset_type_from_id(currency_type); boost::multiprecision::int128_t amount = import_tally_from_cst(cst); - // Check for FULM - we need to adjust the total for them + // Check for SAL - we need to adjust the total for them if (currency_type == 0) { - // Get the current circulating supply for FULM + // Get the current circulating supply for SAL amount += m_coinbase; } @@ -3433,7 +3433,7 @@ std::map BlockchainLMDB::get_circulating_supply() const // NEAC: check for empty supply tally - only happens prior to first conversion on chain if (circulating_supply.empty()) { - circulating_supply["FULM"] = m_coinbase; + circulating_supply["SAL"] = m_coinbase; } return circulating_supply; } diff --git a/src/blockchain_utilities/CMakeLists.txt b/src/blockchain_utilities/CMakeLists.txt index ddb546884..4c61b0c9a 100644 --- a/src/blockchain_utilities/CMakeLists.txt +++ b/src/blockchain_utilities/CMakeLists.txt @@ -157,7 +157,7 @@ endif() set_property(TARGET blockchain_import PROPERTY - OUTPUT_NAME "fulmo-blockchain-import") + OUTPUT_NAME "salvium-blockchain-import") install(TARGETS blockchain_import DESTINATION bin) monero_add_executable(blockchain_export @@ -178,7 +178,7 @@ target_link_libraries(blockchain_export set_property(TARGET blockchain_export PROPERTY - OUTPUT_NAME "fulmo-blockchain-export") + OUTPUT_NAME "salvium-blockchain-export") install(TARGETS blockchain_export DESTINATION bin) monero_add_executable(blockchain_blackball @@ -200,7 +200,7 @@ target_link_libraries(blockchain_blackball set_property(TARGET blockchain_blackball PROPERTY - OUTPUT_NAME "fulmo-blockchain-mark-spent-outputs") + OUTPUT_NAME "salvium-blockchain-mark-spent-outputs") install(TARGETS blockchain_blackball DESTINATION bin) @@ -222,7 +222,7 @@ target_link_libraries(blockchain_usage set_property(TARGET blockchain_usage PROPERTY - OUTPUT_NAME "fulmo-blockchain-usage") + OUTPUT_NAME "salvium-blockchain-usage") install(TARGETS blockchain_usage DESTINATION bin) monero_add_executable(blockchain_ancestry @@ -243,7 +243,7 @@ target_link_libraries(blockchain_ancestry set_property(TARGET blockchain_ancestry PROPERTY - OUTPUT_NAME "fulmo-blockchain-ancestry") + OUTPUT_NAME "salvium-blockchain-ancestry") install(TARGETS blockchain_ancestry DESTINATION bin) monero_add_executable(blockchain_depth @@ -264,7 +264,7 @@ target_link_libraries(blockchain_depth set_property(TARGET blockchain_depth PROPERTY - OUTPUT_NAME "fulmo-blockchain-depth") + OUTPUT_NAME "salvium-blockchain-depth") install(TARGETS blockchain_depth DESTINATION bin) monero_add_executable(blockchain_stats @@ -285,7 +285,7 @@ target_link_libraries(blockchain_stats set_property(TARGET blockchain_stats PROPERTY - OUTPUT_NAME "fulmo-blockchain-stats") + OUTPUT_NAME "salvium-blockchain-stats") install(TARGETS blockchain_stats DESTINATION bin) monero_add_executable(blockchain_prune_known_spent_data @@ -307,7 +307,7 @@ target_link_libraries(blockchain_prune_known_spent_data set_property(TARGET blockchain_prune_known_spent_data PROPERTY - OUTPUT_NAME "fulmo-blockchain-prune-known-spent-data") + OUTPUT_NAME "salvium-blockchain-prune-known-spent-data") install(TARGETS blockchain_prune_known_spent_data DESTINATION bin) monero_add_executable(blockchain_prune @@ -316,7 +316,7 @@ monero_add_executable(blockchain_prune set_property(TARGET blockchain_prune PROPERTY - OUTPUT_NAME "fulmo-blockchain-prune") + OUTPUT_NAME "salvium-blockchain-prune") install(TARGETS blockchain_prune DESTINATION bin) target_link_libraries(blockchain_prune diff --git a/src/blockchain_utilities/blockchain_ancestry.cpp b/src/blockchain_utilities/blockchain_ancestry.cpp index ed33a0fda..adf0d57e4 100644 --- a/src/blockchain_utilities/blockchain_ancestry.cpp +++ b/src/blockchain_utilities/blockchain_ancestry.cpp @@ -386,7 +386,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/blockchain_utilities/blockchain_blackball.cpp b/src/blockchain_utilities/blockchain_blackball.cpp index 7bea444ee..83ad2d935 100644 --- a/src/blockchain_utilities/blockchain_blackball.cpp +++ b/src/blockchain_utilities/blockchain_blackball.cpp @@ -1219,7 +1219,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/blockchain_utilities/blockchain_depth.cpp b/src/blockchain_utilities/blockchain_depth.cpp index 66cae6ecc..02cb6e945 100644 --- a/src/blockchain_utilities/blockchain_depth.cpp +++ b/src/blockchain_utilities/blockchain_depth.cpp @@ -88,7 +88,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp index 45d6446f8..14eb46b9c 100644 --- a/src/blockchain_utilities/blockchain_export.cpp +++ b/src/blockchain_utilities/blockchain_export.cpp @@ -90,7 +90,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index e40ef3058..037aa4589 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -638,7 +638,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/blockchain_utilities/blockchain_prune.cpp b/src/blockchain_utilities/blockchain_prune.cpp index 8aee52959..be6ac3e72 100644 --- a/src/blockchain_utilities/blockchain_prune.cpp +++ b/src/blockchain_utilities/blockchain_prune.cpp @@ -483,7 +483,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/blockchain_utilities/blockchain_prune_known_spent_data.cpp b/src/blockchain_utilities/blockchain_prune_known_spent_data.cpp index ba0fc92d4..46bf65889 100644 --- a/src/blockchain_utilities/blockchain_prune_known_spent_data.cpp +++ b/src/blockchain_utilities/blockchain_prune_known_spent_data.cpp @@ -137,7 +137,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/blockchain_utilities/blockchain_stats.cpp b/src/blockchain_utilities/blockchain_stats.cpp index 09fd8f7a7..45374353a 100644 --- a/src/blockchain_utilities/blockchain_stats.cpp +++ b/src/blockchain_utilities/blockchain_stats.cpp @@ -175,7 +175,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } @@ -242,7 +242,7 @@ int main(int argc, char* argv[]) /* * The default output can be plotted with GnuPlot using these commands: set key autotitle columnhead -set title "Fulmo Blockchain Growth" +set title "Salvium Blockchain Growth" set timefmt "%Y-%m-%d" set xdata time set xrange ["2014-04-17":*] diff --git a/src/blockchain_utilities/blockchain_usage.cpp b/src/blockchain_utilities/blockchain_usage.cpp index c429a5607..3f5007b31 100644 --- a/src/blockchain_utilities/blockchain_usage.cpp +++ b/src/blockchain_utilities/blockchain_usage.cpp @@ -120,7 +120,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/common/dns_utils.h b/src/common/dns_utils.h index 3f4c03f79..0d5f298e6 100644 --- a/src/common/dns_utils.h +++ b/src/common/dns_utils.h @@ -122,7 +122,7 @@ public: * @brief Gets a DNS address from OpenAlias format * * If the address looks good, but contains one @ symbol, replace that with a . - * e.g. donate@fulmo.network becomes donate.fulmo.network + * e.g. donate@salvium.network becomes donate.salvium.network * * @param oa_addr OpenAlias address * diff --git a/src/common/updates.cpp b/src/common/updates.cpp index 1b1d9a1c9..8d49e0274 100644 --- a/src/common/updates.cpp +++ b/src/common/updates.cpp @@ -102,7 +102,7 @@ namespace tools std::string get_update_url(const std::string &software, const std::string &subdir, const std::string &buildtag, const std::string &version, bool user) { - const char *base = user ? "https://downloads.fulmo.network/" : "https://updates.fulmo.network/"; + const char *base = user ? "https://downloads.salvium.network/" : "https://updates.salvium.network/"; #ifdef _WIN32 static const char *extension = strncmp(buildtag.c_str(), "source", 6) ? (strncmp(buildtag.c_str(), "install-", 8) ? ".zip" : ".exe") : ".tar.bz2"; #elif defined(__APPLE__) diff --git a/src/crypto/crypto.cpp b/src/crypto/crypto.cpp index 9799970fb..2fd61f4a3 100644 --- a/src/crypto/crypto.cpp +++ b/src/crypto/crypto.cpp @@ -74,6 +74,13 @@ namespace crypto { const crypto::public_key null_pkey = crypto::public_key{}; const crypto::secret_key null_skey = crypto::secret_key{}; + static inline crypto::key_image get_null_ki() { + crypto::key_image ki; + std::memset(ki.data, 0, sizeof(ki.data)); + return ki; + } + const crypto::key_image null_ki = get_null_ki(); + static inline unsigned char *operator &(ec_point &point) { return &reinterpret_cast(point); } diff --git a/src/crypto/crypto.h b/src/crypto/crypto.h index a70ae3be8..057839cde 100644 --- a/src/crypto/crypto.h +++ b/src/crypto/crypto.h @@ -366,6 +366,8 @@ namespace crypto { const extern crypto::public_key null_pkey; const extern crypto::secret_key null_skey; + const extern crypto::key_image null_ki; + inline bool operator<(const public_key &p1, const public_key &p2) { return memcmp(&p1, &p2, sizeof(public_key)) < 0; } inline bool operator>(const public_key &p1, const public_key &p2) { return p2 < p1; } } diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h index 4673e8490..8d6493bd3 100644 --- a/src/cryptonote_basic/cryptonote_basic.h +++ b/src/cryptonote_basic/cryptonote_basic.h @@ -535,7 +535,7 @@ namespace cryptonote transaction miner_tx; /** - * Ok, the "protocol_tx" is a large part of what makes Fulmo unique, and requires a bit of explaining... + * Ok, the "protocol_tx" is a large part of what makes Salvium unique, and requires a bit of explaining... * * In Haven, and therefore Zephyr also, conversions take place "in-transaction". That is to say, * amounts of coin A are burnt, and amounts of coin B are minted, and the conversion rate is known, @@ -564,14 +564,14 @@ namespace cryptonote * Therefore, it follows that slippage can only accurately be assessed when we know ALL of the changes * to the above parameters that will occur at a given point in time (specifically, when the block is * mined). There is a fundamental interdependence between each conversion TX in a given block. This - * means that, in Fulmo, you can't tell in advance precisely how much you will get minted by a given + * means that, in Salvium, you can't tell in advance precisely how much you will get minted by a given * conversion TX until the block is mined. Instead, when creating a conversion TX, the user is asked * to specify a minimum amount they will accept - if the transaction can satisfy that criterion when * it is mined, the conversion will be processed and the minted amount will be sent to the user. If * the transaction cannot satisfy the minimum minted requirement, the user will be refunded their * money, minus a nominal transaction fee. * - * Welcome to Fulmo, and the protocol_tx. + * Welcome to Salvium, and the protocol_tx. * -------------------------------------- * The protocol_tx is a per-block TX (much like the miner_tx, where the block reward gets paid out). * It is created at the time of populating the block template to be sent to the miner. Specifically, diff --git a/src/cryptonote_basic/cryptonote_boost_serialization.h b/src/cryptonote_basic/cryptonote_boost_serialization.h index 0ca761ef5..a853404e6 100644 --- a/src/cryptonote_basic/cryptonote_boost_serialization.h +++ b/src/cryptonote_basic/cryptonote_boost_serialization.h @@ -213,8 +213,8 @@ namespace boost template inline void serialize(Archive &a, oracle::supply_data &sd, const boost::serialization::version_type ver) { - a & sd.fulm; - a & sd.fusd; + a & sd.sal; + a & sd.vsd; } template diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index 30be74017..73125951b 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -1059,10 +1059,10 @@ namespace cryptonote std::string asset_type_from_id(const uint32_t asset_type_id) { switch (asset_type_id) { - case 0x46554c4d: - return "FULM"; - case 0x46555344: - return "FUSD"; + case 0x53414C00: + return "SAL"; + case 0x56534400: + return "VSD"; case 0x4255524E: return "BURN"; case 0x00000000: @@ -1076,10 +1076,10 @@ namespace cryptonote //--------------------------------------------------------------- uint32_t asset_id_from_type(const std::string asset_type) { - if (asset_type == "FULM") { - return 0x46554c4d; - } else if (asset_type == "FUSD") { - return 0x46555344; + if (asset_type == "SAL") { + return 0x53414C00; + } else if (asset_type == "VSD") { + return 0x56534400; } else if (asset_type == "BURN") { return 0x4255524E; } else if (asset_type == "") { @@ -1091,17 +1091,17 @@ namespace cryptonote } //--------------------------------------------------------------- /** - * The various scenarios that are permitted for Fulmo are more extensive than + * The various scenarios that are permitted for Salvium are more extensive than * they are for Zepyhr / Havan. Specifically, we permit: * - * MINER_TX: (SRCG => all fees are to be paid in FULM?) - * - input txin_gen (FULM) - * - outputs txout_to_key (FULM) / txout_to_tagged_key (FULM) + * MINER_TX: (SRCG => all fees are to be paid in SAL?) + * - input txin_gen (SAL) + * - outputs txout_to_key (SAL) / txout_to_tagged_key (SAL) * * PROTOCOL_TX: - * - input txin_gen (FULM) --- ONLY if there are outputs + * - input txin_gen (SAL) --- ONLY if there are outputs * - input void ("") --- ONLY if there are NO outputs - * - outputs txout_to_key (FULM, FUSD) / txout_to_tagged_key (FULM, FUSD) + * - outputs txout_to_key (SAL, VSD) / txout_to_tagged_key (SAL, VSD) * * BURN: * @@ -1123,7 +1123,7 @@ namespace cryptonote LOG_ERROR("txin_gen detected in non-miner TX. Rejecting.."); return false; } - source_asset_types.insert("FULM"); + source_asset_types.insert("SAL"); } else if (tx.vin[i].type() == typeid(txin_to_key)) { source_asset_types.insert(boost::get(tx.vin[i]).asset_type); } else { @@ -1183,7 +1183,7 @@ namespace cryptonote // Handle miner_txs differently - full validation is performed in validate_miner_transaction() if (is_miner_tx) { - destination = "FULM"; + destination = "SAL"; } else { // Sanity check that we only have 1 or 2 destination asset types @@ -1202,7 +1202,7 @@ namespace cryptonote destination = dat[0]; } else { if (sat.size() == 2) { - if (!((dat[0] == "FULM" && dat[1] == "FUSD") || (dat[0] == "FUSD" && dat[1] == "FULM"))) { + if (!((dat[0] == "SAL" && dat[1] == "VSD") || (dat[0] == "VSD" && dat[1] == "SAL"))) { LOG_ERROR("Impossible input asset types. Rejecting.."); return false; } @@ -1560,11 +1560,11 @@ namespace cryptonote return "piconero"; */ case 8: - return "fulmo"; + return "sal"; case 5: - return "millifulmo"; + return "millisal"; case 2: - return "microfulmo"; + return "microsal"; default: ASSERT_MES_AND_THROW("Invalid decimal point specification: " << decimal_point); } diff --git a/src/cryptonote_basic/verification_context.h b/src/cryptonote_basic/verification_context.h index 10a16a8c1..acfb148bb 100644 --- a/src/cryptonote_basic/verification_context.h +++ b/src/cryptonote_basic/verification_context.h @@ -59,6 +59,7 @@ namespace cryptonote bool m_fee_too_low; bool m_too_few_outputs; bool m_tx_extra_too_big; + bool m_invalid_version; }; struct block_verification_context diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 8c6872410..57446b994 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -51,7 +51,7 @@ #define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW 60 // MONEY_SUPPLY - total number coins to be generated -#define MONEY_SUPPLY ((uint64_t)(1800000000000000ull)) +#define MONEY_SUPPLY ((uint64_t)(18440000000000000ull)) // 184.4M coins * pow(10, 8) #define EMISSION_SPEED_FACTOR_PER_MINUTE (20) #define FINAL_SUBSIDY_PER_MINUTE ((uint64_t)30000000) // 3 * pow(10, 7) @@ -69,7 +69,7 @@ // COIN - number of smallest units in one coin #define COIN ((uint64_t)100000000) // pow(10, 8) -#define FEE_PER_KB_OLD ((uint64_t)1000000) // pow(10, 6) +//#define FEE_PER_KB_OLD ((uint64_t)1000000) // pow(10, 6) #define FEE_PER_KB ((uint64_t)200000) // 2 * pow(10, 5) #define FEE_PER_BYTE ((uint64_t)30) #define DYNAMIC_FEE_PER_KB_BASE_FEE ((uint64_t)200000) // 2 * pow(10,5) @@ -79,7 +79,9 @@ #define ORPHANED_BLOCKS_MAX_COUNT 100 -#define PREMINE_AMOUNT ((uint64_t)90000000000000ull) // 5% of supply (9 * pow(10,13)) +#define PREMINE_AMOUNT ((uint64_t)2210000000000000ull) // 12% of MONEY_SUPPLY +#define PREMINE_AMOUNT_UPFRONT ((uint64_t)650000000000000ull) // 3.4% of MONEY_SUPPLY +#define PREMINE_AMOUNT_MONTHLY ((uint64_t)65000000000000ull) // 8.6%/24 of MONEY_SUPPLY #define DIFFICULTY_TARGET_V2 120 // seconds #define DIFFICULTY_TARGET_V1 60 // seconds - before first fork @@ -162,7 +164,7 @@ #define RPC_IP_FAILS_BEFORE_BLOCK 3 -#define CRYPTONOTE_NAME "fulmo" +#define CRYPTONOTE_NAME "salvium" #define CRYPTONOTE_BLOCKCHAINDATA_FILENAME "data.mdb" #define CRYPTONOTE_BLOCKCHAINDATA_LOCK_FILENAME "lock.mdb" #define P2P_NET_DATA_FILENAME "p2pstate.bin" @@ -209,8 +211,9 @@ #define HF_VERSION_LONG_TERM_BLOCK_WEIGHT 2 #define HF_VERSION_VIEW_TAGS 2 #define HF_VERSION_2021_SCALING 2 - -#define HF_VERSION_SLIPPAGE_YIELD 3 +#define HF_VERSION_ENABLE_CONVERT 2 +#define HF_VERSION_ENABLE_ORACLE 2 +#define HF_VERSION_SLIPPAGE_YIELD 2 #define PER_KB_FEE_QUANTIZATION_DECIMALS 8 #define CRYPTONOTE_SCALING_2021_FEE_ROUNDING_PLACES 2 @@ -246,12 +249,9 @@ namespace config uint64_t const DEFAULT_DUST_THRESHOLD = ((uint64_t)2000000000); // 2 * pow(10, 9) uint64_t const BASE_REWARD_CLAMP_THRESHOLD = ((uint64_t)100000000); // pow(10, 8) - uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0x1c1a4a68; // fuLMo - uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 0x1bda4a68; // fuLMoi - uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 0x5bbfa4a68; // fuLMos - //uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 18; - //uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 19; - //uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 42; + uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0x3ef318; // SaLv + uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 0x55ef318; // SaLvi + uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 0xf5ef318; // SaLvs uint16_t const P2P_DEFAULT_PORT = 19080; uint16_t const RPC_DEFAULT_PORT = 19081; uint16_t const ZMQ_RPC_DEFAULT_PORT = 19082; @@ -259,13 +259,13 @@ namespace config 0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10 } }; // Bender's nightmare - std::string const GENESIS_TX = "0201ff000180c09e90acbb14029f396e0265fb259de2dc3b8a956ad177f7432ad72034b1d0d28b1f54b59e64f90446554c4d3c000000000000002101901df6540da088783d037ac5b23f80d3adcbc10d171583480079097aadbe20dc0100"; + std::string const GENESIS_TX = "0201ff000180c0d0c7bbbff60302e03c14d309ba99f81fe1e523cf7bac8cbbb10dcbb9aba66d20c31ec0ff7d0a880353414c3c000000000000002101345d3471cba278cb9969e63704569b2a531f4bd99f75224f6494ed16b966deb40100"; uint32_t const GENESIS_NONCE = 10000; const uint64_t YIELD_LOCK_PERIOD = 5;//30*24*30; - std::string const TREASURY_ADDRESS = "fuLMowH85abK8nz9BBMEem7MAfUbQu4aSHHUV9j5Z86o6Go9Lv2U5ZQiJCWPY9R9HA8p5idburazjAhCqDngLo7fYPCD9ciM9ee1A"; + std::string const TREASURY_ADDRESS = "SaLvdVTaMJp5hrGv2rDWzaCrM6Wrq2T4tNBPX8kvuAJv7iUiYNy4vceFskGRAawnBDiqZ9jWYXZmWemRnEKtWmNMeuSXZg6jwtx"; // Hash domain separators const char HASH_KEY_BULLETPROOF_EXPONENT[] = "bulletproof"; @@ -294,7 +294,7 @@ namespace config // Multisig const uint32_t MULTISIG_MAX_SIGNERS{16}; - std::array const ORACLE_URLS = {{"oracle.fulmo.network:8443", "oracle.fulmo.network:8443", "oracle.fulmo.network:8443"}}; + std::array const ORACLE_URLS = {{"oracle.salvium.network:8443", "oracle.salvium.network:8443", "oracle.salvium.network:8443"}}; std::string const ORACLE_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\n" "MIIDRDCCAjYGByqGSM44BAEwggIpAoIBAQCZP7IJ5PcNvGbWiEqAioKF9wViVxEN\n" @@ -324,9 +324,9 @@ namespace config */ namespace testnet { - uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0xa8bfa4a68; // fuLMot - uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 0x9dbfa4a68; // fuLMoti - uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 0x5a3bfa4a68; // fuLMots + uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0x15beb318; // SaLvT + uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 0xd055eb318; // SaLvTi + uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 0xa59eb318; // SaLvTs uint16_t const P2P_DEFAULT_PORT = 29080; uint16_t const RPC_DEFAULT_PORT = 29081; uint16_t const ZMQ_RPC_DEFAULT_PORT = 29082; @@ -338,7 +338,7 @@ namespace config const uint64_t YIELD_LOCK_PERIOD = 20; - std::array const ORACLE_URLS = {{"oracle.fulmo.network:8443", "oracle.fulmo.network:8443", "oracle.fulmo.network:8443"}}; + std::array const ORACLE_URLS = {{"oracle.salvium.network:8443", "oracle.salvium.network:8443", "oracle.salvium.network:8443"}}; std::string const ORACLE_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\n" "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5YBxWx1AZCA9jTUk8Pr2uZ9jpfRt\n" @@ -350,9 +350,9 @@ namespace config namespace stagenet { - uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0xafb7a4a68; // fuLMoS - uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 0xa4b7a4a68; // fuLMoSi - uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 0xabb7a4a68; // fuLMoSt + uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0x149eb318; // SaLvS + uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 0xf343eb318; // SaLvSi + uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 0x2d47eb318; // SaLvSs uint16_t const P2P_DEFAULT_PORT = 39080; uint16_t const RPC_DEFAULT_PORT = 39081; uint16_t const ZMQ_RPC_DEFAULT_PORT = 39082; @@ -364,7 +364,7 @@ namespace config const uint64_t YIELD_LOCK_PERIOD = 20; - std::array const ORACLE_URLS = {{"oracle.fulmo.network:8443", "oracle.fulmo.network:8443", "oracle.fulmo.network:8443"}}; + std::array const ORACLE_URLS = {{"oracle.salvium.network:8443", "oracle.salvium.network:8443", "oracle.salvium.network:8443"}}; std::string const ORACLE_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\n" "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5YBxWx1AZCA9jTUk8Pr2uZ9jpfRt\n" diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 765135d09..00f447f98 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1457,6 +1457,18 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl money_in_use += o.amount; partial_block_reward = false; + switch (version) { + case HF_VERSION_BULLETPROOF_PLUS: + 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"); + money_in_use += b.miner_tx.amount_burnt; + } + break; + default: + assert(false); + break; + } + uint64_t median_weight = m_current_block_cumul_weight_median; if (!get_block_reward(median_weight, cumulative_block_weight, already_generated_coins, base_reward, version)) { @@ -1577,8 +1589,9 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height, // Get the data for the block that matured this time cryptonote::yield_block_info ybi_matured; - uint64_t start_height = height - get_config(m_nettype).YIELD_LOCK_PERIOD; - bool ok = get_ybi_entry(start_height - 1, ybi_matured); + uint64_t lock_period = get_config(m_nettype).YIELD_LOCK_PERIOD; + uint64_t start_height = (height > lock_period) ? height - lock_period : 0; + bool ok = get_ybi_entry(start_height, ybi_matured); if (ok && ybi_matured.locked_coins_this_block > 0) { // Iterate over the cached data for block yield, calculating the yield payouts due @@ -1868,9 +1881,10 @@ bool Blockchain::create_block_template(block& b, const crypto::hash *from_block, // Check to see if there are any matured YIELD TXs uint64_t yield_lock_period = get_config(m_nettype).YIELD_LOCK_PERIOD; - uint64_t start_height = height - yield_lock_period; + uint64_t start_height = (height > yield_lock_period) ? height - yield_lock_period : 0; + cryptonote::yield_block_info ybi_matured; - bool ok = get_ybi_entry(start_height - 1, ybi_matured); + bool ok = get_ybi_entry(start_height, ybi_matured); if (ok && ybi_matured.locked_coins_this_block > 0) { // Iterate over the cached data for block yield, calculating the yield payouts due @@ -1886,8 +1900,8 @@ bool Blockchain::create_block_template(block& b, const crypto::hash *from_block, entry.amount_burnt = yield_entry.second; entry.amount_minted = 0; entry.amount_slippage_limit = 0; - entry.source_asset = "FULM"; - entry.destination_asset = "FULM"; + entry.source_asset = "SAL"; + entry.destination_asset = "SAL"; entry.return_address = yield_entry.first.return_address; entry.type = cryptonote::transaction_type::YIELD; entry.P_change = yield_entry.first.P_change; @@ -2734,8 +2748,8 @@ bool Blockchain::get_pricing_record(oracle::pricing_record &pr, std::map())); std::string url = "/price?height=" + std::to_string(height); //url += "×tamp=" + boost::lexical_cast(timestamp) + "&version=" + std::to_string(hf_version); - url += "&fulm=" + (circ_supply.count("FULM") ? std::to_string(circ_supply["FULM"]) : "0"); - url += "&fusd=" + (circ_supply.count("FUSD") ? std::to_string(circ_supply["FUSD"]) : "0"); + url += "&sal=" + (circ_supply.count("SAL") ? std::to_string(circ_supply["SAL"]) : "0"); + url += "&vsd=" + (circ_supply.count("VSD") ? std::to_string(circ_supply["VSD"]) : "0"); for (size_t n = 0; n < oracle_urls.size(); n++) { http_client.set_server(oracle_urls[n], boost::none, epee::net_utils::ssl_support_t::e_ssl_support_autodetect); r = epee::net_utils::invoke_http_json(url, req, res, http_client, std::chrono::seconds(10), "GET"); @@ -4869,10 +4883,12 @@ leave: // Update the YBI cache data uint64_t yield_lock_period = cryptonote::get_config(m_nettype).YIELD_LOCK_PERIOD; uint64_t ybi_cache_expected_size = std::min(new_height, yield_lock_period); - if (m_yield_block_info_cache.count(new_height - yield_lock_period) != 0) { - m_yield_block_info_cache.erase(new_height - yield_lock_period); + if (new_height > yield_lock_period) { + if (m_yield_block_info_cache.count(new_height - yield_lock_period - 1) != 0) { + m_yield_block_info_cache.erase(new_height - yield_lock_period - 1); + } } - m_yield_block_info_cache[new_height] = new_ybi; + m_yield_block_info_cache[new_ybi.block_height] = new_ybi; } catch (const KEY_IMAGE_EXISTS& e) { diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index fae874c65..c99a55119 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -1290,6 +1290,9 @@ namespace cryptonote // cache for verifying transaction RCT non semantics mutable rct_ver_cache_t m_rct_ver_cache; + /** + * @brief hashmap linking blockchain height to YBI struct for that height + */ std::map m_yield_block_info_cache; /** diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 34a545dc9..5dc40b188 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project -// Portions Copyright (c) 2023, Fulmo (author: SRCG) +// Portions Copyright (c) 2023, Salvium (author: SRCG) // // All rights reserved. // @@ -151,8 +151,8 @@ namespace cryptonote rate = COIN; return true; } - if ((from_asset == "FULM" && to_asset != "FUSD") || - (from_asset == "FUSD" && to_asset != "FULM")) { + if ((from_asset == "SAL" && to_asset != "VSD") || + (from_asset == "VSD" && to_asset != "SAL")) { // Invalid conversion - abort LOG_ERROR("Invalid conversion (" << from_asset << "," << to_asset << ") - aborting"); return false; @@ -336,10 +336,10 @@ namespace cryptonote txin_gen_totals[entry.destination_asset] += amount_minted; // Add the slippage to our total for the block - if (entry.source_asset == "FULM") { + if (entry.source_asset == "SAL") { slippage_total += amount_slippage; } else { - // Convert the slippage into a FULM amount so we can pay a proportion to the miner + // Convert the slippage into a SAL amount so we can pay a proportion to the miner uint64_t conversion_rate = 0, amount_slippage_converted = 0; ok = get_conversion_rate(pr, entry.source_asset, entry.destination_asset, conversion_rate); CHECK_AND_ASSERT_MES(ok, false, "Failed to get conversion rate for miner payout"); @@ -386,13 +386,13 @@ namespace cryptonote // Calculate the uniqueness crypto::key_image k_image; ec_scalar uniqueness; - CHECK_AND_ASSERT_MES(calculate_uniqueness(tx.type, k_image, height, ((size_t)-1), uniqueness), false, "while constructing miner_tx: failed to calculate uniqueness"); + CHECK_AND_ASSERT_MES(calculate_uniqueness(tx.type, k_image, height, ((size_t)-1), uniqueness), false, "while constructing protocol_tx: failed to calculate uniqueness"); r = crypto::derive_public_key(derivation, uniqueness, miner_address.m_spend_public_key, out_eph_public_key); CHECK_AND_ASSERT_MES(r, false, "while creating outs: failed to derive_public_key(" << derivation << ", " << 0 << ", "<< miner_address.m_spend_public_key << ")"); tx_out out_miner; - cryptonote::set_tx_out(slippage_miner, "FULM", 0, out_eph_public_key, false, crypto::view_tag{}, out_miner); + cryptonote::set_tx_out(slippage_miner, "SAL", 0, out_eph_public_key, false, crypto::view_tag{}, out_miner); tx.vout.push_back(out_miner); // Add a payout for the treasury @@ -406,7 +406,7 @@ namespace cryptonote uint64_t slippage_treasury = slippage_miner >> 1; tx_out out_treasury; - cryptonote::set_tx_out(slippage_treasury, "FULM", 0, out_eph_public_key_treasury, false, crypto::view_tag{}, out_treasury); + cryptonote::set_tx_out(slippage_treasury, "SAL", 0, out_eph_public_key_treasury, false, crypto::view_tag{}, out_treasury); tx.vout.push_back(out_treasury); } @@ -479,12 +479,45 @@ namespace cryptonote crypto::view_tag view_tag; if (use_view_tags) crypto::derive_view_tag(derivation, 0, view_tag); - - tx_out out; - cryptonote::set_tx_out(amount, "FULM", CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, out_eph_public_key, use_view_tags, view_tag, out); - - tx.vout.push_back(out); + // Should we award some of the block reward to the stakers? + if (height != 0) { + + // Different forks take a different proportion of the block_reward for stakers + switch (hard_fork_version) { + case HF_VERSION_BULLETPROOF_PLUS: + // MVP - 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; + amount -= tx.amount_burnt; + break; + default: + assert(false); + } + + tx_out out; + cryptonote::set_tx_out(amount, "SAL", CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, out_eph_public_key, use_view_tags, view_tag, out); + tx.vout.push_back(out); + + } else { + + // Genesis TX - create the necessary distribution for Salvium seed funds + tx_out out; + cryptonote::set_tx_out(PREMINE_AMOUNT, "SAL", CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, out_eph_public_key, use_view_tags, view_tag, out); + tx.vout.push_back(out); + /* + tx_out out; + cryptonote::set_tx_out(PREMINE_AMOUNT_UPFRONT, "SAL", CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, out_eph_public_key, use_view_tags, view_tag, out); + tx.vout.push_back(out); + + for (size_t i=1; i<=24; ++i) { + tx_out out_monthly; + cryptonote::set_tx_out(PREMINE_AMOUNT_MONTHLY, "SAL", i*21600, out_eph_public_key, use_view_tags, view_tag, out_monthly); + tx.vout.push_back(out_monthly); + } + */ + } + CHECK_AND_ASSERT_MES(summary_amounts == block_reward, false, "Failed to construct miner tx, summary_amounts = " << summary_amounts << " not equal block_reward = " << block_reward); tx.version = 2; diff --git a/src/cryptonote_core/cryptonote_tx_utils.h b/src/cryptonote_core/cryptonote_tx_utils.h index 41e8ffbc8..a29df9cfa 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.h +++ b/src/cryptonote_core/cryptonote_tx_utils.h @@ -118,7 +118,7 @@ namespace cryptonote bool is_integrated; bool is_change; - tx_destination_entry() : amount(0), slippage_limit(0), addr(AUTO_VAL_INIT(addr)), asset_type("FULM"), is_subaddress(false), is_integrated(false), is_change(false) { } + tx_destination_entry() : amount(0), slippage_limit(0), addr(AUTO_VAL_INIT(addr)), asset_type("SAL"), is_subaddress(false), is_integrated(false), is_change(false) { } tx_destination_entry(uint64_t a, const account_public_address &ad, bool is_subaddress) : amount(a), slippage_limit(0), addr(ad), is_subaddress(is_subaddress), is_integrated(false), is_change(false) { } tx_destination_entry(const std::string &o, uint64_t a, const account_public_address &ad, bool is_subaddress) : original(o), amount(a), slippage_limit(0), addr(ad), is_subaddress(is_subaddress), is_integrated(false) { } diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index a323ec6d2..d5c7483f0 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -139,6 +139,13 @@ namespace cryptonote { const bool kept_by_block = (tx_relay == relay_method::block); + if(tx.type == cryptonote::transaction_type::CONVERT && version < HF_VERSION_ENABLE_CONVERT) + { + tvc.m_verifivation_failed = true; + tvc.m_invalid_version = true; + return false; + } + // this should already be called with that lock, but let's make it explicit for clarity CRITICAL_REGION_LOCAL(m_transactions_lock); diff --git a/src/cryptonote_protocol/enums.h b/src/cryptonote_protocol/enums.h index 774b0ff18..877c4e4eb 100644 --- a/src/cryptonote_protocol/enums.h +++ b/src/cryptonote_protocol/enums.h @@ -51,6 +51,7 @@ namespace cryptonote TRANSFER = 3, CONVERT = 4, BURN = 5, - YIELD = 6 + YIELD = 6, + RETURN = 7 }; } diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index f929c040b..295c2c7b1 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -71,5 +71,5 @@ target_link_libraries(daemon ${Blocks}) set_property(TARGET daemon PROPERTY - OUTPUT_NAME "fulmod") + OUTPUT_NAME "salviumd") install(TARGETS daemon DESTINATION bin) diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h index 6e27c1972..804290a50 100644 --- a/src/daemon/command_line_args.h +++ b/src/daemon/command_line_args.h @@ -35,7 +35,7 @@ namespace daemon_args { - std::string const WINDOWS_SERVICE_NAME = "Fulmo Daemon"; + std::string const WINDOWS_SERVICE_NAME = "Salvium Daemon"; const command_line::arg_descriptor arg_config_file = { "config-file" diff --git a/src/daemon/command_server.cpp b/src/daemon/command_server.cpp index 6a9b0ecb6..93825bb6b 100644 --- a/src/daemon/command_server.cpp +++ b/src/daemon/command_server.cpp @@ -412,7 +412,7 @@ bool t_command_server::apropos(const std::vector& args) std::string t_command_server::get_commands_str() { std::stringstream ss; - ss << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << std::endl; + ss << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << std::endl; ss << "Commands: " << std::endl; std::string usage = m_command_lookup.get_usage(); boost::replace_all(usage, "\n", "\n "); diff --git a/src/daemon/executor.cpp b/src/daemon/executor.cpp index 1b88cffc7..33e794e3e 100644 --- a/src/daemon/executor.cpp +++ b/src/daemon/executor.cpp @@ -40,7 +40,7 @@ namespace daemonize { - std::string const t_executor::NAME = "Fulmo Daemon"; + std::string const t_executor::NAME = "Salvium Daemon"; void t_executor::init_options( boost::program_options::options_description & configurable_options @@ -58,7 +58,7 @@ namespace daemonize boost::program_options::variables_map const & vm ) { - LOG_PRINT_L0("Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ") Daemonised"); + LOG_PRINT_L0("Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ") Daemonised"); return t_daemon{vm, public_rpc_port}; } diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index e338cf5e5..9ee2aa824 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -241,7 +241,7 @@ int main(int argc, char const * argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << "Usage: " + std::string{argv[0]} + " [options|settings] [daemon_command...]" << std::endl << std::endl; std::cout << visible_options << std::endl; return 0; @@ -250,7 +250,7 @@ int main(int argc, char const * argv[]) // Monero Version if (command_line::get_arg(vm, command_line::arg_version)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL; return 0; } @@ -351,7 +351,7 @@ int main(int argc, char const * argv[]) tools::set_max_concurrency(command_line::get_arg(vm, daemon_args::arg_max_concurrency)); // logging is now set up - MGINFO("Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")"); + MGINFO("Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")"); // If there are positional options, we're running a daemon command { diff --git a/src/daemonizer/posix_daemonizer.inl b/src/daemonizer/posix_daemonizer.inl index 202df6be2..a6f367203 100644 --- a/src/daemonizer/posix_daemonizer.inl +++ b/src/daemonizer/posix_daemonizer.inl @@ -100,7 +100,7 @@ namespace daemonizer } else { - //LOG_PRINT_L0("Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL); + //LOG_PRINT_L0("Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL); return executor.run_interactive(vm); } } diff --git a/src/daemonizer/windows_daemonizer.inl b/src/daemonizer/windows_daemonizer.inl index f7fbf1605..9ba250066 100644 --- a/src/daemonizer/windows_daemonizer.inl +++ b/src/daemonizer/windows_daemonizer.inl @@ -181,7 +181,7 @@ namespace daemonizer } else // interactive { - //LOG_PRINT_L0("Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL); + //LOG_PRINT_L0("Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL); if (command_line::has_arg(vm, arg_non_interactive)) return executor.run_non_interactive(vm); else diff --git a/src/debug_utilities/CMakeLists.txt b/src/debug_utilities/CMakeLists.txt index ecb0f0229..66ac6477c 100644 --- a/src/debug_utilities/CMakeLists.txt +++ b/src/debug_utilities/CMakeLists.txt @@ -46,7 +46,7 @@ target_link_libraries(cn_deserialize set_property(TARGET cn_deserialize PROPERTY - OUTPUT_NAME "monero-utils-deserialize") + OUTPUT_NAME "salvium-utils-deserialize") set(object_sizes_sources @@ -67,7 +67,7 @@ target_link_libraries(object_sizes set_property(TARGET object_sizes PROPERTY - OUTPUT_NAME "monero-utils-object-sizes") + OUTPUT_NAME "salvium-utils-object-sizes") set(dns_checks_sources @@ -89,5 +89,5 @@ target_link_libraries(dns_checks set_property(TARGET dns_checks PROPERTY - OUTPUT_NAME "monero-utils-dns-checks") + OUTPUT_NAME "salvium-utils-dns-checks") diff --git a/src/debug_utilities/cn_deserialize.cpp b/src/debug_utilities/cn_deserialize.cpp index 6d64926f5..2b5f872d6 100644 --- a/src/debug_utilities/cn_deserialize.cpp +++ b/src/debug_utilities/cn_deserialize.cpp @@ -103,7 +103,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/debug_utilities/dns_checks.cpp b/src/debug_utilities/dns_checks.cpp index f7a21f36b..2412fff9b 100644 --- a/src/debug_utilities/dns_checks.cpp +++ b/src/debug_utilities/dns_checks.cpp @@ -121,7 +121,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/gen_multisig/CMakeLists.txt b/src/gen_multisig/CMakeLists.txt index de35c94fc..41fedd665 100644 --- a/src/gen_multisig/CMakeLists.txt +++ b/src/gen_multisig/CMakeLists.txt @@ -50,5 +50,5 @@ add_dependencies(gen_multisig version) set_property(TARGET gen_multisig PROPERTY - OUTPUT_NAME "fulmo-gen-trusted-multisig") + OUTPUT_NAME "salvium-gen-trusted-multisig") install(TARGETS gen_multisig DESTINATION bin) diff --git a/src/gen_ssl_cert/CMakeLists.txt b/src/gen_ssl_cert/CMakeLists.txt index 7a219a121..6f57ff923 100644 --- a/src/gen_ssl_cert/CMakeLists.txt +++ b/src/gen_ssl_cert/CMakeLists.txt @@ -45,5 +45,5 @@ add_dependencies(gen_ssl_cert version) set_property(TARGET gen_ssl_cert PROPERTY - OUTPUT_NAME "fulmo-gen-ssl-cert") + OUTPUT_NAME "salvium-gen-ssl-cert") install(TARGETS gen_ssl_cert DESTINATION bin) diff --git a/src/gen_ssl_cert/gen_ssl_cert.cpp b/src/gen_ssl_cert/gen_ssl_cert.cpp index 1d97edd0d..de9d3f946 100644 --- a/src/gen_ssl_cert/gen_ssl_cert.cpp +++ b/src/gen_ssl_cert/gen_ssl_cert.cpp @@ -121,13 +121,13 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 0; } if (command_line::get_arg(vm, command_line::arg_version)) { - std::cout << "Fulmo '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL; + std::cout << "Salvium '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL; return 0; } diff --git a/src/multisig/multisig.cpp b/src/multisig/multisig.cpp index 6fdb71fd6..4064dbf36 100644 --- a/src/multisig/multisig.cpp +++ b/src/multisig/multisig.cpp @@ -100,7 +100,7 @@ namespace multisig cryptonote::keypair in_ephemeral; //crypto::hash uniqueness = crypto::cn_fast_hash(reinterpret_cast(&real_output_index), sizeof(size_t)); - // Populate this struct if you want to make use of multisig for Fulmo!!! + // Populate this struct if you want to make use of multisig for Salvium!!! assert(false); cryptonote::origin_data origin_tx_data; diff --git a/src/multisig/multisig_tx_builder_ringct.cpp b/src/multisig/multisig_tx_builder_ringct.cpp index fd443a4b7..7b2e08513 100644 --- a/src/multisig/multisig_tx_builder_ringct.cpp +++ b/src/multisig/multisig_tx_builder_ringct.cpp @@ -109,7 +109,7 @@ static bool compute_keys_for_sources( if (src.real_output >= src.outputs.size()) return false; - // Populate this struct if you want to make use of multisig for Fulmo!!! + // Populate this struct if you want to make use of multisig for Salvium!!! assert(false); cryptonote::origin_data origin_tx_data; @@ -514,7 +514,7 @@ static bool set_tx_outputs(const rct::keyV& output_public_keys, cryptonote::tran const std::size_t num_destinations = output_public_keys.size(); unsigned_tx.vout.resize(num_destinations); for (std::size_t i = 0; i < num_destinations; ++i) - cryptonote::set_tx_out(0, "FULM", 0, rct::rct2pk(output_public_keys[i]), false, crypto::view_tag{}, unsigned_tx.vout[i]); + cryptonote::set_tx_out(0, "SAL", 0, rct::rct2pk(output_public_keys[i]), false, crypto::view_tag{}, unsigned_tx.vout[i]); return true; } @@ -536,7 +536,7 @@ static bool set_tx_outputs_with_view_tags( "multisig signing protocol: internal error, view tag size mismatch."); unsigned_tx.vout.resize(num_destinations); for (std::size_t i = 0; i < num_destinations; ++i) - cryptonote::set_tx_out(0, "FULM", 0, rct::rct2pk(output_public_keys[i]), true, view_tags[i], unsigned_tx.vout[i]); + cryptonote::set_tx_out(0, "SAL", 0, rct::rct2pk(output_public_keys[i]), true, view_tags[i], unsigned_tx.vout[i]); return true; } diff --git a/src/oracle/asset_types.h b/src/oracle/asset_types.h index 5da714859..b5ec5c997 100644 --- a/src/oracle/asset_types.h +++ b/src/oracle/asset_types.h @@ -31,7 +31,7 @@ namespace oracle { - const std::vector ASSET_TYPES = {"FULM", "FUSD", "BURN"}; + const std::vector ASSET_TYPES = {"SAL", "VSD", "BURN"}; class asset_type_counts { @@ -39,23 +39,23 @@ namespace oracle { public: // Fields - uint64_t FULM; - uint64_t FUSD; + uint64_t SAL; + uint64_t VSD; uint64_t BURN; asset_type_counts() noexcept - : FULM(0) - , FUSD(0) + : SAL(0) + , VSD(0) , BURN(0) { } uint64_t operator[](const std::string asset_type) const noexcept { - if (asset_type == "FULM") { - return FULM; - } else if (asset_type == "FUSD") { - return FUSD; + if (asset_type == "SAL") { + return SAL; + } else if (asset_type == "VSD") { + return VSD; } else if (asset_type == "BURN") { return BURN; } @@ -65,10 +65,10 @@ namespace oracle { void add(const std::string asset_type, const uint64_t val) { - if (asset_type == "FULM") { - FULM += val; - } else if (asset_type == "FUSD") { - FUSD += val; + if (asset_type == "SAL") { + SAL += val; + } else if (asset_type == "VSD") { + VSD += val; } else if (asset_type == "BURN") { BURN += val; } diff --git a/src/oracle/pricing_record.cpp b/src/oracle/pricing_record.cpp index 6623e2456..392435639 100644 --- a/src/oracle/pricing_record.cpp +++ b/src/oracle/pricing_record.cpp @@ -54,12 +54,12 @@ namespace oracle struct supply_data_serialized { - uint64_t FULM; - uint64_t FUSD; + uint64_t SAL; + uint64_t VSD; BEGIN_KV_SERIALIZE_MAP() - KV_SERIALIZE(FULM) - KV_SERIALIZE(FUSD) + KV_SERIALIZE(SAL) + KV_SERIALIZE(VSD) END_KV_SERIALIZE_MAP() }; @@ -103,8 +103,8 @@ namespace oracle if (in._load(src, hparent)) { // Copy everything into the local instance - fulm = in.FULM; - fusd = in.FUSD; + sal = in.SAL; + vsd = in.VSD; return true; } // Report error here? @@ -113,7 +113,7 @@ namespace oracle bool supply_data::store(epee::serialization::portable_storage& dest, epee::serialization::section* hparent) const { - const supply_data_serialized out{fulm, fusd}; + const supply_data_serialized out{sal, vsd}; return out.store(dest, hparent); } @@ -241,7 +241,7 @@ namespace oracle std::ostringstream oss; oss << "{\"pr_version\":" << pr_version; oss << ",\"height\":" << height; - oss << ",\"supply\":{\"FULM\":" << supply.fulm <<",\"FUSD\":" << supply.fusd << "}"; + oss << ",\"supply\":{\"SAL\":" << supply.sal <<",\"VSD\":" << supply.vsd << "}"; oss << ",\"assets\":["; bool first = true; for (const auto& asset: assets) { diff --git a/src/oracle/pricing_record.h b/src/oracle/pricing_record.h index d23ddc609..744b4757b 100644 --- a/src/oracle/pricing_record.h +++ b/src/oracle/pricing_record.h @@ -67,8 +67,8 @@ namespace oracle #pragma pack(pop) struct supply_data { - uint64_t fulm; - uint64_t fusd; + uint64_t sal; + uint64_t vsd; //! Load from epee p2p format bool _load(epee::serialization::portable_storage& src, epee::serialization::section* hparent); @@ -76,15 +76,15 @@ namespace oracle bool store(epee::serialization::portable_storage& dest, epee::serialization::section* hparent) const; BEGIN_SERIALIZE_OBJECT() - VARINT_FIELD(fulm) - VARINT_FIELD(fusd) + VARINT_FIELD(sal) + VARINT_FIELD(vsd) END_SERIALIZE() }; inline bool operator==(const supply_data& a, const supply_data& b) noexcept { - return (a.fulm == b.fulm && - a.fusd == b.fusd); + return (a.sal == b.sal && + a.vsd == b.vsd); } struct asset_data { diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index 7e741f867..5958c66ba 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -1287,14 +1287,15 @@ namespace rct { rv.p.MGs.resize(inamounts.size()); key sumpouts = zero(); //sum pseudoOut masks keyV a(inamounts.size()); - for (i = 0 ; i < inamounts.size() - 1; i++) { + for (i = 0 ; i < inamounts.size(); i++) { skGen(a[i]); sc_add(sumpouts.bytes, a[i].bytes, sumpouts.bytes); genC(pseudoOuts[i], a[i], inamounts[i]); } - sc_sub(a[i].bytes, sumout.bytes, sumpouts.bytes); - genC(pseudoOuts[i], a[i], inamounts[i]); - DP(pseudoOuts[i]); + key difference; + sc_sub(difference.bytes, sumpouts.bytes, sumout.bytes); + genC(rv.p_r, difference, 0); + DP(rv.p_r); key full_message = get_pre_mlsag_hash(rv,hwdev); @@ -1478,7 +1479,10 @@ namespace rct { const key txnAmountBurntKey = scalarmultH(d2h(amount_burnt)); addKeys(sumOutpks, txnAmountBurntKey, sumOutpks); - + + // Account for the "blinding factor remainder" term `p_r` + addKeys(sumOutpks, rv.p_r, sumOutpks); + key sumPseudoOuts = addKeys(pseudoOuts); DP(sumPseudoOuts); diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h index ab1a26b26..eb523e6eb 100644 --- a/src/ringct/rctTypes.h +++ b/src/ringct/rctTypes.h @@ -324,6 +324,7 @@ namespace rct { std::vector ecdhInfo; ctkeyV outPk; xmr_amount txnFee; // contains b + key p_r; template class Archive> bool serialize_rctsig_base(Archive &ar, size_t inputs, size_t outputs) @@ -390,6 +391,7 @@ namespace rct { ar.delimit_array(); } ar.end_array(); + FIELD(p_r) return ar.good(); } @@ -401,6 +403,7 @@ namespace rct { FIELD(ecdhInfo) FIELD(outPk) VARINT_FIELD(txnFee) + FIELD(p_r) END_SERIALIZE() }; struct rctSigPrunable { diff --git a/src/serialization/json_object.cpp b/src/serialization/json_object.cpp index 46ffbc604..5e0aac4bd 100644 --- a/src/serialization/json_object.cpp +++ b/src/serialization/json_object.cpp @@ -1136,8 +1136,8 @@ void toJsonValue(rapidjson::Writer& dest, const oracle::suppl { dest.StartObject(); - INSERT_INTO_JSON_OBJECT(dest, fulm, supply_data.fulm); - INSERT_INTO_JSON_OBJECT(dest, fusd, supply_data.fusd); + INSERT_INTO_JSON_OBJECT(dest, sal, supply_data.sal); + INSERT_INTO_JSON_OBJECT(dest, vsd, supply_data.vsd); dest.EndObject(); } @@ -1149,8 +1149,8 @@ void fromJsonValue(const rapidjson::Value& val, oracle::supply_data& supply_data throw WRONG_TYPE("json object"); } - GET_FROM_JSON_OBJECT(val, supply_data.fulm, fulm); - GET_FROM_JSON_OBJECT(val, supply_data.fusd, fusd); + GET_FROM_JSON_OBJECT(val, supply_data.sal, sal); + GET_FROM_JSON_OBJECT(val, supply_data.vsd, vsd); } void toJsonValue(rapidjson::Writer& dest, const oracle::asset_data& asset_data) diff --git a/src/serialization/pricing_record.h b/src/serialization/pricing_record.h index 3e7cf02c4..f9afb53ce 100644 --- a/src/serialization/pricing_record.h +++ b/src/serialization/pricing_record.h @@ -41,10 +41,10 @@ template