diff --git a/src/key_io.cpp b/src/key_io.cpp index bc7392988..a3daaa4ed 100644 --- a/src/key_io.cpp +++ b/src/key_io.cpp @@ -1233,6 +1233,7 @@ CScript CIdentity::IdentityUpdateOutputScript(uint32_t height, const std::vector if (IsRevoked()) { + // TODO: HARDENING for next testnet reset and mainnet release version, remove primary when revoked ret = MakeMofNCCScript(1, primary, recovery, indexDests); } else diff --git a/src/pbaas/identity.cpp b/src/pbaas/identity.cpp index dedc438f6..63c1e556e 100644 --- a/src/pbaas/identity.cpp +++ b/src/pbaas/identity.cpp @@ -2154,7 +2154,7 @@ bool PrecheckIdentityPrimary(const CTransaction &tx, int32_t outNum, CValidation // consider the signature unfulfilled if ((PBAAS_TESTMODE && (!(IsVerusActive() || ConnectedChains.ThisChain().name == "Gravity") || height >= TESTNET_FORK_HEIGHT)) && identity.HasTokenizedControl()) { - if (!(oneP.m == 1 && oneP.n > 1)) + if (!(oneP.m == 1 && oneP.n >= oneP.m)) { std::string errorOut = "Invalid spend condition for tokenized control in: \"" + identity.name + "\""; return state.Error(errorOut.c_str()); diff --git a/src/pbaas/pbaas.cpp b/src/pbaas/pbaas.cpp index a5ff1dd33..94e01fe64 100644 --- a/src/pbaas/pbaas.cpp +++ b/src/pbaas/pbaas.cpp @@ -1900,27 +1900,24 @@ bool PrecheckCurrencyDefinition(const CTransaction &spendingTx, int32_t outNum, newCurrency.OPTION_GATEWAY_CONVERTER) && newCurrency.IsToken(); - if (newCurrency.nativeCurrencyID.TypeNoFlags() == newCurrency.nativeCurrencyID.DEST_ETHNFT && - !(isNFTMappedCurrency && + if (!(newCurrency.nativeCurrencyID.TypeNoFlags() == newCurrency.nativeCurrencyID.DEST_ETHNFT && + isNFTMappedCurrency && systemDef.proofProtocol == systemDef.PROOF_ETHNOTARIZATION && systemDef.IsGateway() && newCurrency.maxPreconvert.size() == 1 && newCurrency.maxPreconvert[0] == 0 && - newCurrency.GetTotalPreallocation() == 0)) - { - return state.Error("NFT mapped currency must have only 0 satoshi of supply and follow all definition rules"); - } - else if (newCurrency.IsNFTToken() && - !(isNFTMappedCurrency && - newCurrency.systemID == ASSETCHAINS_CHAINID && - ((newCurrency.GetTotalPreallocation() == 0 && - newCurrency.maxPreconvert.size() == 1 && - newCurrency.maxPreconvert[0] == 1) || - (newCurrency.GetTotalPreallocation() == 1 && - newCurrency.maxPreconvert.size() == 1 && - newCurrency.maxPreconvert[0] == 0)))) - { - return state.Error("Tokenized ID currency must have only 1 satoshi of supply as preallocation or convertible and follow all definition rules"); + newCurrency.GetTotalPreallocation() == 0) && + !(newCurrency.IsNFTToken() && + isNFTMappedCurrency && + newCurrency.systemID == ASSETCHAINS_CHAINID && + ((newCurrency.GetTotalPreallocation() == 0 && + newCurrency.maxPreconvert.size() == 1 && + newCurrency.maxPreconvert[0] == 1) || + (newCurrency.GetTotalPreallocation() == 1 && + newCurrency.maxPreconvert.size() == 1 && + newCurrency.maxPreconvert[0] == 0)))) + { + return state.Error("NFT mapped currency must have only " + std::string(newCurrency.nativeCurrencyID.TypeNoFlags() == newCurrency.nativeCurrencyID.DEST_ETHNFT ? "0" : "1") + " satoshi of supply and follow all definition rules"); } // TODO: HARDENING - add hardening to ensure that no more than one satoshi at a time ever comes in from a bridge for an NFT mapped currency