initial import of v1.1 code

This commit is contained in:
Some Random Crypto Guy
2026-03-04 14:38:59 +00:00
parent 7acf8068ea
commit d05ac7f44e
63 changed files with 4375 additions and 441 deletions
+209 -5
View File
@@ -44,6 +44,7 @@
#include "serialization/debug_archive.h"
#include "serialization/crypto.h"
#include "serialization/keyvalue_serialization.h" // eepe named serialization
#include "serialization/pair.h"
#include "serialization/string.h"
#include "carrot_core/core_types.h"
#include "carrot_impl/carrot_chain_serialization.h"
@@ -193,8 +194,6 @@ namespace cryptonote
VARINT_FIELD(amount)
FIELD(target)
END_SERIALIZE()
};
class protocol_tx_data_t {
@@ -214,6 +213,99 @@ namespace cryptonote
END_SERIALIZE()
};
struct erc_token_t
{
uint8_t version;
std::string contract_address;
std::string lockbox_address;
std::string ticker;
uint64_t erc20_asset_id; // NOTE: this is NOT the Salvium `asset_type_id`!!!
BEGIN_SERIALIZE_OBJECT()
VARINT_FIELD(version)
FIELD(contract_address)
FIELD(lockbox_address)
FIELD(ticker)
VARINT_FIELD(erc20_asset_id)
END_SERIALIZE()
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(contract_address)
KV_SERIALIZE(lockbox_address)
KV_SERIALIZE(ticker)
KV_SERIALIZE(erc20_asset_id)
END_KV_SERIALIZE_MAP()
};
struct sal_token_t
{
uint8_t version;
uint64_t supply;
uint64_t size;
std::string name;
std::string url;
crypto::hash signature;
BEGIN_SERIALIZE_OBJECT()
VARINT_FIELD(version)
VARINT_FIELD(supply)
VARINT_FIELD(size)
FIELD(name)
FIELD(url)
FIELD(signature)
END_SERIALIZE()
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(supply)
KV_SERIALIZE(size)
KV_SERIALIZE(name)
KV_SERIALIZE(url)
END_KV_SERIALIZE_MAP()
};
#define TOKEN_TYPE_UNSET 0
#define TOKEN_TYPE_ERC20 1
#define TOKEN_TYPE_SAL 2
typedef boost::variant<erc_token_t, sal_token_t> token_v;
struct token_metadata_t
{
uint8_t version;
std::string asset_type;
token_v token;
BEGIN_SERIALIZE_OBJECT()
VARINT_FIELD(version)
FIELD(asset_type)
FIELD(token)
END_SERIALIZE()
};
class layer2_rollup_tx_t {
public:
crypto::hash tx_prefix_hash;
crypto::key_image first_key_image;
uint64_t tx_fee;
BEGIN_SERIALIZE_OBJECT()
FIELD(tx_prefix_hash)
FIELD(first_key_image)
VARINT_FIELD(tx_fee)
END_SERIALIZE()
};
class layer2_rollup_data_t {
public:
uint8_t version;
std::vector<layer2_rollup_tx_t> txs;
BEGIN_SERIALIZE_OBJECT()
VARINT_FIELD(version)
FIELD(txs)
END_SERIALIZE()
};
class transaction_prefix
{
@@ -246,6 +338,10 @@ namespace cryptonote
protocol_tx_data_t protocol_tx_data;
carrot::rollup_binding_tag_t rollup_binding_tag;
token_metadata_t token_metadata;
layer2_rollup_data_t layer2_rollup_data;
BEGIN_SERIALIZE()
VARINT_FIELD(version)
if(version == 0 || CURRENT_TRANSACTION_VERSION < version) return false;
@@ -263,9 +359,8 @@ namespace cryptonote
FIELD(return_address_list)
FIELD(return_address_change_mask)
} else {
if (type == cryptonote::transaction_type::STAKE &&
version >= TRANSACTION_VERSION_CARROT)
{
if ((type == cryptonote::transaction_type::STAKE || type == cryptonote::transaction_type::CREATE_TOKEN) &&
(version >= TRANSACTION_VERSION_CARROT)) {
FIELD(protocol_tx_data)
} else {
FIELD(return_address)
@@ -277,6 +372,17 @@ namespace cryptonote
VARINT_FIELD(amount_slippage_limit)
}
}
if (version < TRANSACTION_VERSION_ENABLE_TOKENS) {
return true;
}
if (type == cryptonote::transaction_type::CREATE_TOKEN) {
FIELD(token_metadata)
} else if (type == cryptonote::transaction_type::TRANSFER) {
FIELD(rollup_binding_tag)
} else if (type == cryptonote::transaction_type::ROLLUP) {
FIELD(rollup_binding_tag)
FIELD(layer2_rollup_data)
}
END_SERIALIZE()
public:
@@ -297,10 +403,14 @@ namespace cryptonote
protocol_tx_data.return_pubkey = crypto::null_pkey;
protocol_tx_data.return_view_tag = {};
protocol_tx_data.return_anchor_enc = {};
token_metadata.version = 0;
source_asset_type.clear();
destination_asset_type.clear();
amount_burnt = 0;
amount_slippage_limit = 0;
rollup_binding_tag = {0};
token_metadata = {};
layer2_rollup_data = {};
}
};
@@ -564,6 +674,91 @@ namespace cryptonote
END_SERIALIZE()
};
struct token_block_info {
uint64_t block_height;
std::map<uint32_t, uint64_t> token_info; // Replaces the vector
token_block_info() = default; // default ctor
explicit token_block_info(const uint64_t h)
: block_height(h) {}
void clear() {
block_height = 0;
token_info.clear();
}
std::vector<uint8_t> serialize() const noexcept {
constexpr uint8_t version = 1; // Bump if format changes
uint32_t sz = static_cast<uint32_t>(token_info.size());
size_t total_size = sizeof(uint8_t) + sizeof(uint64_t) + sizeof(uint32_t) + (sz * (sizeof(uint32_t) + sizeof(uint64_t)));
std::vector<uint8_t> buf(total_size);
uint8_t* ptr = buf.data();
std::memcpy(ptr, &version, sizeof(uint8_t));
ptr += sizeof(uint8_t);
std::memcpy(ptr, &block_height, sizeof(uint64_t));
ptr += sizeof(uint64_t);
std::memcpy(ptr, &sz, sizeof(uint32_t));
ptr += sizeof(uint32_t);
for (const auto& p : token_info) { // Iterates in sorted order
std::memcpy(ptr, &p.first, sizeof(uint32_t));
ptr += sizeof(uint32_t);
std::memcpy(ptr, &p.second, sizeof(uint64_t));
ptr += sizeof(uint64_t);
}
return buf;
}
void deserialize(const uint8_t* data, size_t len) {
if (len < sizeof(uint32_t)) {
throw std::runtime_error("Invalid serialized data");
}
uint8_t version;
std::memcpy(&version, data, sizeof(uint8_t));
data += sizeof(uint8_t);
len -= sizeof(uint8_t);
if (version == 0) { // Legacy: No height/version (your current format)
// Handle old blobs: Caller must set block_height externally
block_height = 0; // Or throw if height is mandatory
} else if (version == 1) {
if (len < sizeof(uint64_t) + sizeof(uint32_t)) {
throw std::runtime_error("Invalid serialized data");
}
std::memcpy(&block_height, data, sizeof(uint64_t));
data += sizeof(uint64_t);
len -= sizeof(uint64_t);
} else {
throw std::runtime_error("Unsupported version");
}
uint32_t sz;
std::memcpy(&sz, data, sizeof(uint32_t));
data += sizeof(uint32_t);
len -= sizeof(uint32_t);
if (len != sz * (sizeof(uint32_t) + sizeof(uint64_t))) {
throw std::runtime_error("Invalid serialized data length");
}
token_info.clear();
for (uint32_t i = 0; i < sz; ++i) {
uint32_t k;
uint64_t v;
std::memcpy(&k, data, sizeof(uint32_t));
data += sizeof(uint32_t);
std::memcpy(&v, data, sizeof(uint64_t));
data += sizeof(uint64_t);
token_info[k] = v; // Map handles sorting/uniquness
}
}
};
struct yield_block_info {
uint64_t block_height;
uint64_t slippage_total_this_block;
@@ -784,6 +979,9 @@ VARIANT_TAG(binary_archive, cryptonote::txout_to_key, 0x2);
VARIANT_TAG(binary_archive, cryptonote::txout_to_tagged_key, 0x3);
VARIANT_TAG(binary_archive, cryptonote::txout_to_carrot_v1, 0x4);
VARIANT_TAG(binary_archive, cryptonote::protocol_tx_data_t, 0x0);
VARIANT_TAG(binary_archive, cryptonote::token_metadata_t, 0x0);
VARIANT_TAG(binary_archive, cryptonote::erc_token_t, 0x0);
VARIANT_TAG(binary_archive, cryptonote::sal_token_t, 0x1);
VARIANT_TAG(binary_archive, cryptonote::transaction, 0xcc);
VARIANT_TAG(binary_archive, cryptonote::block, 0xbb);
@@ -797,6 +995,9 @@ VARIANT_TAG(json_archive, cryptonote::txout_to_key, "key");
VARIANT_TAG(json_archive, cryptonote::txout_to_tagged_key, "tagged_key");
VARIANT_TAG(json_archive, cryptonote::txout_to_carrot_v1, "carrot_v1");
VARIANT_TAG(json_archive, cryptonote::protocol_tx_data_t, "protocol_tx_data");
VARIANT_TAG(json_archive, cryptonote::token_metadata_t, "token_metadata");
VARIANT_TAG(json_archive, cryptonote::erc_token_t, "erc_token");
VARIANT_TAG(json_archive, cryptonote::sal_token_t, "sal_token");
VARIANT_TAG(json_archive, cryptonote::transaction, "tx");
VARIANT_TAG(json_archive, cryptonote::block, "block");
@@ -810,5 +1011,8 @@ VARIANT_TAG(debug_archive, cryptonote::txout_to_key, "key");
VARIANT_TAG(debug_archive, cryptonote::txout_to_tagged_key, "tagged_key");
VARIANT_TAG(debug_archive, cryptonote::txout_to_carrot_v1, "carrot_v1");
VARIANT_TAG(debug_archive, cryptonote::protocol_tx_data_t, "protocol_tx_data");
VARIANT_TAG(debug_archive, cryptonote::token_metadata_t, "token_metadata");
VARIANT_TAG(debug_archive, cryptonote::erc_token_t, "erc_token");
VARIANT_TAG(debug_archive, cryptonote::sal_token_t, "sal_token");
VARIANT_TAG(debug_archive, cryptonote::transaction, "tx");
VARIANT_TAG(debug_archive, cryptonote::block, "block");
@@ -45,6 +45,7 @@
#include "crypto/crypto.h"
#include "ringct/rctTypes.h"
#include "ringct/rctOps.h"
#include "serialization/containers.h"
namespace boost
{
@@ -181,6 +182,50 @@ namespace boost
a & x.return_anchor_enc;
}
template <class Archive>
inline void serialize(Archive &a, cryptonote::erc_token_t &x, const boost::serialization::version_type ver)
{
a & x.version;
a & x.contract_address;
a & x.lockbox_address;
a & x.ticker;
a & x.erc20_asset_id;
}
template <class Archive>
inline void serialize(Archive &a, cryptonote::sal_token_t &x, const boost::serialization::version_type ver)
{
a & x.version;
a & x.supply;
a & x.size;
a & x.name;
a & x.url;
a & x.signature;
}
template <class Archive>
inline void serialize(Archive &a, cryptonote::token_metadata_t &x, const boost::serialization::version_type ver)
{
a & x.version;
a & x.asset_type;
a & x.token;
}
template <class Archive>
inline void serialize(Archive &a, cryptonote::layer2_rollup_tx_t &x, const boost::serialization::version_type ver)
{
a & x.tx_prefix_hash;
a & x.first_key_image;
a & x.tx_fee;
}
template <class Archive>
inline void serialize(Archive &a, cryptonote::layer2_rollup_data_t &x, const boost::serialization::version_type ver)
{
a & x.version;
a & x.txs;
}
template <class Archive>
inline void serialize(Archive &a, cryptonote::transaction_prefix &x, const boost::serialization::version_type ver)
{
@@ -197,9 +242,8 @@ namespace boost
a & x.return_address_list;
a & x.return_address_change_mask;
} else {
if (x.type == cryptonote::transaction_type::STAKE &&
x.version >= TRANSACTION_VERSION_CARROT)
{
if ((x.type == cryptonote::transaction_type::STAKE || x.type == cryptonote::transaction_type::CREATE_TOKEN) &&
(x.version >= TRANSACTION_VERSION_CARROT)) {
a & x.protocol_tx_data;
} else {
a & x.return_address;
@@ -211,6 +255,16 @@ namespace boost
a & x.amount_slippage_limit;
}
}
if (x.version >= TRANSACTION_VERSION_ENABLE_TOKENS) {
if (x.type == cryptonote::transaction_type::CREATE_TOKEN) {
a & x.token_metadata;
} else if (x.type == cryptonote::transaction_type::TRANSFER) {
a & x.rollup_binding_tag;
} else if (x.type == cryptonote::transaction_type::ROLLUP) {
a & x.rollup_binding_tag;
a & x.layer2_rollup_data;
}
}
}
template <class Archive>
@@ -229,9 +283,8 @@ namespace boost
a & x.return_address_list;
a & x.return_address_change_mask;
} else {
if (x.type == cryptonote::transaction_type::STAKE &&
x.version >= TRANSACTION_VERSION_CARROT)
{
if ((x.type == cryptonote::transaction_type::STAKE || x.type == cryptonote::transaction_type::CREATE_TOKEN) &&
(x.version >= TRANSACTION_VERSION_CARROT)) {
a & x.protocol_tx_data;
} else {
a & x.return_address;
@@ -242,6 +295,16 @@ namespace boost
a & x.destination_asset_type;
a & x.amount_slippage_limit;
}
if (x.version >= TRANSACTION_VERSION_ENABLE_TOKENS) {
if (x.type == cryptonote::transaction_type::CREATE_TOKEN) {
a & x.token_metadata;
} else if (x.type == cryptonote::transaction_type::TRANSFER) {
a & x.rollup_binding_tag;
} else if (x.type == cryptonote::transaction_type::ROLLUP) {
a & x.rollup_binding_tag;
a & x.layer2_rollup_data;
}
}
}
if (x.version == 1)
{
+185 -28
View File
@@ -31,6 +31,7 @@
#include <atomic>
#include <csignal>
#include <map>
#include <boost/algorithm/string.hpp>
#include "wipeable_string.h"
#include "string_tools.h"
@@ -43,6 +44,7 @@
#include "crypto/hash.h"
#include "ringct/rctSigs.h"
#include "oracle/asset_types.h"
#include "common/debugging.h"
using namespace epee;
@@ -1114,7 +1116,37 @@ namespace cryptonote
default:
break;
}
if (asset_type_id)
{
// Check to see if 1st byte is permitted
std::string s, s_prefix;
switch (asset_type_id >> 24) {
case 0x01:
// We have a user-generated token
s_prefix = "sal";
break;
case 0x02:
s_prefix = "erc";
break;
default:
ASSERT_MES_AND_THROW("Invalid asset_type_id: " << asset_type_id);
}
// Break up the remaining 3 bytes into 4 chunks of base36/64
static const char alphabet[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
uint32_t asset_type_id_temp = asset_type_id & 0x00FFFFFF;
for (int i=0; i<4; ++i) {
uint8_t val = asset_type_id_temp & 0x0000003F;
if (val >= 36)
ASSERT_MES_AND_THROW("Invalid asset_type_id: " << asset_type_id);
s.push_back(alphabet[val]);
asset_type_id_temp >>= 6;
}
std::reverse(s.begin(), s.end());
return s_prefix + s;
}
// Should probably throw() here
ASSERT_MES_AND_THROW("Invalid asset_type_id: " << asset_type_id);
return "";
}
//---------------------------------------------------------------
@@ -1129,11 +1161,162 @@ namespace cryptonote
} else if (asset_type == "") {
return 0x00000000;
} else {
// Should probably throw() here
return static_cast<uint32_t>(-1);
if (asset_type.length() != 7) {
LOG_ERROR("Custom asset type '" << asset_type << "' has invalid length.");
return 0x00000000;
}
static const std::string alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// Check the 4-char type
std::string s_type = asset_type.substr(3);
std::transform(s_type.begin(), s_type.end(), s_type.begin(),
[](unsigned char c){ return std::toupper(c); });
uint32_t asset_id = 0x00000000;
for (int i=0; i<s_type.length(); ++i) {
uint8_t idx = alphabet.find(s_type.at(i));
if (idx == std::string::npos || idx >= 36) {
LOG_ERROR("Custom asset type contains invalid char.");
return 0x00000000;
}
asset_id = (asset_id << 6) | (idx & 0x3F);
}
// Check the 3-char prefix
std::string s_prefix = asset_type.substr(0,3);
std::transform(s_prefix.begin(), s_prefix.end(), s_prefix.begin(),
[](unsigned char c){ return std::tolower(c); });
if (s_prefix == "sal") {
asset_id |= 0x01000000;
} else if (s_prefix == "erc") {
asset_id |= 0x02000000;
} else {
LOG_ERROR("Custom asset type has invalid prefix.");
return 0x00000000;
}
return asset_id;
}
}
//---------------------------------------------------------------
bool is_asset_type_token(const std::string& asset_type)
{
// SAL, SAL1, BURN are base asset types
// erc prefix is not included here
if (asset_type.length() >= 3) {
std::string prefix = asset_type.substr(0, 3);
return (prefix == "sal");
}
return false;
}
//---------------------------------------------------------------
bool is_valid_asset_type(const std::string& asset_type) {
// This method does NOT throw()
try {
uint32_t asset_id = asset_id_from_type(asset_type);
std::string asset_type_check = asset_type_from_id(asset_id);
return (asset_type_check == asset_type);
}
catch (std::exception e) {
return false;
}
}
//---------------------------------------------------------------
bool is_valid_custom_asset_type(const std::string& asset_type)
{
if (!is_valid_asset_type(asset_type))
return false;
// double check with reserved IDs
uint32_t id = asset_id_from_type(asset_type);
if (id == 0x53414C00 || id == 0x53414C31 || id == 0x4255524E || id == 0x00000000) {
return false;
}
return true;
}
//---------------------------------------------------------------
uint64_t get_token_creation_price(const std::string& ticker)
{
static const std::map<std::string, uint64_t> premium_tickers = {
// add more
{"USDT", 10000 * COIN},
{"USDC", 10000 * COIN},
{"WBTC", 10000 * COIN},
{"DOGE", 10000 * COIN},
{"SHIB", 10000 * COIN},
{"AVAX", 10000 * COIN},
{"ATOM", 10000 * COIN},
{"NEAR", 10000 * COIN},
{"TRON", 10000 * COIN},
{"HBAR", 10000 * COIN},
{"AAVE", 10000 * COIN},
{"FLOW", 10000 * COIN},
{"EGLD", 10000 * COIN},
{"KLAY", 10000 * COIN},
{"LUNA", 10000 * COIN},
{"DASH", 10000 * COIN},
{"NANO", 10000 * COIN},
{"CORE", 10000 * COIN},
{"BEAM", 10000 * COIN},
{"DYDX", 10000 * COIN},
{"COMP", 10000 * COIN},
{"SAND", 10000 * COIN},
{"MANA", 10000 * COIN},
{"RUNE", 10000 * COIN},
{"PYTH", 10000 * COIN},
{"ARKM", 10000 * COIN},
{"BLUR", 10000 * COIN},
{"STRK", 10000 * COIN},
{"PEPE", 10000 * COIN},
{"BONK", 10000 * COIN},
{"VIUM", 10000 * COIN},
{"GOLD", 10000 * COIN},
{"SILV", 10000 * COIN},
{"CASH", 10000 * COIN},
{"EURO", 10000 * COIN},
{"PESO", 10000 * COIN},
{"BOND", 10000 * COIN},
{"FUND", 10000 * COIN},
{"BANK", 10000 * COIN},
{"SWAP", 10000 * COIN},
{"LEND", 10000 * COIN},
{"LOAN", 10000 * COIN},
{"NOTE", 10000 * COIN},
{"HOLD", 10000 * COIN},
{"BULL", 10000 * COIN},
{"BEAR", 10000 * COIN},
{"TECH", 10000 * COIN},
{"DATA", 10000 * COIN},
{"HASH", 10000 * COIN},
{"NODE", 10000 * COIN},
{"BYTE", 10000 * COIN},
{"GRID", 10000 * COIN},
{"CODE", 10000 * COIN},
{"META", 10000 * COIN},
{"WEB3", 10000 * COIN},
{"NFTS", 10000 * COIN},
{"DEFI", 10000 * COIN},
{"LAND", 10000 * COIN},
{"REAL", 10000 * COIN},
{"RENT", 10000 * COIN},
{"FARM", 10000 * COIN},
{"OILX", 10000 * COIN},
{"ENRG", 10000 * COIN},
{"FUEL", 10000 * COIN},
{"VOTE", 10000 * COIN},
{"PASS", 10000 * COIN},
{"LOCK", 10000 * COIN},
};
// is it a premium ticker
auto it = premium_tickers.find(ticker);
if (it != premium_tickers.end()) {
return it->second;
}
// not premium
return 1000 * COIN;
}
//---------------------------------------------------------------
/**
* The various scenarios that are permitted for Salvium are more extensive than
* they are for Zepyhr / Havan. Specifically, we permit:
@@ -1406,32 +1589,6 @@ namespace cryptonote
<< o.target.type().name() << " and " << tx.vout[0].target.type().name() << ", "
<< "expected matching variant types in transaction");
}
// Verify the asset type
std::string asset_type;
CHECK_AND_ASSERT_MES(cryptonote::get_output_asset_type(o, asset_type), false, "failed to get asset type");
if (hf_version < HF_VERSION_SALVIUM_ONE_PROOFS) {
// Prior to the first audit, ONLY SAL was supported
CHECK_AND_ASSERT_MES(asset_type == "SAL", false, "wrong output asset type:" << asset_type);
} else {
if (tx.type == cryptonote::transaction_type::AUDIT) {
// HERE BE DRAGONS!!!
// SRCG: This will NOT always be the case - when we add an audit for SALx it'll need to support that as well
// The CHANGE for an AUDIT TX must be SAL (and 0 value, and unspendable, and to the origin wallet, and ...)
CHECK_AND_ASSERT_MES(asset_type == "SAL", false, "wrong output asset type:" << asset_type);
// LAND AHOY!!!
} else if (tx.type == cryptonote::transaction_type::PROTOCOL) {
if (hf_version < HF_VERSION_AUDIT1_PAUSE) {
// PROTOCOL TXs are responsible for paying out SAL and SAL1 during the first AUDIT
CHECK_AND_ASSERT_MES(asset_type == "SAL1" || asset_type == "SAL", false, "wrong output asset type:" << asset_type);
} else {
CHECK_AND_ASSERT_MES(asset_type == "SAL1", false, "wrong output asset type:" << asset_type);
}
} else {
// All other TX types must only spend + create SAL1 (MINER, TRANSFER)
CHECK_AND_ASSERT_MES(asset_type == "SAL1", false, "wrong output asset type:" << asset_type);
}
}
}
return true;
}
@@ -135,6 +135,10 @@ namespace cryptonote
uint64_t get_outs_money_amount(const transaction& tx);
std::string asset_type_from_id(const uint32_t asset_type_id);
uint32_t asset_id_from_type(const std::string asset_type);
bool is_valid_custom_asset_type(const std::string& asset_type);
bool is_valid_asset_type(const std::string& asset_type);
bool is_asset_type_token(const std::string& asset_type);
uint64_t get_token_creation_price(const std::string& ticker);
bool get_tx_asset_types(const transaction& tx, const crypto::hash &txid, std::string& source, std::string& destination, const bool is_miner_tx);
bool get_output_public_key(const cryptonote::tx_out& out, crypto::public_key& output_public_key);
boost::optional<crypto::view_tag> get_output_view_tag(const cryptonote::tx_out& out);
+12 -1
View File
@@ -39,6 +39,7 @@
#define TX_EXTRA_NONCE 0x02
#define TX_EXTRA_MERGE_MINING_TAG 0x03
#define TX_EXTRA_TAG_ADDITIONAL_PUBKEYS 0x04
#define TX_EXTRA_TAG_TOKEN 0x80
#define TX_EXTRA_MYSTERIOUS_MINERGATE_TAG 0xDE
#define TX_EXTRA_NONCE_PAYMENT_ID 0x00
@@ -167,6 +168,15 @@ namespace cryptonote
END_SERIALIZE()
};
struct tx_extra_token
{
cryptonote::token_metadata_t token;
BEGIN_SERIALIZE()
FIELD(token)
END_SERIALIZE()
};
struct tx_extra_mysterious_minergate
{
std::string data;
@@ -180,7 +190,7 @@ namespace cryptonote
// varint tag;
// varint size;
// varint data[];
typedef boost::variant<tx_extra_padding, tx_extra_pub_key, tx_extra_nonce, tx_extra_merge_mining_tag, tx_extra_additional_pub_keys, tx_extra_mysterious_minergate> tx_extra_field;
typedef boost::variant<tx_extra_padding, tx_extra_pub_key, tx_extra_nonce, tx_extra_merge_mining_tag, tx_extra_additional_pub_keys, tx_extra_mysterious_minergate, tx_extra_token> tx_extra_field;
}
VARIANT_TAG(binary_archive, cryptonote::tx_extra_padding, TX_EXTRA_TAG_PADDING);
@@ -189,3 +199,4 @@ VARIANT_TAG(binary_archive, cryptonote::tx_extra_nonce, TX_EXTRA_NONCE);
VARIANT_TAG(binary_archive, cryptonote::tx_extra_merge_mining_tag, TX_EXTRA_MERGE_MINING_TAG);
VARIANT_TAG(binary_archive, cryptonote::tx_extra_additional_pub_keys, TX_EXTRA_TAG_ADDITIONAL_PUBKEYS);
VARIANT_TAG(binary_archive, cryptonote::tx_extra_mysterious_minergate, TX_EXTRA_MYSTERIOUS_MINERGATE_TAG);
VARIANT_TAG(binary_archive, cryptonote::tx_extra_token, TX_EXTRA_TAG_TOKEN);