diff --git a/src/omnicore/rules.cpp b/src/omnicore/rules.cpp index 947ab07ba59e0..fa251eeb6419d 100644 --- a/src/omnicore/rules.cpp +++ b/src/omnicore/rules.cpp @@ -253,6 +253,7 @@ CMainConsensusParams::CMainConsensusParams() TRADEALLPAIRS_FEATURE_BLOCK = 438500; FEES_FEATURE_BLOCK = 999999; FREEZENOTICE_FEATURE_BLOCK = 999999; + FREEDEX_FEATURE_BLOCK = 999999; } /** @@ -294,6 +295,7 @@ CTestNetConsensusParams::CTestNetConsensusParams() TRADEALLPAIRS_FEATURE_BLOCK = 0; FEES_FEATURE_BLOCK = 0; FREEZENOTICE_FEATURE_BLOCK = 0; + FREEDEX_FEATURE_BLOCK = 0; } /** @@ -335,6 +337,7 @@ CRegTestConsensusParams::CRegTestConsensusParams() TRADEALLPAIRS_FEATURE_BLOCK = 999999; FEES_FEATURE_BLOCK = 999999; FREEZENOTICE_FEATURE_BLOCK = 999999; + FREEDEX_FEATURE_BLOCK = 999999; } //! Consensus parameters for mainnet @@ -500,6 +503,9 @@ bool ActivateFeature(uint16_t featureId, int activationBlock, uint32_t minClient case FEATURE_FREEZENOTICE: MutableConsensusParams().FREEZENOTICE_FEATURE_BLOCK = activationBlock; break; + case FEATURE_FREEDEX: + MutableConsensusParams().FREEDEX_FEATURE_BLOCK = activationBlock; + break; default: supported = false; break; @@ -571,6 +577,9 @@ bool DeactivateFeature(uint16_t featureId, int transactionBlock) case FEATURE_FREEZENOTICE: MutableConsensusParams().FREEZENOTICE_FEATURE_BLOCK = 999999; break; + case FEATURE_FREEDEX: + MutableConsensusParams().FREEDEX_FEATURE_BLOCK = 999999; + break; default: return false; break; @@ -602,6 +611,7 @@ std::string GetFeatureName(uint16_t featureId) case FEATURE_FEES: return "Fee system (inc 0.05% fee from trades of non-Omni pairs)"; case FEATURE_STOV1: return "Cross-property Send To Owners"; case FEATURE_FREEZENOTICE: return "Activate the waiting period for enabling freezing"; + case FEATURE_FREEDEX: return "Activate trading of any token on the distributed exchange"; default: return "Unknown feature"; } @@ -649,6 +659,9 @@ bool IsFeatureActivated(uint16_t featureId, int transactionBlock) case FEATURE_FREEZENOTICE: activationBlock = params.FREEZENOTICE_FEATURE_BLOCK; break; + case FEATURE_FREEDEX: + activationBlock = params.FREEDEX_FEATURE_BLOCK; + break; default: return false; } diff --git a/src/omnicore/rules.h b/src/omnicore/rules.h index 38674ad8afefc..7c0f9e925960e 100644 --- a/src/omnicore/rules.h +++ b/src/omnicore/rules.h @@ -36,6 +36,8 @@ const uint16_t FEATURE_FEES = 9; const uint16_t FEATURE_STOV1 = 10; //! Feature identifier to activate the waiting period for enabling managed property address freezing const uint16_t FEATURE_FREEZENOTICE = 14; +//! Feature identifier to activate trading of any token on the distributed exchange +const uint16_t FEATURE_FREEDEX = 15; //! When (propertyTotalTokens / OMNI_FEE_THRESHOLD) is reached fee distribution will occur const int64_t OMNI_FEE_THRESHOLD = 100000; // 0.001% @@ -141,6 +143,8 @@ class CConsensusParams int FEES_FEATURE_BLOCK; //! Block to activate the waiting period for enabling managed property address freezing int FREEZENOTICE_FEATURE_BLOCK; + //! Block to activate the waiting period to activate trading of any token on the distributed exchange + int FREEDEX_FEATURE_BLOCK; /** Returns a mapping of transaction types, and the blocks at which they are enabled. */ virtual std::vector GetRestrictions() const;