Asset contract modified to support the Tokens contract

This commit is contained in:
dimxy
2019-01-07 23:24:13 +05:00
parent be71d108b2
commit 675787d676
11 changed files with 303 additions and 135 deletions

View File

@@ -407,6 +407,20 @@ bool CScript::MayAcceptCryptoCondition() const
cc_free(cond);
return out;
}
struct CC *CScript::GetCryptoCondition() const
{
// Get the type mask of the condition
const_iterator pc = this->begin();
vector<unsigned char> data;
opcodetype opcode;
if (!this->GetOp(pc, opcode, data)) return NULL;
if (!(opcode > OP_0 && opcode < OP_PUSHDATA1)) return NULL;
struct CC *cond = cc_readConditionBinary(data.data(), data.size());
if (!cond) return NULL;
//bool out = IsSupportedCryptoCondition(cond);
//cc_free(cond);
return cond;
}
bool CScript::IsCoinImport() const
{

View File

@@ -601,6 +601,8 @@ public:
bool IsPayToCryptoCondition() const;
bool IsCoinImport() const;
bool MayAcceptCryptoCondition() const;
struct CC *GetCryptoCondition() const;
/** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */
bool IsPushOnly() const;