Delete more CCs #381

This commit is contained in:
Duke
2024-02-11 00:50:36 -05:00
parent 5bdb204001
commit ca169d9300
4 changed files with 3 additions and 346 deletions

View File

@@ -215,7 +215,6 @@ bool GetAddressUnspent(uint160 addressHash, int type,std::vector<std::pair<CAddr
int32_t CCgetspenttxid(uint256 &spenttxid,int32_t &vini,int32_t &height,uint256 txid,int32_t vout);
/// @private
void CCclearvars(struct CCcontract_info *cp);
UniValue CClib(struct CCcontract_info *cp,char *method,char *jsonstr);
UniValue CClib_info(struct CCcontract_info *cp);
@@ -290,21 +289,6 @@ CPubKey CCtxidaddr(char *txidaddr,uint256 txid);
/// @return public key for the created address
CPubKey CCCustomtxidaddr(char *txidaddr,uint256 txid,uint8_t taddr,uint8_t prefix,uint8_t prefix2);
// TODO: description
/// @private
bool GetCCParams(Eval* eval, const CTransaction &tx, uint32_t nIn,
CTransaction &txOut, std::vector<std::vector<unsigned char>> &preConditions, std::vector<std::vector<unsigned char>> &params);
/// \cond INTERNAL
int64_t OraclePrice(int32_t height,uint256 reforacletxid,char *markeraddr,char *format);
uint256 OracleMerkle(int32_t height,uint256 reforacletxid,char *format,std::vector<struct oracle_merklepair>publishers);
uint256 OraclesBatontxid(uint256 oracletxid,CPubKey pk);
uint8_t DecodeOraclesCreateOpRet(const CScript &scriptPubKey,std::string &name,std::string &description,std::string &format);
uint8_t DecodeOraclesOpRet(const CScript &scriptPubKey,uint256 &oracletxid,CPubKey &pk,int64_t &num);
uint8_t DecodeOraclesData(const CScript &scriptPubKey,uint256 &oracletxid,uint256 &batontxid,CPubKey &pk,std::vector <uint8_t>&data);
int32_t oracle_format(uint256 *hashp,int64_t *valp,char *str,uint8_t fmt,uint8_t *data,int32_t offset,int32_t datalen);
/// \endcond
/// Adds token inputs to transaction object. If tokenid is a non-fungible token then the function will set additionalTokensEvalcode2 variable in the cp object to the eval code from NFT data to spend NFT outputs properly
/// @param cp CCcontract_info structure
/// @param mtx mutable transaction object
@@ -340,71 +324,6 @@ bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx);
/// @private
int32_t payments_parsehexdata(std::vector<uint8_t> &hexdata,cJSON *item,int32_t len);
/// Makes opreturn scriptPubKey for token creation transaction. Normally this function is called internally by the tokencreate rpc. You might need to call this function to create a customized token.
/// The total opreturn length should not exceed 10001 byte
/// @param funcid should be set to 'c' character
/// @param origpubkey token creator pubkey as byte array
/// @param name token name (no more than 32 char)
/// @param description token description (no more than 4096 char)
/// @param vopretNonfungible NFT data, could be empty. If not empty, NFT will be created, the first byte if the NFT data should be set to the eval code of the contract validating this NFT data
/// @returns scriptPubKey with OP_RETURN script
CScript EncodeTokenCreateOpRet(uint8_t funcid, std::vector<uint8_t> origpubkey, std::string name, std::string description, vscript_t vopretNonfungible);
/// Makes opreturn scriptPubKey for token creation transaction. Normally this function is called internally by the tokencreate rpc. You might need to call it to create a customized token.
/// The total opreturn length should not exceed 10001 byte
/// @param funcid should be set to 'c' character
/// @param origpubkey token creator pubkey as byte array
/// @param name token name (no more than 32 char)
/// @param description token description (no more than 4096 char)
/// @param oprets vector of pairs of additional data added to the token opret. The first element in the pair is opretid enum, the second is the data as byte array
/// @returns scriptPubKey with OP_RETURN script
/// @see opretid
CScript EncodeTokenCreateOpRet(uint8_t funcid, std::vector<uint8_t> origpubkey, std::string name, std::string description, std::vector<std::pair<uint8_t, vscript_t>> oprets);
/// Makes opreturn scriptPubKey for token transaction. Normally this function is called internally by the token rpcs. You might call this function if your module should create a customized token.
/// The total opreturn length should not exceed 10001 byte
/// @param tokenid id of the token
/// @param voutPubkeys vector of pubkeys used to make the token vout in the same transaction that the created opreturn is for, the pubkeys are used for token vout validation
/// @param opretWithId a pair of additional opreturn data added to the token opret. Could be empty. The first element in the pair is opretid enum, the second is the data as byte array
/// @returns scriptPubKey with OP_RETURN script
CScript EncodeTokenOpRet(uint256 tokenid, std::vector<CPubKey> voutPubkeys, std::pair<uint8_t, vscript_t> opretWithId);
/// An overload to make opreturn scriptPubKey for token transaction. Normally this function is called internally by the token rpcs. You might call this function if your module should create a customized token.
/// The total opreturn length should not exceed 10001 byte
/// @param tokenid id of the token
/// @param voutPubkeys vector of pubkeys used to make the token vout in the same transaction that the created opreturn is for, the pubkeys are used for token vout validation
/// @param oprets vector of pairs of additional opreturn data added to the token opret. Could be empty. The first element in the pair is opretid enum, the second is the data as byte array
/// @returns scriptPubKey with OP_RETURN script
CScript EncodeTokenOpRet(uint256 tokenid, std::vector<CPubKey> voutPubkeys, std::vector<std::pair<uint8_t, vscript_t>> oprets);
/// Decodes opreturn scriptPubKey of token creation transaction. Normally this function is called internally by the token rpcs. You might call this function if your module should create a customized token.
/// @param scriptPubKey OP_RETURN script to decode
/// @param[out] origpubkey creator public key as a byte array
/// @param[out] name token name
/// @param[out] description token description
/// @returns funcid ('c') or NULL if errors
uint8_t DecodeTokenCreateOpRet(const CScript &scriptPubKey, std::vector<uint8_t> &origpubkey, std::string &name, std::string &description);
/// Overload that decodes opreturn scriptPubKey of token creation transaction and also returns additional data blobs.
/// Normally this function is called internally by the token rpcs. You might want to call this function if your module should create a customized token.
/// @param scriptPubKey OP_RETURN script to decode
/// @param[out] origpubkey creator public key as a byte array
/// @param[out] name token name
/// @param[out] description token description
/// @param[out] oprets vector of pairs of additional opreturn data added to the token opret. Could be empty if not set. The first element in the pair is opretid enum, the second is the data as byte array
/// @returns funcid ('c') or NULL if errors
uint8_t DecodeTokenCreateOpRet(const CScript &scriptPubKey, std::vector<uint8_t> &origpubkey, std::string &name, std::string &description, std::vector<std::pair<uint8_t, vscript_t>> &oprets);
/// Decodes opreturn scriptPubKey of token transaction, also returns additional data blobs.
/// Normally this function is called internally by different token rpc. You might want to call if your module created a customized token.
/// @param scriptPubKey OP_RETURN script to decode
/// @param[out] evalCodeTokens should be EVAL_TOKENS
/// @param[out] tokenid id of token
/// @param[out] voutPubkeys vector of token output validation pubkeys from the opreturn
/// @param[out] oprets vector of pairs of additional opreturn data added to the token opret. Could be empty if not set. The first element in the pair is opretid enum, the second is the data as byte array
/// @returns funcid ('c' if creation tx or 't' if token transfer tx) or NULL if errors
uint8_t DecodeTokenOpRet(const CScript scriptPubKey, uint8_t &evalCodeTokens, uint256 &tokenid, std::vector<CPubKey> &voutPubkeys, std::vector<std::pair<uint8_t, vscript_t>> &oprets);
/// @private
int64_t AddCClibtxfee(struct CCcontract_info *cp, CMutableTransaction &mtx, CPubKey pk);
@@ -649,18 +568,6 @@ std::vector<uint8_t> Mypubkey();
/// @see Mypubkey
bool Myprivkey(uint8_t myprivkey[]);
/// Returns duration in seconds and number of blocks since the block where a transaction resides till the chain tip
/// @param[out] numblocks number of blocks from the block where the transaction with txid resides
/// @param txid id of the transaction that is queried of
/// @return duration in seconds since the block where the transaction with txid resides
int64_t CCduration(int32_t &numblocks,uint256 txid);
/// @private
uint256 CCOraclesReverseScan(char const *logcategory,uint256 &txid,int32_t height,uint256 reforacletxid,uint256 batontxid);
/// @private
int32_t CCCointxidExists(char const *logcategory,uint256 cointxid);
/// @private
uint256 BitcoinGetProofMerkleRoot(const std::vector<uint8_t> &proofData, std::vector<uint256> &txids);