Raven Core  3.0.0
P2P Digital Currency
Classes | Macros | Functions | Variables
assets.h File Reference
#include "amount.h"
#include "tinyformat.h"
#include "assettypes.h"
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <list>
Include dependency graph for assets.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CAssets
 
class  CAssetsCache
 

Macros

#define RVN_R   114
 
#define RVN_V   118
 
#define RVN_N   110
 
#define RVN_Q   113
 
#define RVN_T   116
 
#define RVN_O   111
 
#define DEFAULT_UNITS   0
 
#define DEFAULT_REISSUABLE   1
 
#define DEFAULT_HAS_IPFS   0
 
#define DEFAULT_IPFS   ""
 
#define MIN_ASSET_LENGTH   3
 
#define MAX_ASSET_LENGTH   32
 
#define OWNER_TAG   "!"
 
#define OWNER_LENGTH   1
 
#define OWNER_UNITS   0
 
#define OWNER_ASSET_AMOUNT   1 * COIN
 
#define UNIQUE_ASSET_AMOUNT   1 * COIN
 
#define UNIQUE_ASSET_UNITS   0
 
#define UNIQUE_ASSETS_REISSUABLE   0
 
#define RESTRICTED_CHAR   '$'
 
#define QUALIFIER_CHAR   '#'
 
#define QUALIFIER_ASSET_MIN_AMOUNT   1 * COIN
 
#define QUALIFIER_ASSET_MAX_AMOUNT   10 * COIN
 
#define QUALIFIER_ASSET_UNITS   0
 
#define ASSET_TRANSFER_STRING   "transfer_asset"
 
#define ASSET_NEW_STRING   "new_asset"
 
#define ASSET_REISSUE_STRING   "reissue_asset"
 
#define MAX_CACHE_ASSETS_SIZE   2500
 

Functions

CAmount GetIssueAssetBurnAmount ()
 Functions to be used to get access to the current burn amount required for specific asset issuance transactions. More...
 
CAmount GetReissueAssetBurnAmount ()
 
CAmount GetIssueSubAssetBurnAmount ()
 
CAmount GetIssueUniqueAssetBurnAmount ()
 
CAmount GetIssueMsgChannelAssetBurnAmount ()
 
CAmount GetIssueQualifierAssetBurnAmount ()
 
CAmount GetIssueSubQualifierAssetBurnAmount ()
 
CAmount GetIssueRestrictedAssetBurnAmount ()
 
CAmount GetAddNullQualifierTagBurnAmount ()
 
CAmount GetBurnAmount (const AssetType type)
 
CAmount GetBurnAmount (const int nType)
 
std::string GetBurnAddress (const AssetType type)
 Functions to be used to get access to the burn address for a given asset type issuance. More...
 
std::string GetBurnAddress (const int nType)
 
void GetTxOutAssetTypes (const std::vector< CTxOut > &vout, int &issues, int &reissues, int &transfers, int &owners)
 
bool IsAssetNameValid (const std::string &name)
 Check is an asset name is valid, and being able to return the asset type if needed. More...
 
bool IsAssetNameValid (const std::string &name, AssetType &assetType)
 
bool IsAssetNameValid (const std::string &name, AssetType &assetType, std::string &error)
 
bool IsUniqueTagValid (const std::string &tag)
 Check if an unique tagname is valid. More...
 
bool IsAssetNameAnOwner (const std::string &name)
 Check if an asset is an owner. More...
 
bool IsAssetNameAnRestricted (const std::string &name)
 Check if an asset is a restricted asset. More...
 
bool IsAssetNameAQualifier (const std::string &name)
 Check if an asset is a qualifier asset or sub qualifier. More...
 
bool IsAssetNameASubQualifier (const std::string &name)
 Check if an asset is a sub qualifier. More...
 
bool IsAssetNameAnMsgChannel (const std::string &name)
 Check if an asset is a message channel. More...
 
std::string GetParentName (const std::string &name)
 Get the root name of an asset. More...
 
std::string GetUniqueAssetName (const std::string &parent, const std::string &tag)
 Build a unique asset buy giving the root name, and the tag name (ROOT, TAG) => ROOT::TAG. More...
 
bool IsTypeCheckNameValid (const AssetType type, const std::string &name, std::string &error)
 Given a type, and an asset name, return if that name is valid based on the type. More...
 
bool AssetFromTransaction (const CTransaction &tx, CNewAsset &asset, std::string &strAddress)
 These types of asset tx, have specific metadata at certain indexes in the transaction. More...
 
bool OwnerFromTransaction (const CTransaction &tx, std::string &ownerName, std::string &strAddress)
 
bool ReissueAssetFromTransaction (const CTransaction &tx, CReissueAsset &reissue, std::string &strAddress)
 
bool UniqueAssetFromTransaction (const CTransaction &tx, CNewAsset &asset, std::string &strAddress)
 
bool MsgChannelAssetFromTransaction (const CTransaction &tx, CNewAsset &asset, std::string &strAddress)
 
bool QualifierAssetFromTransaction (const CTransaction &tx, CNewAsset &asset, std::string &strAddress)
 
bool RestrictedAssetFromTransaction (const CTransaction &tx, CNewAsset &asset, std::string &strAddress)
 
bool TransferAssetFromScript (const CScript &scriptPubKey, CAssetTransfer &assetTransfer, std::string &strAddress)
 Get specific asset type metadata from the given scripts. More...
 
bool AssetFromScript (const CScript &scriptPubKey, CNewAsset &asset, std::string &strAddress)
 
bool OwnerAssetFromScript (const CScript &scriptPubKey, std::string &assetName, std::string &strAddress)
 
bool ReissueAssetFromScript (const CScript &scriptPubKey, CReissueAsset &reissue, std::string &strAddress)
 
bool MsgChannelAssetFromScript (const CScript &scriptPubKey, CNewAsset &asset, std::string &strAddress)
 
bool QualifierAssetFromScript (const CScript &scriptPubKey, CNewAsset &asset, std::string &strAddress)
 
bool RestrictedAssetFromScript (const CScript &scriptPubKey, CNewAsset &asset, std::string &strAddress)
 
bool AssetNullDataFromScript (const CScript &scriptPubKey, CNullAssetTxData &assetData, std::string &strAddress)
 
bool AssetNullVerifierDataFromScript (const CScript &scriptPubKey, CNullAssetTxVerifierString &verifierData)
 
bool GlobalAssetNullDataFromScript (const CScript &scriptPubKey, CNullAssetTxData &assetData)
 
bool CheckIssueBurnTx (const CTxOut &txOut, const AssetType &type, const int numberIssued)
 Check to make sure the script contains the burn transaction. More...
 
bool CheckIssueBurnTx (const CTxOut &txOut, const AssetType &type)
 
bool CheckReissueBurnTx (const CTxOut &txOut)
 Check to make sure the script contains the reissue burn data. More...
 
bool CheckIssueDataTx (const CTxOut &txOut)
 issue asset scripts to make sure script meets the standards More...
 
bool CheckOwnerDataTx (const CTxOut &txOut)
 
bool CheckReissueDataTx (const CTxOut &txOut)
 
bool CheckTransferOwnerTx (const CTxOut &txOut)
 
bool CheckEncoded (const std::string &hash, std::string &strError)
 Check the Encoded hash and make sure it is either an IPFS hash or a OIP hash. More...
 
bool CheckAmountWithUnits (const CAmount &nAmount, const int8_t nUnits)
 Checks the amount and units, and makes sure that the amount uses the correct decimals. More...
 
bool IsScriptNewAsset (const CScript &scriptPubKey)
 Check script and see if it matches the asset issuance template. More...
 
bool IsScriptNewAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsScriptNewUniqueAsset (const CScript &scriptPubKey)
 Check script and see if it matches the unquie issuance template. More...
 
bool IsScriptNewUniqueAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsScriptOwnerAsset (const CScript &scriptPubKey)
 Check script and see if it matches the owner issuance template. More...
 
bool IsScriptOwnerAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsScriptReissueAsset (const CScript &scriptPubKey)
 Check script and see if it matches the reissue template. More...
 
bool IsScriptReissueAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsScriptTransferAsset (const CScript &scriptPubKey)
 Check script and see if it matches the transfer asset template. More...
 
bool IsScriptTransferAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsScriptNewMsgChannelAsset (const CScript &scriptPubKey)
 Check script and see if it matches the message channel issuance template. More...
 
bool IsScriptNewMsgChannelAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsScriptNewQualifierAsset (const CScript &scriptPubKey)
 Check script and see if it matches the qualifier issuance template. More...
 
bool IsScriptNewQualifierAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsScriptNewRestrictedAsset (const CScript &scriptPubKey)
 Check script and see if it matches the restricted issueance template. More...
 
bool IsScriptNewRestrictedAsset (const CScript &scriptPubKey, int &nStartingIndex)
 
bool IsNewOwnerTxValid (const CTransaction &tx, const std::string &assetName, const std::string &address, std::string &errorMsg)
 
void GetAllAdministrativeAssets (CWallet *pwallet, std::vector< std::string > &names, int nMinConf=1)
 
void GetAllMyAssets (CWallet *pwallet, std::vector< std::string > &names, int nMinConf=1, bool fIncludeAdministrator=false, bool fOnlyAdministrator=false)
 
bool GetAssetInfoFromCoin (const Coin &coin, std::string &strName, CAmount &nAmount)
 
bool GetAssetInfoFromScript (const CScript &scriptPubKey, std::string &strName, CAmount &nAmount)
 
bool GetAssetData (const CScript &script, CAssetOutputEntry &data)
 
bool GetBestAssetAddressAmount (CAssetsCache &cache, const std::string &assetName, const std::string &address)
 This will get the amount that an address for a certain asset contains from the database if they cache doesn't already have it. More...
 
bool GetAllMyAssetBalances (std::map< std::string, std::vector< COutput > > &outputs, std::map< std::string, CAmount > &amounts, const int confirmations=0, const std::string &prefix="")
 sets balances with the total quantity of each owned asset More...
 
bool VerifyWalletHasAsset (const std::string &asset_name, std::pair< int, std::string > &pairError)
 Verifies that this wallet owns the give asset. More...
 
std::string DecodeAssetData (std::string encoded)
 Decode and Encode IPFS hashes, or OIP hashes. More...
 
std::string EncodeAssetData (std::string decoded)
 
std::string DecodeIPFS (std::string encoded)
 
std::string EncodeIPFS (std::string decoded)
 
bool CreateAssetTransaction (CWallet *pwallet, CCoinControl &coinControl, const CNewAsset &asset, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string=nullptr)
 Creates new asset issuance transaction. More...
 
bool CreateAssetTransaction (CWallet *pwallet, CCoinControl &coinControl, const std::vector< CNewAsset > assets, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string=nullptr)
 
bool CreateReissueAssetTransaction (CWallet *pwallet, CCoinControl &coinControl, const CReissueAsset &asset, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string=nullptr)
 Create a reissue asset transaction. More...
 
bool CreateTransferAssetTransaction (CWallet *pwallet, const CCoinControl &coinControl, const std::vector< std::pair< CAssetTransfer, std::string > >vTransfers, const std::string &changeAddress, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::vector< std::pair< CNullAssetTxData, std::string > > *nullAssetTxData=nullptr, std::vector< CNullAssetTxData > *nullGlobalRestrictionData=nullptr)
 Create a transfer asset transaction. More...
 
bool SendAssetTransaction (CWallet *pwallet, CWalletTx &transaction, CReserveKey &reserveKey, std::pair< int, std::string > &error, std::string &txid)
 Send any type of asset transaction to the network. More...
 
bool ParseAssetScript (CScript scriptPubKey, uint160 &hashBytes, std::string &assetName, CAmount &assetAmount)
 Helper method for extracting address bytes, asset name and amount from an asset script. More...
 
void ExtractVerifierStringQualifiers (const std::string &verifier, std::set< std::string > &qualifiers, bool fWithTag=true)
 Helper method for extracting #TAGS from a verifier string. More...
 
bool CheckVerifierString (const std::string &verifier, std::set< std::string > &setFoundQualifiers, std::string &strError, bool fWithTags=false)
 
std::string GetStrippedVerifierString (const std::string &verifier)
 
bool VerifyNullAssetDataFlag (const int &flag, std::string &strError)
 Helper methods that validate changes to null asset data transaction databases. More...
 
bool VerifyQualifierChange (CAssetsCache &cache, const CNullAssetTxData &data, const std::string &address, std::string &strError)
 
bool VerifyRestrictedAddressChange (CAssetsCache &cache, const CNullAssetTxData &data, const std::string &address, std::string &strError)
 
bool VerifyGlobalRestrictedChange (CAssetsCache &cache, const CNullAssetTxData &data, std::string &strError)
 
bool CheckVerifierAssetTxOut (const CTxOut &txout, std::string &strError)
 
bool CheckNewAsset (const CNewAsset &asset, std::string &strError)
 
bool CheckReissueAsset (const CReissueAsset &asset, std::string &strError)
 
bool ContextualCheckNullAssetTxOut (const CTxOut &txout, CAssetsCache *assetCache, std::string &strError)
 
bool ContextualCheckGlobalAssetTxOut (const CTxOut &txout, CAssetsCache *assetCache, std::string &strError)
 
bool ContextualCheckVerifierAssetTxOut (const CTxOut &txout, CAssetsCache *assetCache, std::string &strError)
 
bool ContextualCheckVerifierString (CAssetsCache *cache, const std::string &verifier, const std::string &check_address, std::string &strError, bool fWithTags=false)
 
bool ContextualCheckNewAsset (CAssetsCache *assetCache, const CNewAsset &asset, std::string &strError, bool fCheckMempool=false)
 
bool ContextualCheckTransferAsset (CAssetsCache *assetCache, const CAssetTransfer &transfer, const std::string &address, std::string &strError)
 
bool ContextualCheckReissueAsset (CAssetsCache *assetCache, const CReissueAsset &reissue_asset, std::string &strError, const CTransaction &tx)
 
bool ContextualCheckReissueAsset (CAssetsCache *assetCache, const CReissueAsset &reissue_asset, std::string &strError)
 
bool ContextualCheckUniqueAssetTx (CAssetsCache *assetCache, std::string &strError, const CTransaction &tx)
 
bool ContextualCheckUniqueAsset (CAssetsCache *assetCache, const CNewAsset &unique_asset, std::string &strError)
 

Variables

std::map< uint256, std::string > mapReissuedTx
 
std::map< std::string, uint256mapReissuedAssets
 

Macro Definition Documentation

◆ ASSET_NEW_STRING

#define ASSET_NEW_STRING   "new_asset"

Definition at line 48 of file assets.h.

◆ ASSET_REISSUE_STRING

#define ASSET_REISSUE_STRING   "reissue_asset"

Definition at line 49 of file assets.h.

◆ ASSET_TRANSFER_STRING

#define ASSET_TRANSFER_STRING   "transfer_asset"

Definition at line 47 of file assets.h.

◆ DEFAULT_HAS_IPFS

#define DEFAULT_HAS_IPFS   0

Definition at line 28 of file assets.h.

◆ DEFAULT_IPFS

#define DEFAULT_IPFS   ""

Definition at line 29 of file assets.h.

◆ DEFAULT_REISSUABLE

#define DEFAULT_REISSUABLE   1

Definition at line 27 of file assets.h.

◆ DEFAULT_UNITS

#define DEFAULT_UNITS   0

Definition at line 26 of file assets.h.

◆ MAX_ASSET_LENGTH

#define MAX_ASSET_LENGTH   32

Definition at line 31 of file assets.h.

◆ MAX_CACHE_ASSETS_SIZE

#define MAX_CACHE_ASSETS_SIZE   2500

Definition at line 65 of file assets.h.

◆ MIN_ASSET_LENGTH

#define MIN_ASSET_LENGTH   3

Definition at line 30 of file assets.h.

◆ OWNER_ASSET_AMOUNT

#define OWNER_ASSET_AMOUNT   1 * COIN

Definition at line 35 of file assets.h.

◆ OWNER_LENGTH

#define OWNER_LENGTH   1

Definition at line 33 of file assets.h.

◆ OWNER_TAG

#define OWNER_TAG   "!"

Definition at line 32 of file assets.h.

◆ OWNER_UNITS

#define OWNER_UNITS   0

Definition at line 34 of file assets.h.

◆ QUALIFIER_ASSET_MAX_AMOUNT

#define QUALIFIER_ASSET_MAX_AMOUNT   10 * COIN

Definition at line 44 of file assets.h.

◆ QUALIFIER_ASSET_MIN_AMOUNT

#define QUALIFIER_ASSET_MIN_AMOUNT   1 * COIN

Definition at line 43 of file assets.h.

◆ QUALIFIER_ASSET_UNITS

#define QUALIFIER_ASSET_UNITS   0

Definition at line 45 of file assets.h.

◆ QUALIFIER_CHAR

#define QUALIFIER_CHAR   '#'

Definition at line 41 of file assets.h.

◆ RESTRICTED_CHAR

#define RESTRICTED_CHAR   '$'

Definition at line 40 of file assets.h.

◆ RVN_N

#define RVN_N   110

Definition at line 21 of file assets.h.

◆ RVN_O

#define RVN_O   111

Definition at line 24 of file assets.h.

◆ RVN_Q

#define RVN_Q   113

Definition at line 22 of file assets.h.

◆ RVN_R

#define RVN_R   114

Definition at line 19 of file assets.h.

◆ RVN_T

#define RVN_T   116

Definition at line 23 of file assets.h.

◆ RVN_V

#define RVN_V   118

Definition at line 20 of file assets.h.

◆ UNIQUE_ASSET_AMOUNT

#define UNIQUE_ASSET_AMOUNT   1 * COIN

Definition at line 36 of file assets.h.

◆ UNIQUE_ASSET_UNITS

#define UNIQUE_ASSET_UNITS   0

Definition at line 37 of file assets.h.

◆ UNIQUE_ASSETS_REISSUABLE

#define UNIQUE_ASSETS_REISSUABLE   0

Definition at line 38 of file assets.h.

Function Documentation

◆ AssetFromScript()

bool AssetFromScript ( const CScript scriptPubKey,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 664 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AssetFromTransaction()

bool AssetFromTransaction ( const CTransaction tx,
CNewAsset asset,
std::string &  strAddress 
)

These types of asset tx, have specific metadata at certain indexes in the transaction.

These functions pull data from the scripts at those indexes

Definition at line 525 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AssetNullDataFromScript()

bool AssetNullDataFromScript ( const CScript scriptPubKey,
CNullAssetTxData assetData,
std::string &  strAddress 
)

Definition at line 815 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AssetNullVerifierDataFromScript()

bool AssetNullVerifierDataFromScript ( const CScript scriptPubKey,
CNullAssetTxVerifierString verifierData 
)

Definition at line 860 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckAmountWithUnits()

bool CheckAmountWithUnits ( const CAmount nAmount,
const int8_t  nUnits 
)

Checks the amount and units, and makes sure that the amount uses the correct decimals.

Definition at line 4277 of file assets.cpp.

Here is the caller graph for this function:

◆ CheckEncoded()

bool CheckEncoded ( const std::string &  hash,
std::string &  strError 
)

Check the Encoded hash and make sure it is either an IPFS hash or a OIP hash.

Definition at line 4282 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckIssueBurnTx() [1/2]

bool CheckIssueBurnTx ( const CTxOut txOut,
const AssetType type,
const int  numberIssued 
)

Check to make sure the script contains the burn transaction.

Definition at line 3005 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckIssueBurnTx() [2/2]

bool CheckIssueBurnTx ( const CTxOut txOut,
const AssetType type 
)

Definition at line 3041 of file assets.cpp.

Here is the call graph for this function:

◆ CheckIssueDataTx()

bool CheckIssueDataTx ( const CTxOut txOut)

issue asset scripts to make sure script meets the standards

Definition at line 3068 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckNewAsset()

bool CheckNewAsset ( const CNewAsset asset,
std::string &  strError 
)

Definition at line 5105 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckOwnerDataTx()

bool CheckOwnerDataTx ( const CTxOut txOut)

Definition at line 3085 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckReissueAsset()

bool CheckReissueAsset ( const CReissueAsset asset,
std::string &  strError 
)

--—— TESTNET ONLY ----—— ///

-----— TESTNET ONLY -------— ///

Definition at line 5232 of file assets.cpp.

Here is the caller graph for this function:

◆ CheckReissueBurnTx()

bool CheckReissueBurnTx ( const CTxOut txOut)

Check to make sure the script contains the reissue burn data.

Definition at line 3046 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckReissueDataTx()

bool CheckReissueDataTx ( const CTxOut txOut)

Definition at line 3077 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckTransferOwnerTx()

bool CheckTransferOwnerTx ( const CTxOut txOut)

Definition at line 3093 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckVerifierAssetTxOut()

bool CheckVerifierAssetTxOut ( const CTxOut txout,
std::string &  strError 
)

Definition at line 4888 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckVerifierString()

bool CheckVerifierString ( const std::string &  verifier,
std::set< std::string > &  setFoundQualifiers,
std::string &  strError,
bool  fWithTags = false 
)

Definition at line 4739 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckGlobalAssetTxOut()

bool ContextualCheckGlobalAssetTxOut ( const CTxOut txout,
CAssetsCache assetCache,
std::string &  strError 
)

Definition at line 4943 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckNewAsset()

bool ContextualCheckNewAsset ( CAssetsCache assetCache,
const CNewAsset asset,
std::string &  strError,
bool  fCheckMempool = false 
)

Definition at line 5187 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckNullAssetTxOut()

bool ContextualCheckNullAssetTxOut ( const CTxOut txout,
CAssetsCache assetCache,
std::string &  strError 
)

Definition at line 4915 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckReissueAsset() [1/2]

bool ContextualCheckReissueAsset ( CAssetsCache assetCache,
const CReissueAsset reissue_asset,
std::string &  strError,
const CTransaction tx 
)

Definition at line 5273 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckReissueAsset() [2/2]

bool ContextualCheckReissueAsset ( CAssetsCache assetCache,
const CReissueAsset reissue_asset,
std::string &  strError 
)

Definition at line 5364 of file assets.cpp.

Here is the call graph for this function:

◆ ContextualCheckTransferAsset()

bool ContextualCheckTransferAsset ( CAssetsCache assetCache,
const CAssetTransfer transfer,
const std::string &  address,
std::string &  strError 
)

Definition at line 5036 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckUniqueAsset()

bool ContextualCheckUniqueAsset ( CAssetsCache assetCache,
const CNewAsset unique_asset,
std::string &  strError 
)

Definition at line 5437 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckUniqueAssetTx()

bool ContextualCheckUniqueAssetTx ( CAssetsCache assetCache,
std::string &  strError,
const CTransaction tx 
)

Definition at line 5416 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckVerifierAssetTxOut()

bool ContextualCheckVerifierAssetTxOut ( const CTxOut txout,
CAssetsCache assetCache,
std::string &  strError 
)

Definition at line 4960 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ContextualCheckVerifierString()

bool ContextualCheckVerifierString ( CAssetsCache cache,
const std::string &  verifier,
const std::string &  check_address,
std::string &  strError,
bool  fWithTags = false 
)

Definition at line 4979 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateAssetTransaction() [1/2]

bool CreateAssetTransaction ( CWallet pwallet,
CCoinControl coinControl,
const CNewAsset asset,
const std::string &  address,
std::pair< int, std::string > &  error,
CWalletTx wtxNew,
CReserveKey reservekey,
CAmount nFeeRequired,
std::string *  verifier_string = nullptr 
)

Creates new asset issuance transaction.

Definition at line 3745 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateAssetTransaction() [2/2]

bool CreateAssetTransaction ( CWallet pwallet,
CCoinControl coinControl,
const std::vector< CNewAsset assets,
const std::string &  address,
std::pair< int, std::string > &  error,
CWalletTx wtxNew,
CReserveKey reservekey,
CAmount nFeeRequired,
std::string *  verifier_string = nullptr 
)

Definition at line 3752 of file assets.cpp.

Here is the call graph for this function:

◆ CreateReissueAssetTransaction()

bool CreateReissueAssetTransaction ( CWallet pwallet,
CCoinControl coinControl,
const CReissueAsset asset,
const std::string &  address,
std::pair< int, std::string > &  error,
CWalletTx wtxNew,
CReserveKey reservekey,
CAmount nFeeRequired,
std::string *  verifier_string = nullptr 
)

Create a reissue asset transaction.

Definition at line 3917 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTransferAssetTransaction()

bool CreateTransferAssetTransaction ( CWallet pwallet,
const CCoinControl coinControl,
const std::vector< std::pair< CAssetTransfer, std::string > >  vTransfers,
const std::string &  changeAddress,
std::pair< int, std::string > &  error,
CWalletTx wtxNew,
CReserveKey reservekey,
CAmount nFeeRequired,
std::vector< std::pair< CNullAssetTxData, std::string > > *  nullAssetTxData = nullptr,
std::vector< CNullAssetTxData > *  nullGlobalRestrictionData = nullptr 
)

Create a transfer asset transaction.

Definition at line 4094 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecodeAssetData()

std::string DecodeAssetData ( std::string  encoded)

Decode and Encode IPFS hashes, or OIP hashes.

Definition at line 3699 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecodeIPFS()

std::string DecodeIPFS ( std::string  encoded)

Definition at line 3729 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EncodeAssetData()

std::string EncodeAssetData ( std::string  decoded)

Definition at line 3716 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EncodeIPFS()

std::string EncodeIPFS ( std::string  decoded)

Definition at line 3737 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExtractVerifierStringQualifiers()

void ExtractVerifierStringQualifiers ( const std::string &  verifier,
std::set< std::string > &  qualifiers,
bool  fWithTag = true 
)

Helper method for extracting #TAGS from a verifier string.

Definition at line 4709 of file assets.cpp.

Here is the caller graph for this function:

◆ GetAddNullQualifierTagBurnAmount()

CAmount GetAddNullQualifierTagBurnAmount ( )

Definition at line 3569 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAllAdministrativeAssets()

void GetAllAdministrativeAssets ( CWallet pwallet,
std::vector< std::string > &  names,
int  nMinConf = 1 
)

Definition at line 3499 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAllMyAssetBalances()

bool GetAllMyAssetBalances ( std::map< std::string, std::vector< COutput > > &  outputs,
std::map< std::string, CAmount > &  amounts,
const int  confirmations = 0,
const std::string &  prefix = "" 
)

sets balances with the total quantity of each owned asset

Definition at line 3673 of file assets.cpp.

Here is the caller graph for this function:

◆ GetAllMyAssets()

void GetAllMyAssets ( CWallet pwallet,
std::vector< std::string > &  names,
int  nMinConf = 1,
bool  fIncludeAdministrator = false,
bool  fOnlyAdministrator = false 
)

Definition at line 3507 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAssetData()

bool GetAssetData ( const CScript script,
CAssetOutputEntry data 
)

Definition at line 3440 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAssetInfoFromCoin()

bool GetAssetInfoFromCoin ( const Coin coin,
std::string &  strName,
CAmount nAmount 
)

Definition at line 3435 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAssetInfoFromScript()

bool GetAssetInfoFromScript ( const CScript scriptPubKey,
std::string &  strName,
CAmount nAmount 
)

Definition at line 3423 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBestAssetAddressAmount()

bool GetBestAssetAddressAmount ( CAssetsCache cache,
const std::string &  assetName,
const std::string &  address 
)

This will get the amount that an address for a certain asset contains from the database if they cache doesn't already have it.

Definition at line 3645 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBurnAddress() [1/2]

std::string GetBurnAddress ( const AssetType  type)

Functions to be used to get access to the burn address for a given asset type issuance.

Definition at line 3614 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBurnAddress() [2/2]

std::string GetBurnAddress ( const int  nType)

Definition at line 3609 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBurnAmount() [1/2]

CAmount GetBurnAmount ( const AssetType  type)

Definition at line 3579 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBurnAmount() [2/2]

CAmount GetBurnAmount ( const int  nType)

Definition at line 3574 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIssueAssetBurnAmount()

CAmount GetIssueAssetBurnAmount ( )

Functions to be used to get access to the current burn amount required for specific asset issuance transactions.

Definition at line 3529 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIssueMsgChannelAssetBurnAmount()

CAmount GetIssueMsgChannelAssetBurnAmount ( )

Definition at line 3549 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIssueQualifierAssetBurnAmount()

CAmount GetIssueQualifierAssetBurnAmount ( )

Definition at line 3554 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIssueRestrictedAssetBurnAmount()

CAmount GetIssueRestrictedAssetBurnAmount ( )

Definition at line 3564 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIssueSubAssetBurnAmount()

CAmount GetIssueSubAssetBurnAmount ( )

Definition at line 3539 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIssueSubQualifierAssetBurnAmount()

CAmount GetIssueSubQualifierAssetBurnAmount ( )

Definition at line 3559 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIssueUniqueAssetBurnAmount()

CAmount GetIssueUniqueAssetBurnAmount ( )

Definition at line 3544 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetParentName()

std::string GetParentName ( const std::string &  name)

Get the root name of an asset.

Definition at line 366 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetReissueAssetBurnAmount()

CAmount GetReissueAssetBurnAmount ( )

Definition at line 3534 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStrippedVerifierString()

std::string GetStrippedVerifierString ( const std::string &  verifier)

Definition at line 4728 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTxOutAssetTypes()

void GetTxOutAssetTypes ( const std::vector< CTxOut > &  vout,
int &  issues,
int &  reissues,
int &  transfers,
int &  owners 
)

Definition at line 4299 of file assets.cpp.

Here is the caller graph for this function:

◆ GetUniqueAssetName()

std::string GetUniqueAssetName ( const std::string &  parent,
const std::string &  tag 
)

Build a unique asset buy giving the root name, and the tag name (ROOT, TAG) => ROOT::TAG.

Definition at line 399 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GlobalAssetNullDataFromScript()

bool GlobalAssetNullDataFromScript ( const CScript scriptPubKey,
CNullAssetTxData assetData 
)

Definition at line 840 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAssetNameAnMsgChannel()

bool IsAssetNameAnMsgChannel ( const std::string &  name)

Check if an asset is a message channel.

Definition at line 311 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAssetNameAnOwner()

bool IsAssetNameAnOwner ( const std::string &  name)

Check if an asset is an owner.

Definition at line 296 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAssetNameAnRestricted()

bool IsAssetNameAnRestricted ( const std::string &  name)

Check if an asset is a restricted asset.

Definition at line 301 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAssetNameAQualifier()

bool IsAssetNameAQualifier ( const std::string &  name)

Check if an asset is a qualifier asset or sub qualifier.

Definition at line 306 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAssetNameASubQualifier()

bool IsAssetNameASubQualifier ( const std::string &  name)

Check if an asset is a sub qualifier.

Definition at line 196 of file assets.cpp.

Here is the caller graph for this function:

◆ IsAssetNameValid() [1/3]

bool IsAssetNameValid ( const std::string &  name)

Check is an asset name is valid, and being able to return the asset type if needed.

Definition at line 283 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAssetNameValid() [2/3]

bool IsAssetNameValid ( const std::string &  name,
AssetType assetType 
)

Definition at line 290 of file assets.cpp.

Here is the call graph for this function:

◆ IsAssetNameValid() [3/3]

bool IsAssetNameValid ( const std::string &  name,
AssetType assetType,
std::string &  error 
)

Definition at line 207 of file assets.cpp.

Here is the caller graph for this function:

◆ IsNewOwnerTxValid()

bool IsNewOwnerTxValid ( const CTransaction tx,
const std::string &  assetName,
const std::string &  address,
std::string &  errorMsg 
)

Definition at line 596 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptNewAsset() [1/2]

bool IsScriptNewAsset ( const CScript scriptPubKey)

Check script and see if it matches the asset issuance template.

Definition at line 3101 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptNewAsset() [2/2]

bool IsScriptNewAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3107 of file assets.cpp.

Here is the call graph for this function:

◆ IsScriptNewMsgChannelAsset() [1/2]

bool IsScriptNewMsgChannelAsset ( const CScript scriptPubKey)

Check script and see if it matches the message channel issuance template.

Definition at line 3142 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptNewMsgChannelAsset() [2/2]

bool IsScriptNewMsgChannelAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3148 of file assets.cpp.

Here is the call graph for this function:

◆ IsScriptNewQualifierAsset() [1/2]

bool IsScriptNewQualifierAsset ( const CScript scriptPubKey)

Check script and see if it matches the qualifier issuance template.

Definition at line 3219 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptNewQualifierAsset() [2/2]

bool IsScriptNewQualifierAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3225 of file assets.cpp.

Here is the call graph for this function:

◆ IsScriptNewRestrictedAsset() [1/2]

bool IsScriptNewRestrictedAsset ( const CScript scriptPubKey)

Check script and see if it matches the restricted issueance template.

Definition at line 3244 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptNewRestrictedAsset() [2/2]

bool IsScriptNewRestrictedAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3250 of file assets.cpp.

Here is the call graph for this function:

◆ IsScriptNewUniqueAsset() [1/2]

bool IsScriptNewUniqueAsset ( const CScript scriptPubKey)

Check script and see if it matches the unquie issuance template.

Definition at line 3117 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptNewUniqueAsset() [2/2]

bool IsScriptNewUniqueAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3123 of file assets.cpp.

Here is the call graph for this function:

◆ IsScriptOwnerAsset() [1/2]

bool IsScriptOwnerAsset ( const CScript scriptPubKey)

Check script and see if it matches the owner issuance template.

Definition at line 3167 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptOwnerAsset() [2/2]

bool IsScriptOwnerAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3174 of file assets.cpp.

Here is the call graph for this function:

◆ IsScriptReissueAsset() [1/2]

bool IsScriptReissueAsset ( const CScript scriptPubKey)

Check script and see if it matches the reissue template.

Definition at line 3185 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptReissueAsset() [2/2]

bool IsScriptReissueAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3191 of file assets.cpp.

Here is the call graph for this function:

◆ IsScriptTransferAsset() [1/2]

bool IsScriptTransferAsset ( const CScript scriptPubKey)

Check script and see if it matches the transfer asset template.

Definition at line 3202 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsScriptTransferAsset() [2/2]

bool IsScriptTransferAsset ( const CScript scriptPubKey,
int &  nStartingIndex 
)

Definition at line 3208 of file assets.cpp.

Here is the call graph for this function:

◆ IsTypeCheckNameValid()

bool IsTypeCheckNameValid ( const AssetType  type,
const std::string &  name,
std::string &  error 
)

Given a type, and an asset name, return if that name is valid based on the type.

Definition at line 317 of file assets.cpp.

Here is the caller graph for this function:

◆ IsUniqueTagValid()

bool IsUniqueTagValid ( const std::string &  tag)

Check if an unique tagname is valid.

Definition at line 126 of file assets.cpp.

Here is the caller graph for this function:

◆ MsgChannelAssetFromScript()

bool MsgChannelAssetFromScript ( const CScript scriptPubKey,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 689 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MsgChannelAssetFromTransaction()

bool MsgChannelAssetFromTransaction ( const CTransaction tx,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 537 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OwnerAssetFromScript()

bool OwnerAssetFromScript ( const CScript scriptPubKey,
std::string &  assetName,
std::string &  strAddress 
)

Definition at line 764 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OwnerFromTransaction()

bool OwnerFromTransaction ( const CTransaction tx,
std::string &  ownerName,
std::string &  strAddress 
)

Definition at line 626 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseAssetScript()

bool ParseAssetScript ( CScript  scriptPubKey,
uint160 hashBytes,
std::string &  assetName,
CAmount assetAmount 
)

Helper method for extracting address bytes, asset name and amount from an asset script.

Definition at line 4317 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QualifierAssetFromScript()

bool QualifierAssetFromScript ( const CScript scriptPubKey,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 714 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QualifierAssetFromTransaction()

bool QualifierAssetFromTransaction ( const CTransaction tx,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 549 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReissueAssetFromScript()

bool ReissueAssetFromScript ( const CScript scriptPubKey,
CReissueAsset reissue,
std::string &  strAddress 
)

Definition at line 789 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReissueAssetFromTransaction()

bool ReissueAssetFromTransaction ( const CTransaction tx,
CReissueAsset reissue,
std::string &  strAddress 
)

Definition at line 572 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RestrictedAssetFromScript()

bool RestrictedAssetFromScript ( const CScript scriptPubKey,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 739 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RestrictedAssetFromTransaction()

bool RestrictedAssetFromTransaction ( const CTransaction tx,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 560 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendAssetTransaction()

bool SendAssetTransaction ( CWallet pwallet,
CWalletTx transaction,
CReserveKey reserveKey,
std::pair< int, std::string > &  error,
std::string &  txid 
)

Send any type of asset transaction to the network.

Definition at line 4243 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TransferAssetFromScript()

bool TransferAssetFromScript ( const CScript scriptPubKey,
CAssetTransfer assetTransfer,
std::string &  strAddress 
)

Get specific asset type metadata from the given scripts.

Definition at line 638 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UniqueAssetFromTransaction()

bool UniqueAssetFromTransaction ( const CTransaction tx,
CNewAsset asset,
std::string &  strAddress 
)

Definition at line 584 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VerifyGlobalRestrictedChange()

bool VerifyGlobalRestrictedChange ( CAssetsCache cache,
const CNullAssetTxData data,
std::string &  strError 
)

Definition at line 4858 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VerifyNullAssetDataFlag()

bool VerifyNullAssetDataFlag ( const int &  flag,
std::string &  strError 
)

Helper methods that validate changes to null asset data transaction databases.

Definition at line 4796 of file assets.cpp.

Here is the caller graph for this function:

◆ VerifyQualifierChange()

bool VerifyQualifierChange ( CAssetsCache cache,
const CNullAssetTxData data,
const std::string &  address,
std::string &  strError 
)

Definition at line 4807 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VerifyRestrictedAddressChange()

bool VerifyRestrictedAddressChange ( CAssetsCache cache,
const CNullAssetTxData data,
const std::string &  address,
std::string &  strError 
)

Definition at line 4831 of file assets.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VerifyWalletHasAsset()

bool VerifyWalletHasAsset ( const std::string &  asset_name,
std::pair< int, std::string > &  pairError 
)

Verifies that this wallet owns the give asset.

Definition at line 4255 of file assets.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ mapReissuedAssets

std::map<std::string, uint256> mapReissuedAssets

Definition at line 41 of file assets.cpp.

◆ mapReissuedTx

std::map<uint256, std::string> mapReissuedTx

Definition at line 40 of file assets.cpp.