//bool result = E_UNMARSHAL(vopret, ss >> evalCodeInOpret; ss >> funcId; ss >> tokenid; ss >> assetFuncId; isEof = ss.eof());
if(funcId==0||vopretAssets.size()<2){
LOGSTREAM("ccassets",CCLOG_INFO,stream<<"DecodeAssetTokenOpRet() incorrect opret or no asset's payload"<<" funcId="<<(int)funcId<<" vopretAssets.size()="<<vopretAssets.size()<<std::endl);
LOGSTREAM((char*)"ccassets",CCLOG_INFO,stream<<"DecodeAssetTokenOpRet() incorrect opret or no asset's payload"<<" funcId="<<(int)funcId<<" vopretAssets.size()="<<vopretAssets.size()<<std::endl);
LOGSTREAM("cctokens",CCLOG_INFO,stream<<"DecodeTokenOpRet() bad opret format, isEof="<<isEof<<" ccType="<<ccType<<" tokenid="<<revuint256(tokenid).GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_INFO,stream<<"DecodeTokenOpRet() bad opret format, isEof="<<isEof<<" ccType="<<ccType<<" tokenid="<<revuint256(tokenid).GetHex()<<std::endl);
LOGSTREAM("cctokens",CCLOG_INFO,stream<<indentStr<<"ValidateTokenOpret() DecodeTokenOpret could not parse opret for txid="<<tx.GetHash().GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_INFO,stream<<indentStr<<"ValidateTokenOpret() DecodeTokenOpret could not parse opret for txid="<<tx.GetHash().GetHex()<<std::endl);
return(uint8_t)0;
}
elseif(funcid=='c')
{
if(tokenid!=zeroid&&tokenid==tx.GetHash()){
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() this is the tokenbase 'c' tx, txid="<<tx.GetHash().GetHex()<<" returning true"<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() this is the tokenbase 'c' tx, txid="<<tx.GetHash().GetHex()<<" returning true"<<std::endl);
returnfuncid;
}
else{
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() not my tokenbase txid="<<tx.GetHash().GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() not my tokenbase txid="<<tx.GetHash().GetHex()<<std::endl);
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() this is a transfer 't' tx, txid="<<tx.GetHash().GetHex()<<" returning true"<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() this is a transfer 't' tx, txid="<<tx.GetHash().GetHex()<<" returning true"<<std::endl);
returnfuncid;
}
else{
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() not my tokenid="<<tokenidOpret.GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() not my tokenid="<<tokenidOpret.GetHex()<<std::endl);
}
}
else{
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() not supported funcid="<<(char)funcid<<" tokenIdOpret="<<tokenidOpret.GetHex()<<" txid="<<tx.GetHash().GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"ValidateTokenOpret() not supported funcid="<<(char)funcid<<" tokenIdOpret="<<tokenidOpret.GetHex()<<" txid="<<tx.GetHash().GetHex()<<std::endl);
LOGSTREAM("cctokens",CCLOG_DEBUG2,stream<<indentStr<<"IsTokensvout() entered for txid="<<tx.GetHash().GetHex()<<" v="<<v<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG2,stream<<indentStr<<"IsTokensvout() entered for txid="<<tx.GetHash().GetHex()<<" v="<<v<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
int32_tn=tx.vout.size();
// just check boundaries:
if(n==0||v<0||v>=n-1){
LOGSTREAM("cctokens",CCLOG_INFO,stream<<indentStr<<"isTokensvout() incorrect params: (n == 0 or v < 0 or v >= n-1)"<<" v="<<v<<" n="<<n<<" returning 0"<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_INFO,stream<<indentStr<<"isTokensvout() incorrect params: (n == 0 or v < 0 or v >= n-1)"<<" v="<<v<<" n="<<n<<" returning 0"<<std::endl);
// if ccInputs != ccOutputs and it is not the tokenbase tx
// this means it is possibly a fake tx (dimxy):
if(reftokenid!=tx.GetHash()){// checking that this is the true tokenbase tx, by verifying that funcid=c, is done further in this function (dimxy)
LOGSTREAM("cctokens",CCLOG_INFO,stream<<indentStr<<"IsTokensvout() warning: for the verified tx detected a bad vintx="<<tx.GetHash().GetHex()<<": cc inputs != cc outputs and not the 'tokenbase' tx, skipping the verified tx"<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_INFO,stream<<indentStr<<"IsTokensvout() warning: for the verified tx detected a bad vintx="<<tx.GetHash().GetHex()<<": cc inputs != cc outputs and not the 'tokenbase' tx, skipping the verified tx"<<std::endl);
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"IsTokensvout() ValidateTokenOpret returned not-null funcId="<<(char)(funcId?funcId:'')<<" for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"IsTokensvout() ValidateTokenOpret returned not-null funcId="<<(char)(funcId?funcId:'')<<" for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"IsTokensvout() no valid vouts evalCode="<<(int)evalCode<<" evalCode2="<<(int)evalCode2<<" for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"IsTokensvout() no valid vouts evalCode="<<(int)evalCode<<" evalCode2="<<(int)evalCode2<<" for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
}
else{
LOGSTREAM("cctokens",CCLOG_INFO,stream<<indentStr<<"IsTokensvout() returns without pubkey check value="<<tx.vout[v].nValue<<" for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_INFO,stream<<indentStr<<"IsTokensvout() returns without pubkey check value="<<tx.vout[v].nValue<<" for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
LOGSTREAM("cctokens",CCLOG_DEBUG2,stream<<indentStr<<"TokensExactAmounts() entered for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG2,stream<<indentStr<<"TokensExactAmounts() entered for txid="<<tx.GetHash().GetHex()<<" for tokenid="<<reftokenid.GetHex()<<std::endl);
for(int32_ti=0;i<numvins;i++)
{// check for additional contracts which may send tokens to the Tokens contract
LOGSTREAM("cctokens",CCLOG_DEBUG1,stream<<indentStr<<"TokenExactAmounts() found unequal token cc inputs="<<inputs<<" vs cc outputs="<<outputs<<" for txid="<<tx.GetHash().GetHex()<<" and this is not the create tx"<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_DEBUG1,stream<<indentStr<<"TokenExactAmounts() found unequal token cc inputs="<<inputs<<" vs cc outputs="<<outputs<<" for txid="<<tx.GetHash().GetHex()<<" and this is not the create tx"<<std::endl);
LOGSTREAM("cctokens",CCLOG_INFO,stream<<"AddTokenCCInputs() no utxos for token dual/three eval addr="<<tokenaddr<<" evalcode="<<(int)cp->evalcode<<" additionalTokensEvalcode2="<<(int)cp->additionalTokensEvalcode2<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_INFO,stream<<"AddTokenCCInputs() no utxos for token dual/three eval addr="<<tokenaddr<<" evalcode="<<(int)cp->evalcode<<" additionalTokensEvalcode2="<<(int)cp->additionalTokensEvalcode2<<std::endl);
}
threshold=total/(maxinputs!=0?maxinputs:64);// TODO: maxinputs really could not be over 64? what if i want to calc total balance for all available uxtos?
LOGSTREAM("cctokens",CCLOG_INFO,stream<<"AddTokenCCInputs() found incorrect non-fungible opret payload for vintxid="<<vintxid.GetHex()<<std::endl);
LOGSTREAM((char*)"cctokens",CCLOG_INFO,stream<<"AddTokenCCInputs() found incorrect non-fungible opret payload for vintxid="<<vintxid.GetHex()<<std::endl);
if((inputs=AddTokenCCInputs(cp,mtx,mypk,tokenid,total,60,vopretNonfungible))>0)// NOTE: AddTokenCCInputs might set cp->additionalEvalCode which is used in FinalizeCCtx!