Raven Core  3.0.0
P2P Digital Currency
Macros | Functions | Variables
assets.cpp File Reference
#include <regex>
#include <script/script.h>
#include <version.h>
#include <streams.h>
#include <primitives/transaction.h>
#include <iostream>
#include <script/standard.h>
#include <util.h>
#include <chainparams.h>
#include <base58.h>
#include <validation.h>
#include <txmempool.h>
#include <tinyformat.h>
#include <wallet/wallet.h>
#include <boost/algorithm/string.hpp>
#include <consensus/validation.h>
#include <rpc/protocol.h>
#include <net.h>
#include "assets.h"
#include "assetdb.h"
#include "assettypes.h"
#include "protocol.h"
#include "wallet/coincontrol.h"
#include "utilmoneystr.h"
#include "coins.h"
#include "LibBoolEE.h"
Include dependency graph for assets.cpp:

Go to the source code of this file.

Macros

#define SIX_MONTHS   15780000
 
#define OFFSET_THREE   3
 
#define OFFSET_FOUR   4
 
#define OFFSET_TWENTY_THREE   23
 

Functions

bool IsRootNameValid (const std::string &name)
 
bool IsQualifierNameValid (const std::string &name)
 
bool IsRestrictedNameValid (const std::string &name)
 
bool IsSubQualifierNameValid (const std::string &name)
 
bool IsSubNameValid (const std::string &name)
 
bool IsUniqueTagValid (const std::string &tag)
 Check if an unique tagname is valid. More...
 
bool IsVoteTagValid (const std::string &tag)
 
bool IsMsgChannelTagValid (const std::string &tag)
 
bool IsNameValidBeforeTag (const std::string &name)
 
bool IsQualifierNameValidBeforeTag (const std::string &name)
 
bool IsAssetNameASubasset (const std::string &name)
 
bool IsAssetNameASubQualifier (const std::string &name)
 Check if an asset is a sub qualifier. More...
 
bool IsAssetNameValid (const std::string &name, AssetType &assetType, std::string &error)
 
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 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 IsAssetNameAnMsgChannel (const std::string &name)
 Check if an asset is a message channel. 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...
 
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 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 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 ReissueAssetFromTransaction (const CTransaction &tx, CReissueAsset &reissue, std::string &strAddress)
 
bool UniqueAssetFromTransaction (const CTransaction &tx, CNewAsset &asset, std::string &strAddress)
 
bool IsNewOwnerTxValid (const CTransaction &tx, const std::string &assetName, const std::string &address, std::string &errorMsg)
 
bool OwnerFromTransaction (const CTransaction &tx, std::string &ownerName, 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 &assetNew, std::string &strAddress)
 
bool MsgChannelAssetFromScript (const CScript &scriptPubKey, CNewAsset &assetNew, std::string &strAddress)
 
bool QualifierAssetFromScript (const CScript &scriptPubKey, CNewAsset &assetNew, std::string &strAddress)
 
bool RestrictedAssetFromScript (const CScript &scriptPubKey, CNewAsset &assetNew, 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 AssetNullDataFromScript (const CScript &scriptPubKey, CNullAssetTxData &assetData, std::string &strAddress)
 
bool GlobalAssetNullDataFromScript (const CScript &scriptPubKey, CNullAssetTxData &assetData)
 
bool AssetNullVerifierDataFromScript (const CScript &scriptPubKey, CNullAssetTxVerifierString &verifierData)
 
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 CheckReissueDataTx (const CTxOut &txOut)
 
bool CheckOwnerDataTx (const CTxOut &txOut)
 
bool CheckTransferOwnerTx (const CTxOut &txOut)
 
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 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 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 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 GetAssetInfoFromScript (const CScript &scriptPubKey, std::string &strName, CAmount &nAmount)
 
bool GetAssetInfoFromCoin (const Coin &coin, std::string &strName, CAmount &nAmount)
 
bool GetAssetData (const CScript &script, CAssetOutputEntry &data)
 
void GetAllAdministrativeAssets (CWallet *pwallet, std::vector< std::string > &names, int nMinConf)
 
void GetAllMyAssets (CWallet *pwallet, std::vector< std::string > &names, int nMinConf, bool fIncludeAdministrator, bool fOnlyAdministrator)
 
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 int nType)
 
CAmount GetBurnAmount (const AssetType type)
 
std::string GetBurnAddress (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...
 
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, const std::string &prefix)
 sets balances with the total quantity of each owned 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)
 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)
 
bool CreateReissueAssetTransaction (CWallet *pwallet, CCoinControl &coinControl, const CReissueAsset &reissueAsset, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string)
 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, std::vector< CNullAssetTxData > *nullGlobalRestrictionData)
 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 VerifyWalletHasAsset (const std::string &asset_name, std::pair< int, std::string > &pairError)
 Verifies that this wallet owns the give asset. 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 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...
 
void GetTxOutAssetTypes (const std::vector< CTxOut > &vout, int &issues, int &reissues, int &transfers, int &owners)
 
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)
 Helper method for extracting #TAGS from a verifier string. More...
 
std::string GetStrippedVerifierString (const std::string &verifier)
 
bool CheckVerifierString (const std::string &verifier, std::set< std::string > &setFoundQualifiers, std::string &strError, bool fWithTags)
 
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 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)
 
bool ContextualCheckTransferAsset (CAssetsCache *assetCache, const CAssetTransfer &transfer, const std::string &address, std::string &strError)
 
bool CheckNewAsset (const CNewAsset &asset, std::string &strError)
 
bool ContextualCheckNewAsset (CAssetsCache *assetCache, const CNewAsset &asset, std::string &strError, bool fCheckMempool)
 
bool CheckReissueAsset (const CReissueAsset &asset, 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

◆ OFFSET_FOUR

#define OFFSET_FOUR   4

Definition at line 36 of file assets.cpp.

◆ OFFSET_THREE

#define OFFSET_THREE   3

Definition at line 35 of file assets.cpp.

◆ OFFSET_TWENTY_THREE

#define OFFSET_TWENTY_THREE   23

Definition at line 37 of file assets.cpp.

◆ SIX_MONTHS

#define SIX_MONTHS   15780000

Definition at line 33 of file assets.cpp.

Function Documentation

◆ AssetFromScript()

bool AssetFromScript ( const CScript scriptPubKey,
CNewAsset assetNew,
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 
)

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 
)

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 
)

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 
)

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 
)

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 reissueAsset,
const std::string &  address,
std::pair< int, std::string > &  error,
CWalletTx wtxNew,
CReserveKey reservekey,
CAmount nFeeRequired,
std::string *  verifier_string 
)

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,
std::vector< CNullAssetTxData > *  nullGlobalRestrictionData 
)

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 
)

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 
)

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,
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,
bool  fIncludeAdministrator,
bool  fOnlyAdministrator 
)

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 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:

◆ GetBurnAddress() [2/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:

◆ GetBurnAmount() [1/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:

◆ GetBurnAmount() [2/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:

◆ 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:

◆ IsAssetNameASubasset()

bool IsAssetNameASubasset ( const std::string &  name)

Definition at line 186 of file assets.cpp.

◆ 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,
AssetType assetType,
std::string &  error 
)

Definition at line 207 of file assets.cpp.

Here is the caller graph for this function:

◆ IsAssetNameValid() [2/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() [3/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:

◆ IsMsgChannelTagValid()

bool IsMsgChannelTagValid ( const std::string &  tag)

Definition at line 136 of file assets.cpp.

◆ IsNameValidBeforeTag()

bool IsNameValidBeforeTag ( const std::string &  name)

Definition at line 144 of file assets.cpp.

◆ 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:

◆ IsQualifierNameValid()

bool IsQualifierNameValid ( const std::string &  name)

Definition at line 92 of file assets.cpp.

Here is the caller graph for this function:

◆ IsQualifierNameValidBeforeTag()

bool IsQualifierNameValidBeforeTag ( const std::string &  name)

Definition at line 162 of file assets.cpp.

◆ IsRestrictedNameValid()

bool IsRestrictedNameValid ( const std::string &  name)

Definition at line 101 of file assets.cpp.

◆ IsRootNameValid()

bool IsRootNameValid ( const std::string &  name)

Definition at line 83 of file assets.cpp.

◆ 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:

◆ IsSubNameValid()

bool IsSubNameValid ( const std::string &  name)

Definition at line 118 of file assets.cpp.

◆ IsSubQualifierNameValid()

bool IsSubQualifierNameValid ( const std::string &  name)

Definition at line 110 of file assets.cpp.

◆ 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:

◆ IsVoteTagValid()

bool IsVoteTagValid ( const std::string &  tag)

Definition at line 131 of file assets.cpp.

◆ MsgChannelAssetFromScript()

bool MsgChannelAssetFromScript ( const CScript scriptPubKey,
CNewAsset assetNew,
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 assetNew,
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 assetNew,
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.