From 6a52ded8035243261588ccdfc4b0cd1844ca153c Mon Sep 17 00:00:00 2001 From: Liquid369 <45834289+Liquid369@users.noreply.github.com> Date: Tue, 13 Jul 2021 15:11:14 -0500 Subject: [PATCH 1/6] [GUI] Disable LightTheme --- src/qt/rbx/topbar.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/qt/rbx/topbar.cpp b/src/qt/rbx/topbar.cpp index c60989f6d..d3aa2af86 100644 --- a/src/qt/rbx/topbar.cpp +++ b/src/qt/rbx/topbar.cpp @@ -121,6 +121,7 @@ TopBar::TopBar(RBXGUI* _mainWindow, QWidget *parent) : ui->pushButtonTheme->setButtonClassStyle("cssClass", "btn-check-theme-dark"); ui->pushButtonTheme->setButtonText(tr("Dark Theme")); + ui->pushButtonTheme->setVisible(false); setCssProperty(ui->qrContainer, "container-qr"); setCssProperty(ui->pushButtonQR, "btn-qr"); @@ -160,14 +161,6 @@ void TopBar::onThemeClicked() bool lightTheme = false; setTheme(lightTheme); - - if (lightTheme) { - ui->pushButtonTheme->setButtonClassStyle("cssClass", "btn-check-theme-light", true); - ui->pushButtonTheme->setButtonText(tr("Light Theme")); - } else { - ui->pushButtonTheme->setButtonClassStyle("cssClass", "btn-check-theme-dark", true); - ui->pushButtonTheme->setButtonText(tr("Dark Theme")); - } updateStyle(ui->pushButtonTheme); Q_EMIT themeChanged(lightTheme); From 20cc91bed172e1e6ed4ef491c42d8f636584e090 Mon Sep 17 00:00:00 2001 From: Liquid369 <45834289+Liquid369@users.noreply.github.com> Date: Wed, 14 Jul 2021 09:02:32 -0500 Subject: [PATCH 2/6] Fix MN Subsidy --- src/validation.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index da720199b..3ee434268 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -850,7 +850,6 @@ int64_t GetMasternodePayment(int nHeight) if (nSubsidy == 0) return 0; ret = nSubsidy * 0.8; - ret = 4.48 * COIN; return ret; From a1a0f21bde67ae520cf3ab2c84ea92816342f296 Mon Sep 17 00:00:00 2001 From: Rubus <53187582+Simple-Software-Solutions@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:30:20 +0100 Subject: [PATCH 3/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a27de172..446273387 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Rubus is an open source community-driven cryptocurrency, focused on five main as (5) Ease of Use: Rubus is determined to offer the best possible graphical interface for a core node/wallet. A full featured graphical product for new and advanced users. -A lot more information and specs at [rubus.io](https://www.rubus.io/). Join the community at [Rubus Discord](https://discordapp.com/invite/jzqVsJd). +A lot more information and specs at [rubus.io](https://www.rubus.network). Join the community at [Rubus Discord](https://discordapp.com/invite/jzqVsJd). ## License Rubus Core is released under the terms of the MIT license. See [COPYING](https://github.com/flitsnode/Rubus-core/blob/master/COPYING) for more information or see https://opensource.org/licenses/MIT. From ab96c299a582236010d520b100522e9d66696234 Mon Sep 17 00:00:00 2001 From: Rubus <53187582+Simple-Software-Solutions@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:30:42 +0100 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 446273387..0aa974bc3 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Rubus is an open source community-driven cryptocurrency, focused on five main as (5) Ease of Use: Rubus is determined to offer the best possible graphical interface for a core node/wallet. A full featured graphical product for new and advanced users. -A lot more information and specs at [rubus.io](https://www.rubus.network). Join the community at [Rubus Discord](https://discordapp.com/invite/jzqVsJd). +A lot more information and specs at [rubus.network](https://www.rubus.network). Join the community at [Rubus Discord](https://discordapp.com/invite/jzqVsJd). ## License Rubus Core is released under the terms of the MIT license. See [COPYING](https://github.com/flitsnode/Rubus-core/blob/master/COPYING) for more information or see https://opensource.org/licenses/MIT. From b7ea16d4a88a07811db6000c36f06f32019c38e9 Mon Sep 17 00:00:00 2001 From: Liquid369 <45834289+Liquid369@users.noreply.github.com> Date: Wed, 14 Jul 2021 12:32:07 -0500 Subject: [PATCH 5/6] Update links --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0aa974bc3..95c7b6c73 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ Rubus Core integration/staging repository ===================================== -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/flitsnode/Rubus-core?color=%23365ace&cacheSeconds=3600)](https://github.com/flitsnode/Rubus-core/releases) -[![GitHub Release Date](https://img.shields.io/github/release-date/flitsnode/Rubus-core?color=%23365ace&cacheSeconds=3600)](https://github.com/flitsnode/Rubus-core/releases) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Simple-Software-Solutions/Rubus-core?color=%23365ace&cacheSeconds=3600)](https://github.com/Simple-Software-Solutions/Rubus-core/releases) +[![GitHub Release Date](https://img.shields.io/github/release-date/Simple-Software-Solutions/Rubus-core?color=%23365ace&cacheSeconds=3600)](https://github.com/Simple-Software-Solutions/Rubus-core/releases) ## What is RBX? @@ -21,13 +21,13 @@ Rubus is an open source community-driven cryptocurrency, focused on five main as A lot more information and specs at [rubus.network](https://www.rubus.network). Join the community at [Rubus Discord](https://discordapp.com/invite/jzqVsJd). ## License -Rubus Core is released under the terms of the MIT license. See [COPYING](https://github.com/flitsnode/Rubus-core/blob/master/COPYING) for more information or see https://opensource.org/licenses/MIT. +Rubus Core is released under the terms of the MIT license. See [COPYING](https://github.com/Simple-Software-Solutions/Rubus-core/blob/master/COPYING) for more information or see https://opensource.org/licenses/MIT. ## Development Process -The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be completely stable. [Tags](https://github.com/flitsnode/Rubus-core/tags) are created regularly from release branches to indicate new official, stable release versions of Rubus Core. +The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be completely stable. [Tags](https://github.com/Simple-Software-Solutions/Rubus-core/tags) are created regularly from release branches to indicate new official, stable release versions of Rubus Core. -The contribution workflow is described in [CONTRIBUTING.md](https://github.com/flitsnode/Rubus-core/blob/master/CONTRIBUTING.md) and useful hints for developers can be found in [doc/developer-notes.md](https://github.com/flitsnode/Rubus-core/blob/master/doc/developer-notes.md). +The contribution workflow is described in [CONTRIBUTING.md](https://github.com/Simple-Software-Solutions/Rubus-core/blob/master/CONTRIBUTING.md) and useful hints for developers can be found in [doc/developer-notes.md](https://github.com/Simple-Software-Solutions/Rubus-core/blob/master/doc/developer-notes.md). ## Testing @@ -35,7 +35,7 @@ Testing and code review is the bottleneck for development; we get more pull requ ## Automated Testing -Developers are strongly encouraged to write [unit tests](https://github.com/flitsnode/Rubus-core/blob/master/src/test/README.md) for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in [/src/test/README.md](https://github.com/flitsnode/Rubus-core/blob/master/src/test/README.md). +Developers are strongly encouraged to write [unit tests](https://github.com/Simple-Software-Solutions/Rubus-core/blob/master/src/test/README.md) for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in [/src/test/README.md](https://github.com/Simple-Software-Solutions/Rubus-core/blob/master/src/test/README.md). There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py` From 9992ba595d0aff1a3e38a12041cb5f0550697b48 Mon Sep 17 00:00:00 2001 From: Liquid369 <45834289+Liquid369@users.noreply.github.com> Date: Wed, 14 Jul 2021 12:35:11 -0500 Subject: [PATCH 6/6] [RPC] Add Burn --- src/wallet/rpcwallet.cpp | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 7ce357502..6996c1add 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3704,6 +3704,84 @@ UniValue settxfee(const JSONRPCRequest& request) return true; } +void BurnMoney(const CScript scriptPubKeyIn, CAmount nValue, CTransactionRef& tx, bool fUseIX = false) +{ + // Check amount + if (nValue <= 0) + throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid amount"); + + if (nValue > pwalletMain->GetAvailableBalance()) + throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds"); + + std::string strError; + if (pwalletMain->IsLocked()) { + strError = "Error: Wallet locked, unable to create transaction!"; + LogPrintf("BurnMoney() : %s", strError); + throw JSONRPCError(RPC_WALLET_ERROR, strError); + } + + // Get scriptPubKey + CScript scriptPubKey = scriptPubKeyIn; + + // Create and send the transaction + CReserveKey reservekey(pwalletMain); + CAmount nFeeRequired; + if (!pwalletMain->CreateTransaction(scriptPubKey, nValue, tx, reservekey, nFeeRequired, strError, nullptr, ALL_COINS, (CAmount)0)) { + if (nValue + nFeeRequired > pwalletMain->GetAvailableBalance()) + strError = strprintf("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!", FormatMoney(nFeeRequired)); + LogPrintf("BurnMoney() : %s\n", strError); + throw JSONRPCError(RPC_WALLET_ERROR, strError); + } + + const CWallet::CommitResult&& res = pwalletMain->CommitTransaction(tx, reservekey, g_connman.get()); + if (res.status != CWallet::CommitStatus::OK) + throw JSONRPCError(RPC_WALLET_ERROR, res.ToString()); +} + +UniValue burn(const UniValue& params, bool fHelp) +{ + if (fHelp || params.size() < 1 || params.size() > 2) + throw std::runtime_error( + "burn [\"optional string\"]\n" + "This command is used to burn RBX and optionally write custom data into the burn transaction, \n" + " is real and is rounded to the nearest zen (ex: 0.00000001).\n" + "You may use 0 as the to skip a specific burn amount, for only writing data into the chain." + + HelpRequiringPassphrase()); + + CScript scriptPubKey; + + if (params.size() > 1) { + std::vector data; + if (params[1].get_str().size() > 0) { + // Parse plain-text string into HEX, then HEX to HEX-Vector + data = ParseHexV(HexStr(params[1].get_str()), "data"); + // Ensure the data is under the maximum OP_RETURN relay (Minus overhead) + if (data.size() > MAX_OP_RETURN_RELAY - 3) + throw std::runtime_error("Your custom data (worth " + std::to_string(data.size()) + " bytes) exceeds the maximum relay of " + std::to_string(MAX_OP_RETURN_RELAY - 3) + " bytes!"); + } else { + // Empty data is valid, but cannot have a zero-value burn + if (params[0].get_real() == 0) + throw std::runtime_error("You cannot create a zero-value burn transaction without custom data!"); + } + scriptPubKey = CScript() << OP_RETURN << data; + } else { + if (params[0].get_real() == 0) + throw std::runtime_error("You cannot create a zero-value burn transaction without custom data!"); + scriptPubKey = CScript() << OP_RETURN; + } + + // Amount (Use parameter if it's larger than 0, else, use a single zen) + int64_t nAmount = AmountFromValue(params[0].get_real() > 0 ? params[0] : 0.00000001); + CTxDestination address1; + CTransactionRef tx; + BurnMoney(scriptPubKey, nAmount, tx, false); + + EnsureWalletIsUnlocked(); + CWalletTx& wtx = pwalletMain->mapWallet.at(tx->GetHash()); + return wtx.GetHash().GetHex(); +} + + UniValue getwalletinfo(const JSONRPCRequest& request) { if (request.fHelp || request.params.size() != 0) @@ -4196,6 +4274,7 @@ extern UniValue dumpwallet(const JSONRPCRequest& request); extern UniValue importwallet(const JSONRPCRequest& request); extern UniValue bip38encrypt(const JSONRPCRequest& request); extern UniValue bip38decrypt(const JSONRPCRequest& request); +extern UniValue burn(const UniValue& params, bool fHelp); extern UniValue exportsaplingkey(const JSONRPCRequest& request); extern UniValue importsaplingkey(const JSONRPCRequest& request);