Merge nonfungible
This commit is contained in:
@@ -199,12 +199,7 @@ CC *MakeCCcond1of2(uint8_t evalcode,CPubKey pk1,CPubKey pk2);
|
|||||||
CC* GetCryptoCondition(CScript const& scriptSig);
|
CC* GetCryptoCondition(CScript const& scriptSig);
|
||||||
void CCaddr2set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr);
|
void CCaddr2set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr);
|
||||||
void CCaddr3set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr);
|
void CCaddr3set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr);
|
||||||
<<<<<<< HEAD
|
|
||||||
void CCaddr1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2,uint8_t *priv,char *coinaddr);
|
void CCaddr1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2,uint8_t *priv,char *coinaddr);
|
||||||
|
|
||||||
=======
|
|
||||||
void CCaddr1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2, char *coinaddr);
|
|
||||||
>>>>>>> FSM
|
|
||||||
CTxOut MakeTokensCC1of2vout(uint8_t evalcode, CAmount nValue, CPubKey pk1, CPubKey pk2);
|
CTxOut MakeTokensCC1of2vout(uint8_t evalcode, CAmount nValue, CPubKey pk1, CPubKey pk2);
|
||||||
CTxOut MakeTokensCC1of2vout(uint8_t evalcode, uint8_t evalcode2, CAmount nValue, CPubKey pk1, CPubKey pk2);
|
CTxOut MakeTokensCC1of2vout(uint8_t evalcode, uint8_t evalcode2, CAmount nValue, CPubKey pk1, CPubKey pk2);
|
||||||
CTxOut MakeTokensCC1vout(uint8_t evalcode, CAmount nValue, CPubKey pk);
|
CTxOut MakeTokensCC1vout(uint8_t evalcode, CAmount nValue, CPubKey pk);
|
||||||
|
|||||||
@@ -713,13 +713,9 @@ int64_t AddTokenCCInputs(struct CCcontract_info *cp, CMutableTransaction &mtx, C
|
|||||||
strcmp(destaddr, cp->unspendableaddr2) != 0) // or the logic is to allow to spend all available tokens (what about unspendableaddr3)?
|
strcmp(destaddr, cp->unspendableaddr2) != 0) // or the logic is to allow to spend all available tokens (what about unspendableaddr3)?
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
if ((nValue = IsTokensvout(true, true/*<--add only checked token uxtos */, cp, NULL, vintx, vout, tokenid)) > 0 && myIsutxo_spentinmempool(ignoretxid,ignorevin,txid, vout) == 0)
|
|
||||||
=======
|
|
||||||
LOGSTREAM("cctokens", CCLOG_DEBUG1, stream << "AddTokenCCInputs() check vintx vout destaddress=" << destaddr << " amount=" << vintx.vout[vout].nValue << std::endl);
|
LOGSTREAM("cctokens", CCLOG_DEBUG1, stream << "AddTokenCCInputs() check vintx vout destaddress=" << destaddr << " amount=" << vintx.vout[vout].nValue << std::endl);
|
||||||
|
|
||||||
if ((nValue = IsTokensvout(true, true/*<--add only valid token uxtos */, cp, NULL, vintx, vout, tokenid)) > 0 && myIsutxo_spentinmempool(vintxid, vout) == 0)
|
if ((nValue = IsTokensvout(true, true/*<--add only valid token uxtos */, cp, NULL, vintx, vout, tokenid)) > 0 && myIsutxo_spentinmempool(ignoretxid,ignorevin,vintxid, vout) == 0)
|
||||||
>>>>>>> FSM
|
|
||||||
{
|
{
|
||||||
//for non-fungible tokens check payload:
|
//for non-fungible tokens check payload:
|
||||||
if (!vopretNonfungible.empty()) {
|
if (!vopretNonfungible.empty()) {
|
||||||
|
|||||||
@@ -46,15 +46,9 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
CTransaction vintx; std::string hex; CPubKey globalpk; uint256 hashBlock; uint64_t mask=0,nmask=0,vinimask=0;
|
CTransaction vintx; std::string hex; CPubKey globalpk; uint256 hashBlock; uint64_t mask=0,nmask=0,vinimask=0;
|
||||||
int64_t utxovalues[CC_MAXVINS],change,normalinputs=0,totaloutputs=0,normaloutputs=0,totalinputs=0,normalvins=0,ccvins=0;
|
int64_t utxovalues[CC_MAXVINS],change,normalinputs=0,totaloutputs=0,normaloutputs=0,totalinputs=0,normalvins=0,ccvins=0;
|
||||||
int32_t i,flag,utxovout,n,err = 0;
|
int32_t i,flag,utxovout,n,err = 0;
|
||||||
<<<<<<< HEAD
|
char myaddr[64], destaddr[64], unspendable[64], mytokensaddr[64], mysingletokensaddr[64], unspendabletokensaddr[64],CC1of2CCaddr[64];
|
||||||
char myaddr[64], destaddr[64], unspendable[64], mytokensaddr[64], mysingletokensaddr[64], tokensunspendable[64],CC1of2CCaddr[64];
|
|
||||||
uint8_t *privkey, myprivkey[32], unspendablepriv[32], tokensunspendablepriv[32], *msg32 = 0;
|
|
||||||
CC *mycond=0, *othercond=0, *othercond2=0,*othercond4=0, *othercond3=0, *othercond1of2=NULL, *othercond1of2tokens = NULL, *cond, *condCC2=0,*mytokenscond = NULL, *mysingletokenscond = NULL, *othertokenscond = NULL;
|
|
||||||
=======
|
|
||||||
char myaddr[64], destaddr[64], unspendable[64], mytokensaddr[64], mysingletokensaddr[64], unspendabletokensaddr[64];
|
|
||||||
uint8_t *privkey, myprivkey[32], unspendablepriv[32], /*tokensunspendablepriv[32],*/ *msg32 = 0;
|
uint8_t *privkey, myprivkey[32], unspendablepriv[32], /*tokensunspendablepriv[32],*/ *msg32 = 0;
|
||||||
CC *mycond=0, *othercond=0, *othercond2=0,*othercond4=0, *othercond3=0, *othercond1of2=NULL, *othercond1of2tokens = NULL, *cond, *mytokenscond = NULL, *mysingletokenscond = NULL, *othertokenscond = NULL;
|
CC *mycond=0, *othercond=0, *othercond2=0,*othercond4=0, *othercond3=0, *othercond1of2=NULL, *othercond1of2tokens = NULL, *cond, *condCC2=0,*mytokenscond = NULL, *mysingletokenscond = NULL, *othertokenscond = NULL;
|
||||||
>>>>>>> FSM
|
|
||||||
CPubKey unspendablepk /*, tokensunspendablepk*/;
|
CPubKey unspendablepk /*, tokensunspendablepk*/;
|
||||||
struct CCcontract_info *cpTokens, tokensC;
|
struct CCcontract_info *cpTokens, tokensC;
|
||||||
globalpk = GetUnspendable(cp,0);
|
globalpk = GetUnspendable(cp,0);
|
||||||
@@ -215,13 +209,8 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
// check if this is spending from 1of2 cc coins addr:
|
// check if this is spending from 1of2 cc coins addr:
|
||||||
else if (strcmp(cp->coins1of2addr, destaddr) == 0)
|
else if (strcmp(cp->coins1of2addr, destaddr) == 0)
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
//fprintf(stderr,"FinalizeCCTx() matched %s unspendable1of2!\n",cp->coins1of2addr);
|
//fprintf(stderr,"FinalizeCCTx() matched %s unspendable1of2!\n",cp->coins1of2addr);
|
||||||
privkey = cp->coins1of2priv;//myprivkey;
|
privkey = cp->coins1of2priv;//myprivkey;
|
||||||
=======
|
|
||||||
fprintf(stderr,"FinalizeCCTx() matched %s unspendable1of2!\n",cp->coins1of2addr);
|
|
||||||
privkey = myprivkey;
|
|
||||||
>>>>>>> FSM
|
|
||||||
if (othercond1of2 == 0)
|
if (othercond1of2 == 0)
|
||||||
othercond1of2 = MakeCCcond1of2(cp->evalcode, cp->coins1of2pk[0], cp->coins1of2pk[1]);
|
othercond1of2 = MakeCCcond1of2(cp->evalcode, cp->coins1of2pk[0], cp->coins1of2pk[1]);
|
||||||
cond = othercond1of2;
|
cond = othercond1of2;
|
||||||
|
|||||||
@@ -7046,12 +7046,6 @@ UniValue tokenbalance(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
UniValue tokencreate(const UniValue& params, bool fHelp)
|
UniValue tokencreate(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
UniValue result(UniValue::VOBJ); std::string name,description,hex; uint64_t supply;
|
|
||||||
if ( fHelp || params.size() > 3 || params.size() < 2 )
|
|
||||||
throw runtime_error("tokencreate name supply description\n");
|
|
||||||
if ( ensure_CCrequirements(EVAL_TOKENS) < 0 )
|
|
||||||
=======
|
|
||||||
UniValue result(UniValue::VOBJ);
|
UniValue result(UniValue::VOBJ);
|
||||||
std::string name, description, hextx;
|
std::string name, description, hextx;
|
||||||
std::vector<uint8_t> nonfungibleData;
|
std::vector<uint8_t> nonfungibleData;
|
||||||
@@ -7061,8 +7055,7 @@ UniValue tokencreate(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
if ( fHelp || params.size() > 4 || params.size() < 2 )
|
if ( fHelp || params.size() > 4 || params.size() < 2 )
|
||||||
throw runtime_error("tokencreate name supply [description][data]\n");
|
throw runtime_error("tokencreate name supply [description][data]\n");
|
||||||
if ( ensure_CCrequirements() < 0 )
|
if ( ensure_CCrequirements(EVAL_TOKENS) < 0 )
|
||||||
>>>>>>> FSM
|
|
||||||
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
|
||||||
|
|
||||||
const CKeyStore& keystore = *pwalletMain;
|
const CKeyStore& keystore = *pwalletMain;
|
||||||
|
|||||||
Reference in New Issue
Block a user