@opcat-labs/cat-sdk 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/artifacts/.templates/cat20/cat20.scrypt.tpl +2 -2
  2. package/artifacts/.templates/cat20/cat20Admin.scrypt.tpl +4 -4
  3. package/artifacts/.templates/cat20/cat20Guard_12_12_2.scrypt.tpl +2 -2
  4. package/artifacts/.templates/cat20/cat20Guard_12_12_4.scrypt.tpl +2 -2
  5. package/artifacts/.templates/cat20/cat20Guard_6_6_2.scrypt.tpl +2 -2
  6. package/artifacts/.templates/cat20/cat20Guard_6_6_4.scrypt.tpl +2 -2
  7. package/artifacts/.templates/cat20/minters/cat20ClosedMinter.scrypt.tpl +2 -2
  8. package/artifacts/.templates/cat20/minters/cat20OpenMinter.scrypt.tpl +2 -2
  9. package/artifacts/.templates/cat721/cat721.scrypt.tpl +2 -2
  10. package/artifacts/.templates/cat721/cat721Guard_12_12_2.scrypt.tpl +2 -2
  11. package/artifacts/.templates/cat721/cat721Guard_12_12_4.scrypt.tpl +2 -2
  12. package/artifacts/.templates/cat721/cat721Guard_6_6_2.scrypt.tpl +2 -2
  13. package/artifacts/.templates/cat721/cat721Guard_6_6_4.scrypt.tpl +2 -2
  14. package/artifacts/.templates/cat721/minters/cat721ClosedMinter.scrypt.tpl +2 -2
  15. package/artifacts/.templates/cat721/minters/cat721OpenMinter.scrypt.tpl +2 -2
  16. package/artifacts/cat20/cat20.json +41 -37
  17. package/artifacts/cat20/cat20.scrypt +18 -18
  18. package/artifacts/cat20/cat20Admin.json +45 -37
  19. package/artifacts/cat20/cat20Admin.scrypt +30 -30
  20. package/artifacts/cat20/cat20GuardStateLib.json +22 -22
  21. package/artifacts/cat20/cat20GuardStateLib.scrypt +5 -5
  22. package/artifacts/cat20/cat20Guard_12_12_2.json +37 -33
  23. package/artifacts/cat20/cat20Guard_12_12_2.scrypt +21 -21
  24. package/artifacts/cat20/cat20Guard_12_12_4.json +37 -33
  25. package/artifacts/cat20/cat20Guard_12_12_4.scrypt +21 -21
  26. package/artifacts/cat20/cat20Guard_6_6_2.json +37 -33
  27. package/artifacts/cat20/cat20Guard_6_6_2.scrypt +21 -21
  28. package/artifacts/cat20/cat20Guard_6_6_4.json +37 -33
  29. package/artifacts/cat20/cat20Guard_6_6_4.scrypt +21 -21
  30. package/artifacts/cat20/cat20StateLib.json +23 -23
  31. package/artifacts/cat20/cat20StateLib.scrypt +5 -5
  32. package/artifacts/cat20/minters/cat20ClosedMinter.json +39 -35
  33. package/artifacts/cat20/minters/cat20ClosedMinter.scrypt +22 -22
  34. package/artifacts/cat20/minters/cat20OpenMinter.json +39 -35
  35. package/artifacts/cat20/minters/cat20OpenMinter.scrypt +18 -18
  36. package/artifacts/cat20/types.json +6 -6
  37. package/artifacts/cat20/types.scrypt +5 -5
  38. package/artifacts/cat721/cat721.json +41 -37
  39. package/artifacts/cat721/cat721.scrypt +18 -18
  40. package/artifacts/cat721/cat721GuardStateLib.json +22 -22
  41. package/artifacts/cat721/cat721GuardStateLib.scrypt +5 -5
  42. package/artifacts/cat721/cat721Guard_12_12_2.json +36 -32
  43. package/artifacts/cat721/cat721Guard_12_12_2.scrypt +18 -18
  44. package/artifacts/cat721/cat721Guard_12_12_4.json +36 -32
  45. package/artifacts/cat721/cat721Guard_12_12_4.scrypt +18 -18
  46. package/artifacts/cat721/cat721Guard_6_6_2.json +36 -32
  47. package/artifacts/cat721/cat721Guard_6_6_2.scrypt +18 -18
  48. package/artifacts/cat721/cat721Guard_6_6_4.json +36 -32
  49. package/artifacts/cat721/cat721Guard_6_6_4.scrypt +18 -18
  50. package/artifacts/cat721/cat721StateLib.json +23 -23
  51. package/artifacts/cat721/cat721StateLib.scrypt +5 -5
  52. package/artifacts/cat721/minters/cat721ClosedMinter.json +39 -35
  53. package/artifacts/cat721/minters/cat721ClosedMinter.scrypt +18 -18
  54. package/artifacts/cat721/minters/cat721OpenMintInfo.json +6 -6
  55. package/artifacts/cat721/minters/cat721OpenMintInfo.scrypt +4 -4
  56. package/artifacts/cat721/minters/cat721OpenMinter.json +44 -40
  57. package/artifacts/cat721/minters/cat721OpenMinter.scrypt +22 -22
  58. package/artifacts/cat721/minters/cat721OpenMinterMerkleTree.json +20 -20
  59. package/artifacts/cat721/minters/cat721OpenMinterMerkleTree.scrypt +6 -6
  60. package/artifacts/cat721/types.json +6 -6
  61. package/artifacts/cat721/types.scrypt +5 -5
  62. package/artifacts/constants.json +3 -3
  63. package/artifacts/constants.scrypt +1 -1
  64. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/backtrace.scrypt +14 -14
  65. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scrypt +16 -16
  66. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt +1 -1
  67. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stdUtils.scrypt +12 -12
  68. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txHashPreimageUtils.scrypt +7 -7
  69. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txUtils.scrypt +12 -12
  70. package/artifacts/scrypt-ts-opcat/assets/smart-contract/types/structs.scrypt +8 -8
  71. package/artifacts/types.json +3 -3
  72. package/artifacts/types.scrypt +2 -2
  73. package/artifacts/utils/ownerUtils.json +15 -15
  74. package/artifacts/utils/ownerUtils.scrypt +3 -3
  75. package/artifacts/utils/safeMath.json +15 -15
  76. package/artifacts/utils/safeMath.scrypt +1 -1
  77. package/dist/artifacts/.templates/cat20/cat20.scrypt.tpl +2 -2
  78. package/dist/artifacts/.templates/cat20/cat20Admin.scrypt.tpl +4 -4
  79. package/dist/artifacts/.templates/cat20/cat20Guard_12_12_2.scrypt.tpl +2 -2
  80. package/dist/artifacts/.templates/cat20/cat20Guard_12_12_4.scrypt.tpl +2 -2
  81. package/dist/artifacts/.templates/cat20/cat20Guard_6_6_2.scrypt.tpl +2 -2
  82. package/dist/artifacts/.templates/cat20/cat20Guard_6_6_4.scrypt.tpl +2 -2
  83. package/dist/artifacts/.templates/cat20/minters/cat20ClosedMinter.scrypt.tpl +2 -2
  84. package/dist/artifacts/.templates/cat20/minters/cat20OpenMinter.scrypt.tpl +2 -2
  85. package/dist/artifacts/.templates/cat721/cat721.scrypt.tpl +2 -2
  86. package/dist/artifacts/.templates/cat721/cat721Guard_12_12_2.scrypt.tpl +2 -2
  87. package/dist/artifacts/.templates/cat721/cat721Guard_12_12_4.scrypt.tpl +2 -2
  88. package/dist/artifacts/.templates/cat721/cat721Guard_6_6_2.scrypt.tpl +2 -2
  89. package/dist/artifacts/.templates/cat721/cat721Guard_6_6_4.scrypt.tpl +2 -2
  90. package/dist/artifacts/.templates/cat721/minters/cat721ClosedMinter.scrypt.tpl +2 -2
  91. package/dist/artifacts/.templates/cat721/minters/cat721OpenMinter.scrypt.tpl +2 -2
  92. package/dist/artifacts/cat20/cat20.json +41 -37
  93. package/dist/artifacts/cat20/cat20.scrypt +18 -18
  94. package/dist/artifacts/cat20/cat20Admin.json +45 -37
  95. package/dist/artifacts/cat20/cat20Admin.scrypt +30 -30
  96. package/dist/artifacts/cat20/cat20GuardStateLib.json +22 -22
  97. package/dist/artifacts/cat20/cat20GuardStateLib.scrypt +5 -5
  98. package/dist/artifacts/cat20/cat20Guard_12_12_2.json +37 -33
  99. package/dist/artifacts/cat20/cat20Guard_12_12_2.scrypt +21 -21
  100. package/dist/artifacts/cat20/cat20Guard_12_12_4.json +37 -33
  101. package/dist/artifacts/cat20/cat20Guard_12_12_4.scrypt +21 -21
  102. package/dist/artifacts/cat20/cat20Guard_6_6_2.json +37 -33
  103. package/dist/artifacts/cat20/cat20Guard_6_6_2.scrypt +21 -21
  104. package/dist/artifacts/cat20/cat20Guard_6_6_4.json +37 -33
  105. package/dist/artifacts/cat20/cat20Guard_6_6_4.scrypt +21 -21
  106. package/dist/artifacts/cat20/cat20StateLib.json +23 -23
  107. package/dist/artifacts/cat20/cat20StateLib.scrypt +5 -5
  108. package/dist/artifacts/cat20/minters/cat20ClosedMinter.json +39 -35
  109. package/dist/artifacts/cat20/minters/cat20ClosedMinter.scrypt +22 -22
  110. package/dist/artifacts/cat20/minters/cat20OpenMinter.json +39 -35
  111. package/dist/artifacts/cat20/minters/cat20OpenMinter.scrypt +18 -18
  112. package/dist/artifacts/cat20/types.json +6 -6
  113. package/dist/artifacts/cat20/types.scrypt +5 -5
  114. package/dist/artifacts/cat721/cat721.json +41 -37
  115. package/dist/artifacts/cat721/cat721.scrypt +18 -18
  116. package/dist/artifacts/cat721/cat721GuardStateLib.json +22 -22
  117. package/dist/artifacts/cat721/cat721GuardStateLib.scrypt +5 -5
  118. package/dist/artifacts/cat721/cat721Guard_12_12_2.json +36 -32
  119. package/dist/artifacts/cat721/cat721Guard_12_12_2.scrypt +18 -18
  120. package/dist/artifacts/cat721/cat721Guard_12_12_4.json +36 -32
  121. package/dist/artifacts/cat721/cat721Guard_12_12_4.scrypt +18 -18
  122. package/dist/artifacts/cat721/cat721Guard_6_6_2.json +36 -32
  123. package/dist/artifacts/cat721/cat721Guard_6_6_2.scrypt +18 -18
  124. package/dist/artifacts/cat721/cat721Guard_6_6_4.json +36 -32
  125. package/dist/artifacts/cat721/cat721Guard_6_6_4.scrypt +18 -18
  126. package/dist/artifacts/cat721/cat721StateLib.json +23 -23
  127. package/dist/artifacts/cat721/cat721StateLib.scrypt +5 -5
  128. package/dist/artifacts/cat721/minters/cat721ClosedMinter.json +39 -35
  129. package/dist/artifacts/cat721/minters/cat721ClosedMinter.scrypt +18 -18
  130. package/dist/artifacts/cat721/minters/cat721OpenMintInfo.json +6 -6
  131. package/dist/artifacts/cat721/minters/cat721OpenMintInfo.scrypt +4 -4
  132. package/dist/artifacts/cat721/minters/cat721OpenMinter.json +44 -40
  133. package/dist/artifacts/cat721/minters/cat721OpenMinter.scrypt +22 -22
  134. package/dist/artifacts/cat721/minters/cat721OpenMinterMerkleTree.json +20 -20
  135. package/dist/artifacts/cat721/minters/cat721OpenMinterMerkleTree.scrypt +6 -6
  136. package/dist/artifacts/cat721/types.json +6 -6
  137. package/dist/artifacts/cat721/types.scrypt +5 -5
  138. package/dist/artifacts/constants.json +3 -3
  139. package/dist/artifacts/constants.scrypt +1 -1
  140. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/backtrace.scrypt +14 -14
  141. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scrypt +16 -16
  142. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt +1 -1
  143. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stdUtils.scrypt +12 -12
  144. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txHashPreimageUtils.scrypt +7 -7
  145. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txUtils.scrypt +12 -12
  146. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/types/structs.scrypt +8 -8
  147. package/dist/artifacts/types.json +3 -3
  148. package/dist/artifacts/types.scrypt +2 -2
  149. package/dist/artifacts/utils/ownerUtils.json +15 -15
  150. package/dist/artifacts/utils/ownerUtils.scrypt +3 -3
  151. package/dist/artifacts/utils/safeMath.json +15 -15
  152. package/dist/artifacts/utils/safeMath.scrypt +1 -1
  153. package/package.json +4 -4
  154. package/scrypt.index.json +15 -15
@@ -11,7 +11,7 @@ import "../../scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scry
11
11
 
12
12
 
13
13
 
14
- contract _opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinter {
14
+ contract _opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinter {
15
15
  bytes genesisOutpoint;
16
16
  int maxCount;
17
17
  int premine;
@@ -26,38 +26,38 @@ contract _opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinter {
26
26
  this.limit = limit;
27
27
  this.preminerAddr = premineAddr;
28
28
  }
29
- public function mint(_opcat_labs_cat_sdk_2_1_2__rs__CAT20State tokenMint, int[2] nextRemainingCounts, PubKey preminerPubKey, Sig preminerSig, int minterSatoshis, int tokenSatoshis, _opcat_labs_scrypt_ts_opcat_2_1_2__rs__BacktraceInfo backtraceInfo, _opcat_labs_scrypt_ts_opcat_2_1_2__rs__SHPreimage __scrypt_ts_shPreimage, _opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxOut __scrypt_ts_changeInfo, _opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinterState __scrypt_ts_curState, bytes __scrypt_ts_prevouts, bytes __scrypt_ts_spentAmounts, bytes __scrypt_ts_spentDataHashes, bytes __scrypt_ts_spentScriptHashes, _opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxHashPreimage __scrypt_ts_prevTxHashPreimage) {
30
- require(Tx.checkPreimageSigHashType(_opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage), SigHash.ALL));
29
+ public function mint(_opcat_labs_cat_sdk_2_1_3__rs__CAT20State tokenMint, int[2] nextRemainingCounts, PubKey preminerPubKey, Sig preminerSig, int minterSatoshis, int tokenSatoshis, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__BacktraceInfo backtraceInfo, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__SHPreimage __scrypt_ts_shPreimage, Sig __scrypt_ts_preimageSig, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxOut __scrypt_ts_changeInfo, _opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinterState __scrypt_ts_curState, bytes __scrypt_ts_prevouts, bytes __scrypt_ts_spentAmounts, bytes __scrypt_ts_spentDataHashes, bytes __scrypt_ts_spentScriptHashes, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxHashPreimage __scrypt_ts_prevTxHashPreimage) {
30
+ require(checkDataSig(Sig(__scrypt_ts_preimageSig[0 : len(__scrypt_ts_preimageSig) - 1]), sha256(_opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage)), _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.pubKey) && checkSig(__scrypt_ts_preimageSig, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.pubKey));
31
31
 
32
- int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
32
+ int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
33
33
 
34
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__Outpoint __scrypt_ts_prevout = _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkPrevouts(__scrypt_ts_prevouts, __scrypt_ts_shPreimage.hashPrevouts, __scrypt_ts_shPreimage.inputIndex, __scrypt_ts_inputCount);
34
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__Outpoint __scrypt_ts_prevout = _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkPrevouts(__scrypt_ts_prevouts, __scrypt_ts_shPreimage.hashPrevouts, __scrypt_ts_shPreimage.inputIndex, __scrypt_ts_inputCount);
35
35
 
36
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
36
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
37
37
 
38
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
38
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
39
39
 
40
- _opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinterState __scrypt_ts_nextState = __scrypt_ts_curState;
40
+ _opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinterState __scrypt_ts_nextState = __scrypt_ts_curState;
41
41
 
42
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinter.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
42
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinter.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
43
43
 
44
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__Backtrace.checkPrevTxHashPreimage(__scrypt_ts_prevTxHashPreimage, __scrypt_ts_prevouts, __scrypt_ts_shPreimage.inputIndex);
44
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__Backtrace.checkPrevTxHashPreimage(__scrypt_ts_prevTxHashPreimage, __scrypt_ts_prevouts, __scrypt_ts_shPreimage.inputIndex);
45
45
 
46
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__Backtrace.verifyFromOutpoint(backtraceInfo, this.genesisOutpoint, __scrypt_ts_spentScriptHashes[__scrypt_ts_shPreimage.inputIndex * 32 : (__scrypt_ts_shPreimage.inputIndex + 1) * 32], __scrypt_ts_prevTxHashPreimage.inputList);
46
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__Backtrace.verifyFromOutpoint(backtraceInfo, this.genesisOutpoint, __scrypt_ts_spentScriptHashes[__scrypt_ts_shPreimage.inputIndex * 32 : (__scrypt_ts_shPreimage.inputIndex + 1) * 32], __scrypt_ts_prevTxHashPreimage.inputList);
47
47
  bytes minterOutputs = b'';
48
48
  int sumNextRemainingCount = 0;
49
49
  loop (2) : i {
50
50
  int remainingCount = nextRemainingCounts[i];
51
51
  if(remainingCount > 0) {
52
52
  sumNextRemainingCount += remainingCount;
53
- minterOutputs += _opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxUtils.buildDataOutput(__scrypt_ts_shPreimage.spentScriptHash, minterSatoshis, sha256(_opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinter.serializeState({__scrypt_ts_nextState.tokenScriptHash, true, remainingCount})));
53
+ minterOutputs += _opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxUtils.buildDataOutput(__scrypt_ts_shPreimage.spentScriptHash, minterSatoshis, sha256(_opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinter.serializeState({__scrypt_ts_nextState.tokenScriptHash, true, remainingCount})));
54
54
  }
55
55
  }
56
- Sha256 tokenStateHash = sha256(_opcat_labs_cat_sdk_2_1_2__rs__CAT20StateLib.serializeState(tokenMint));
57
- bytes tokenOutput = _opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxUtils.buildDataOutput(__scrypt_ts_nextState.tokenScriptHash, tokenSatoshis, tokenStateHash);
56
+ Sha256 tokenStateHash = sha256(_opcat_labs_cat_sdk_2_1_3__rs__CAT20StateLib.serializeState(tokenMint));
57
+ bytes tokenOutput = _opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxUtils.buildDataOutput(__scrypt_ts_nextState.tokenScriptHash, tokenSatoshis, tokenStateHash);
58
58
  if(!__scrypt_ts_nextState.hasMintedBefore && this.premine > 0) {
59
59
  require(this.maxCount == __scrypt_ts_nextState.remainingCount + this.premineCount);
60
- _opcat_labs_cat_sdk_2_1_2__rs__OwnerUtils.checkUserOwner(preminerPubKey, this.preminerAddr);
60
+ _opcat_labs_cat_sdk_2_1_3__rs__OwnerUtils.checkUserOwner(preminerPubKey, this.preminerAddr);
61
61
  require(checkSig(preminerSig, preminerPubKey));
62
62
  require(sumNextRemainingCount == __scrypt_ts_nextState.remainingCount);
63
63
  require(tokenMint.amount == this.premine);
@@ -71,13 +71,13 @@ contract _opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinter {
71
71
  require(tokenMint.amount == this.limit);
72
72
  }
73
73
  bytes changeOutput =
74
- (__scrypt_ts_changeInfo.satoshis > 0 ? _opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxUtils.buildOutput(__scrypt_ts_changeInfo.scriptHash, __scrypt_ts_changeInfo.satoshis) : b'');
74
+ (__scrypt_ts_changeInfo.satoshis > 0 ? _opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxUtils.buildOutput(__scrypt_ts_changeInfo.scriptHash, __scrypt_ts_changeInfo.satoshis) : b'');
75
75
  require(hash256(minterOutputs + tokenOutput + changeOutput) == __scrypt_ts_shPreimage.hashOutputs);
76
76
  }
77
- static function serializeState(_opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinterState __scrypt_ts_curState): bytes {
77
+ static function serializeState(_opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinterState __scrypt_ts_curState): bytes {
78
78
  return num2bin(len(__scrypt_ts_curState.tokenScriptHash), 2) + __scrypt_ts_curState.tokenScriptHash + num2bin(len((__scrypt_ts_curState.hasMintedBefore ? b'01' : b'')), 2) + (__scrypt_ts_curState.hasMintedBefore ? b'01' : b'') + num2bin(len(pack(__scrypt_ts_curState.remainingCount)), 2) + pack(__scrypt_ts_curState.remainingCount) + hash160(hash160(__scrypt_ts_curState.tokenScriptHash) + hash160(__scrypt_ts_curState.hasMintedBefore ? b'01' : b'') + hash160(pack(__scrypt_ts_curState.remainingCount)));
79
79
  }
80
- static function stateHash(_opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinterState __scrypt_ts_curState): bytes {
80
+ static function stateHash(_opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinterState __scrypt_ts_curState): bytes {
81
81
  return sha256(num2bin(len(__scrypt_ts_curState.tokenScriptHash), 2) + __scrypt_ts_curState.tokenScriptHash + num2bin(len((__scrypt_ts_curState.hasMintedBefore ? b'01' : b'')), 2) + (__scrypt_ts_curState.hasMintedBefore ? b'01' : b'') + num2bin(len(pack(__scrypt_ts_curState.remainingCount)), 2) + pack(__scrypt_ts_curState.remainingCount) + hash160(hash160(__scrypt_ts_curState.tokenScriptHash) + hash160(__scrypt_ts_curState.hasMintedBefore ? b'01' : b'') + hash160(pack(__scrypt_ts_curState.remainingCount))));
82
82
  }
83
83
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 10,
3
- "compilerVersion": "1.21.0+commit.2ada378",
3
+ "compilerVersion": "1.22.0+commit.47800da",
4
4
  "contract": "",
5
5
  "md5": "d41d8cd98f00b204e9800998ecf8427e",
6
6
  "structs": [
7
7
  {
8
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT20GuardConstState",
8
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT20GuardConstState",
9
9
  "params": [
10
10
  {
11
11
  "name": "tokenScriptHashes",
@@ -27,7 +27,7 @@
27
27
  "genericTypes": []
28
28
  },
29
29
  {
30
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT20State",
30
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT20State",
31
31
  "params": [
32
32
  {
33
33
  "name": "ownerAddr",
@@ -41,7 +41,7 @@
41
41
  "genericTypes": []
42
42
  },
43
43
  {
44
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT20ClosedMinterState",
44
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT20ClosedMinterState",
45
45
  "params": [
46
46
  {
47
47
  "name": "tokenScriptHash",
@@ -51,7 +51,7 @@
51
51
  "genericTypes": []
52
52
  },
53
53
  {
54
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinterState",
54
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinterState",
55
55
  "params": [
56
56
  {
57
57
  "name": "tokenScriptHash",
@@ -69,7 +69,7 @@
69
69
  "genericTypes": []
70
70
  },
71
71
  {
72
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT20AdminState",
72
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT20AdminState",
73
73
  "params": [
74
74
  {
75
75
  "name": "tag",
@@ -1,29 +1,29 @@
1
1
 
2
2
 
3
3
 
4
- struct _opcat_labs_cat_sdk_2_1_2__rs__CAT20GuardConstState {
4
+ struct _opcat_labs_cat_sdk_2_1_3__rs__CAT20GuardConstState {
5
5
  bytes[4] tokenScriptHashes;
6
6
  int[4] tokenAmounts;
7
7
  int[4] tokenBurnAmounts;
8
8
  bytes tokenScriptIndexes;
9
9
  }
10
10
 
11
- struct _opcat_labs_cat_sdk_2_1_2__rs__CAT20State {
11
+ struct _opcat_labs_cat_sdk_2_1_3__rs__CAT20State {
12
12
  bytes ownerAddr;
13
13
  int amount;
14
14
  }
15
15
 
16
- struct _opcat_labs_cat_sdk_2_1_2__rs__CAT20ClosedMinterState {
16
+ struct _opcat_labs_cat_sdk_2_1_3__rs__CAT20ClosedMinterState {
17
17
  bytes tokenScriptHash;
18
18
  }
19
19
 
20
- struct _opcat_labs_cat_sdk_2_1_2__rs__CAT20OpenMinterState {
20
+ struct _opcat_labs_cat_sdk_2_1_3__rs__CAT20OpenMinterState {
21
21
  bytes tokenScriptHash;
22
22
  bool hasMintedBefore;
23
23
  int remainingCount;
24
24
  }
25
25
 
26
- struct _opcat_labs_cat_sdk_2_1_2__rs__CAT20AdminState {
26
+ struct _opcat_labs_cat_sdk_2_1_3__rs__CAT20AdminState {
27
27
  bytes tag;
28
28
  bytes adminAddress;
29
29
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 10,
3
- "compilerVersion": "1.21.0+commit.2ada378",
4
- "contract": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721",
5
- "md5": "542e091205a83487f50a17c51f6809a1",
3
+ "compilerVersion": "1.22.0+commit.47800da",
4
+ "contract": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721",
5
+ "md5": "3385be866b049d6ed7f12e95b3a4bf92",
6
6
  "structs": [
7
7
  {
8
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721GuardConstState",
8
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721GuardConstState",
9
9
  "params": [
10
10
  {
11
11
  "name": "nftScriptHashes",
@@ -23,7 +23,7 @@
23
23
  "genericTypes": []
24
24
  },
25
25
  {
26
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721State",
26
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721State",
27
27
  "params": [
28
28
  {
29
29
  "name": "ownerAddr",
@@ -37,7 +37,7 @@
37
37
  "genericTypes": []
38
38
  },
39
39
  {
40
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721ClosedMinterState",
40
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721ClosedMinterState",
41
41
  "params": [
42
42
  {
43
43
  "name": "nftScriptHash",
@@ -55,7 +55,7 @@
55
55
  "genericTypes": []
56
56
  },
57
57
  {
58
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721MerkleLeaf",
58
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721MerkleLeaf",
59
59
  "params": [
60
60
  {
61
61
  "name": "contentDataHash",
@@ -73,7 +73,7 @@
73
73
  "genericTypes": []
74
74
  },
75
75
  {
76
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721OpenMinterState",
76
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721OpenMinterState",
77
77
  "params": [
78
78
  {
79
79
  "name": "nftScriptHash",
@@ -91,7 +91,7 @@
91
91
  "genericTypes": []
92
92
  },
93
93
  {
94
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxOut",
94
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxOut",
95
95
  "params": [
96
96
  {
97
97
  "name": "scriptHash",
@@ -109,7 +109,7 @@
109
109
  "genericTypes": []
110
110
  },
111
111
  {
112
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxIn",
112
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxIn",
113
113
  "params": [
114
114
  {
115
115
  "name": "prevTxHash",
@@ -131,7 +131,7 @@
131
131
  "genericTypes": []
132
132
  },
133
133
  {
134
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxHashPreimage",
134
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxHashPreimage",
135
135
  "params": [
136
136
  {
137
137
  "name": "version",
@@ -153,11 +153,11 @@
153
153
  "genericTypes": []
154
154
  },
155
155
  {
156
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__BacktraceInfo",
156
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__BacktraceInfo",
157
157
  "params": [
158
158
  {
159
159
  "name": "prevTxInput",
160
- "type": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxIn"
160
+ "type": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxIn"
161
161
  },
162
162
  {
163
163
  "name": "prevTxInputIndex",
@@ -165,13 +165,13 @@
165
165
  },
166
166
  {
167
167
  "name": "prevPrevTxPreimage",
168
- "type": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxHashPreimage"
168
+ "type": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxHashPreimage"
169
169
  }
170
170
  ],
171
171
  "genericTypes": []
172
172
  },
173
173
  {
174
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__SHPreimage",
174
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__SHPreimage",
175
175
  "params": [
176
176
  {
177
177
  "name": "nVersion",
@@ -233,7 +233,7 @@
233
233
  "genericTypes": []
234
234
  },
235
235
  {
236
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__Outpoint",
236
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__Outpoint",
237
237
  "params": [
238
238
  {
239
239
  "name": "txHash",
@@ -247,7 +247,7 @@
247
247
  "genericTypes": []
248
248
  },
249
249
  {
250
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__ChainTxVerifyResponse",
250
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__ChainTxVerifyResponse",
251
251
  "params": [
252
252
  {
253
253
  "name": "prevPrevScript",
@@ -261,7 +261,7 @@
261
261
  "genericTypes": []
262
262
  },
263
263
  {
264
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT20ContractUnlockArgs",
264
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT20ContractUnlockArgs",
265
265
  "params": [
266
266
  {
267
267
  "name": "spendType",
@@ -283,7 +283,7 @@
283
283
  "genericTypes": []
284
284
  },
285
285
  {
286
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721ContractUnlockArgs",
286
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721ContractUnlockArgs",
287
287
  "params": [
288
288
  {
289
289
  "name": "userPubKey",
@@ -301,7 +301,7 @@
301
301
  "genericTypes": []
302
302
  },
303
303
  {
304
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__ReadVarintResult",
304
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__ReadVarintResult",
305
305
  "params": [
306
306
  {
307
307
  "name": "data",
@@ -317,50 +317,50 @@
317
317
  ],
318
318
  "library": [
319
319
  {
320
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__OwnerUtils",
320
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__OwnerUtils",
321
321
  "params": [],
322
322
  "properties": [],
323
323
  "genericTypes": []
324
324
  },
325
325
  {
326
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxUtils",
326
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxUtils",
327
327
  "params": [],
328
328
  "properties": [],
329
329
  "genericTypes": []
330
330
  },
331
331
  {
332
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__StateUtils",
332
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__StateUtils",
333
333
  "params": [],
334
334
  "properties": [],
335
335
  "genericTypes": []
336
336
  },
337
337
  {
338
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxHashPreimageUtils",
338
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxHashPreimageUtils",
339
339
  "params": [],
340
340
  "properties": [],
341
341
  "genericTypes": []
342
342
  },
343
343
  {
344
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__Backtrace",
344
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__Backtrace",
345
345
  "params": [],
346
346
  "properties": [],
347
347
  "genericTypes": []
348
348
  },
349
349
  {
350
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils",
350
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils",
351
351
  "params": [],
352
352
  "properties": [],
353
353
  "genericTypes": []
354
354
  },
355
355
  {
356
- "name": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721GuardStateLib",
356
+ "name": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721GuardStateLib",
357
357
  "params": [],
358
358
  "properties": [],
359
359
  "genericTypes": [],
360
- "stateType": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721GuardConstState"
360
+ "stateType": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721GuardConstState"
361
361
  },
362
362
  {
363
- "name": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__StdUtils",
363
+ "name": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__StdUtils",
364
364
  "params": [],
365
365
  "properties": [],
366
366
  "genericTypes": []
@@ -375,11 +375,11 @@
375
375
  "params": [
376
376
  {
377
377
  "name": "unlockArgs",
378
- "type": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721ContractUnlockArgs"
378
+ "type": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721ContractUnlockArgs"
379
379
  },
380
380
  {
381
381
  "name": "guardState",
382
- "type": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721GuardConstState"
382
+ "type": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721GuardConstState"
383
383
  },
384
384
  {
385
385
  "name": "guardInputIndex",
@@ -387,15 +387,19 @@
387
387
  },
388
388
  {
389
389
  "name": "backtraceInfo",
390
- "type": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__BacktraceInfo"
390
+ "type": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__BacktraceInfo"
391
391
  },
392
392
  {
393
393
  "name": "__scrypt_ts_shPreimage",
394
- "type": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__SHPreimage"
394
+ "type": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__SHPreimage"
395
+ },
396
+ {
397
+ "name": "__scrypt_ts_preimageSig",
398
+ "type": "Sig"
395
399
  },
396
400
  {
397
401
  "name": "__scrypt_ts_curState",
398
- "type": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721State"
402
+ "type": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721State"
399
403
  },
400
404
  {
401
405
  "name": "__scrypt_ts_prevouts",
@@ -415,7 +419,7 @@
415
419
  },
416
420
  {
417
421
  "name": "__scrypt_ts_prevTxHashPreimage",
418
- "type": "_opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxHashPreimage"
422
+ "type": "_opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxHashPreimage"
419
423
  }
420
424
  ]
421
425
  },
@@ -434,8 +438,8 @@
434
438
  }
435
439
  ],
436
440
  "stateProps": [],
437
- "stateType": "_opcat_labs_cat_sdk_2_1_2__rs__CAT721State",
441
+ "stateType": "_opcat_labs_cat_sdk_2_1_3__rs__CAT721State",
438
442
  "buildType": "release",
439
443
  "file": "../cat721.scrypt",
440
- "hex": "512097dfd76851bf465e8f715593b217714858bbe9570ff3bd5e33840a34e20ff0262102ba79df5f8ae7604a9830f03c7933028186aede0675a16f025dc4f8be8eec0382201008ce7480da41702918d1ec8e6849ba32b4d65b1e40dc669c31a1e6306b266c0000000000<minterScriptHash><guardVariantScriptHashes[0]><guardVariantScriptHashes[1]><guardVariantScriptHashes[2]><guardVariantScriptHashes[3]>54795a7a75597a597a597a597a597a597a597a597a597a70705c7a5c7a5c7a5c7a6d6d587a587a587a587a587a6d6d750120790120790120790120790120790120790120790120790120790120790120790120790120790120795d798277549d5c79827701209d5b79827701209d5a79827701209d597900a26958798277549d5779827701209d5679827701209d5579827701209d5479827701209d5379827701209d527900a2697800a26976519c6476529c6751686476539c67516864760281009c67516864760282009c67516864760283009c675168695d795d797e5c797e5b797e5a79767600a2637609ffffffffffffffff00a16700686976586e8b806e7c7f75007f6b6d6d6d6c7e59797e58797e57797e56797e55797e54797e5379546e8b806e7c7f75007f6b6d6d6c7e5279546e8b806e7c7f75007f6b6d6d6c7e7854807e6b6d6d6d6d6d6d6d6c5979785a795a79210ac407f0e4bd44bfc207355a778b046225a7068fc59ee7eda43ad905aadbffc800206c266b30e6a1319c66dc401e5bd6b432ba49688eecd118297041da8074ce08105c7956795679aa7676517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01007e817757795679567956795679537956795479577995939521414136d08c5ed2bf3ba048afe6dcaebafeffffffffffffffffffffffffffffff006e6e9776009f636e936776687777777b757c6e5296a0636e7c947b757c6853798277527982775379012080517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01205279947f77545379935279930130787e527e54797e58797e527e53797e52797e57797e6b6d6d6d6d6d6d6c765779ac6b6d6d6d6d6d6c77695f79011b7978aa7888785878827d77527997009d6e7c966b6d6d6c7701117901217901187970aa5379886e9f69765479012478827d77527997009d6e7c967777779d537952798b0124957f7552790124957f7d7701207f75007f777801247f7501207f77768277549d767601007e817777726d726d7b756079011d7954795279aa527988765379012078827d77527997009d6e7c967777779d6d75011179011c7954795279aa527988765379012078827d77527997009d6e7c967777779d6d75011579011579011a79011879011879788277528052797e78827752807e787e5279a95279a97ea97ea877770115797653798b0120957f7553790120957f775279886d75011179011179011179011179011979011f79557955795579557953798277549d5279014878827d77527997009d6e7c967777775279014878827d77527997009d6e7c96777777557952790000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e55797e780000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e54797e53797eaa6b6d6d6d6c76700124950120937f7553790124957f77886d6d6d75012e79012e79012e79012e79012e79012e79012e79012e79012e79011279011c790125798b0120957f750125790120957f77011b795b795b795b795b795b795b795b795b795b7959797656798b0148957f7556790148957f775a795a795a795a795379827701209d76827701209d707600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e787e52797600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e6b6d6d6c88597976567956795679567953798277549d5279014878827d77527997009d6e7c967777775279014878827d77527997009d6e7c96777777557952790000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e55797e780000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e54797e53797eaa6b6d6d6d6c8853795a7901489558930120937f755a7901489558937f77785b797600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e787c726d726d726d726d726d726d785579876478547987675168696d6d6d6d6d6d6d013579013579013579013579013579013579012979012179013779011b79011d797853796e8b0120957f75780120957f7777777601157901157901157901157953766b796c756b6d6d6c87647601157901157901157901157952766b796c756b6d6d6c87675168647601157901157901157901157951766b796c756b6d6d6c87675168647601157901157901157901157900766b796c756b6d6d6c87675168697854796e8b0120957f75780120957f7777775c795c795c795c795c795c79557955795579557953766b796c756b6d6d6c82775280567956795679567953766b796c756b6d6d6c7e567956795679567952766b796c756b6d6d6c827752807e567956795679567952766b796c756b6d6d6c7e567956795679567951766b796c756b6d6d6c827752807e567956795679567951766b796c756b6d6d6c7e567956795679567900766b796c756b6d6d6c827752807e567956795679567900766b796c756b6d6d6c7e5279827752807e52797e78827752807e787e567956795679567953766b796c756b6d6d6ca9577957795779577952766b796c756b6d6d6ca97e577957795779577951766b796c756b6d6d6ca97e577957795779577900766b796c756b6d6d6ca97e5379a97e5279a97ea97ea86b6d6d6d6c88567955798b7f7555797f77815c795c795c795c795455797600a26976549f69948c766b796c756b6d6d6c5779886d6d6d6d6d6d7578827701209c6301367900a26301367955799f67006869780113790138796e8b0120957f75780120957f77777788670138795279787676827701219d750376a91478a97e0288ac7e7778886d013779013979ad686d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d7551"
444
+ "hex": "2102ba79df5f8ae7604a9830f03c7933028186aede0675a16f025dc4f8be8eec03820000000000<minterScriptHash><guardVariantScriptHashes[0]><guardVariantScriptHashes[1]><guardVariantScriptHashes[2]><guardVariantScriptHashes[3]>54795a7a75597a597a597a597a597a597a597a597a597a70705c7a5c7a5c7a5c7a6d6d587a587a587a587a587a6d6d75607901117982778c7f75007f77011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f795d798277549d5c79827701209d5b79827701209d5a79827701209d597900a26958798277549d5779827701209d5679827701209d5579827701209d5479827701209d5379827701209d527900a2697800a26976519c6476529c6751686476539c67516864760281009c67516864760282009c67516864760283009c675168695d795d797e5c797e5b797e5a79767600a2637609ffffffffffffffff00a16700686976586e8b806e7c7f75007f6b6d6d6d6c7e59797e58797e57797e56797e55797e54797e5379546e8b806e7c7f75007f6b6d6d6c7e5279546e8b806e7c7f75007f6b6d6d6c7e7854807e6b6d6d6d6d6d6d6d6ca85779ba6360795679ac670068695c7901197978aa7888785878827d77527997009d6e7c966b6d6d6c775e79011f7901167970aa5379886e9f69765479012478827d77527997009d6e7c967777779d537952798b0124957f7552790124957f7d7701207f75007f777801247f7501207f77768277549d767601007e817777726d726d7b755d79011b7954795279aa527988765379012078827d77527997009d6e7c967777779d6d755e79011a7954795279aa527988765379012078827d77527997009d6e7c967777779d6d75011279011279011879011579011579788277528052797e78827752807e787e5279a95279a97ea97ea877770112797653798b0120957f7553790120957f775279886d755e795e795e795e79011679011d79557955795579557953798277549d5279014878827d77527997009d6e7c967777775279014878827d77527997009d6e7c96777777557952790000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e55797e780000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e54797e53797eaa6b6d6d6d6c76700124950120937f7553790124957f77886d6d6d75012c79012c79012c79012c79012c79012c79012c79012c79012c790112790119790123798b0120957f750123790120957f770118795b795b795b795b795b795b795b795b795b7959797656798b0148957f7556790148957f775a795a795a795a795379827701209d76827701209d707600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e787e52797600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e6b6d6d6c88597976567956795679567953798277549d5279014878827d77527997009d6e7c967777775279014878827d77527997009d6e7c96777777557952790000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e55797e780000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e54797e53797eaa6b6d6d6d6c8853795a7901489558930120937f755a7901489558937f77785b797600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e787c726d726d726d726d726d726d785579876478547987675168696d6d6d6d6d6d6d013379013379013379013379013379013379012779011f79013579011879011a797853796e8b0120957f75780120957f7777777601157901157901157901157953766b796c756b6d6d6c87647601157901157901157901157952766b796c756b6d6d6c87675168647601157901157901157901157951766b796c756b6d6d6c87675168647601157901157901157901157900766b796c756b6d6d6c87675168697854796e8b0120957f75780120957f7777775c795c795c795c795c795c79557955795579557953766b796c756b6d6d6c82775280567956795679567953766b796c756b6d6d6c7e567956795679567952766b796c756b6d6d6c827752807e567956795679567952766b796c756b6d6d6c7e567956795679567951766b796c756b6d6d6c827752807e567956795679567951766b796c756b6d6d6c7e567956795679567900766b796c756b6d6d6c827752807e567956795679567900766b796c756b6d6d6c7e5279827752807e52797e78827752807e787e567956795679567953766b796c756b6d6d6ca9577957795779577952766b796c756b6d6d6ca97e577957795779577951766b796c756b6d6d6ca97e577957795779577900766b796c756b6d6d6ca97e5379a97e5279a97ea97ea86b6d6d6d6c88567955798b7f7555797f77815c795c795c795c795455797600a26976549f69948c766b796c756b6d6d6c5779886d6d6d6d6d6d7578827701209c6301347900a26301347955799f670068697860790136796e8b0120957f75780120957f77777788670136795279787676827701219d750376a91478a97e0288ac7e7778886d013579013779ad686d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d7551"
441
445
  }
@@ -12,53 +12,53 @@ import "../scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt"
12
12
 
13
13
 
14
14
 
15
- contract _opcat_labs_cat_sdk_2_1_2__rs__CAT721 {
15
+ contract _opcat_labs_cat_sdk_2_1_3__rs__CAT721 {
16
16
  bytes minterScriptHash;
17
17
  Sha256[4] guardVariantScriptHashes;
18
18
  constructor(bytes minterScriptHash, Sha256[4] guardVariantScriptHashes) {
19
19
  this.minterScriptHash = minterScriptHash;
20
20
  this.guardVariantScriptHashes = guardVariantScriptHashes;
21
21
  }
22
- public function unlock(_opcat_labs_cat_sdk_2_1_2__rs__CAT721ContractUnlockArgs unlockArgs, _opcat_labs_cat_sdk_2_1_2__rs__CAT721GuardConstState guardState, int guardInputIndex, _opcat_labs_scrypt_ts_opcat_2_1_2__rs__BacktraceInfo backtraceInfo, _opcat_labs_scrypt_ts_opcat_2_1_2__rs__SHPreimage __scrypt_ts_shPreimage, _opcat_labs_cat_sdk_2_1_2__rs__CAT721State __scrypt_ts_curState, bytes __scrypt_ts_prevouts, bytes __scrypt_ts_spentAmounts, bytes __scrypt_ts_spentDataHashes, bytes __scrypt_ts_spentScriptHashes, _opcat_labs_scrypt_ts_opcat_2_1_2__rs__TxHashPreimage __scrypt_ts_prevTxHashPreimage) {
23
- require(Tx.checkPreimageSigHashType(_opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage), SigHash.ALL));
22
+ public function unlock(_opcat_labs_cat_sdk_2_1_3__rs__CAT721ContractUnlockArgs unlockArgs, _opcat_labs_cat_sdk_2_1_3__rs__CAT721GuardConstState guardState, int guardInputIndex, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__BacktraceInfo backtraceInfo, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__SHPreimage __scrypt_ts_shPreimage, Sig __scrypt_ts_preimageSig, _opcat_labs_cat_sdk_2_1_3__rs__CAT721State __scrypt_ts_curState, bytes __scrypt_ts_prevouts, bytes __scrypt_ts_spentAmounts, bytes __scrypt_ts_spentDataHashes, bytes __scrypt_ts_spentScriptHashes, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__TxHashPreimage __scrypt_ts_prevTxHashPreimage) {
23
+ require(checkDataSig(Sig(__scrypt_ts_preimageSig[0 : len(__scrypt_ts_preimageSig) - 1]), sha256(_opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage)), _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.pubKey) && checkSig(__scrypt_ts_preimageSig, _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.pubKey));
24
24
 
25
- int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
25
+ int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
26
26
 
27
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__Outpoint __scrypt_ts_prevout = _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkPrevouts(__scrypt_ts_prevouts, __scrypt_ts_shPreimage.hashPrevouts, __scrypt_ts_shPreimage.inputIndex, __scrypt_ts_inputCount);
27
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__Outpoint __scrypt_ts_prevout = _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkPrevouts(__scrypt_ts_prevouts, __scrypt_ts_shPreimage.hashPrevouts, __scrypt_ts_shPreimage.inputIndex, __scrypt_ts_inputCount);
28
28
 
29
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
29
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
30
30
 
31
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
31
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
32
32
 
33
- _opcat_labs_cat_sdk_2_1_2__rs__CAT721State __scrypt_ts_nextState = __scrypt_ts_curState;
33
+ _opcat_labs_cat_sdk_2_1_3__rs__CAT721State __scrypt_ts_nextState = __scrypt_ts_curState;
34
34
 
35
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_1_2__rs__CAT721.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
35
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_1_3__rs__CAT721.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
36
36
 
37
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__Backtrace.checkPrevTxHashPreimage(__scrypt_ts_prevTxHashPreimage, __scrypt_ts_prevouts, __scrypt_ts_shPreimage.inputIndex);
37
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__Backtrace.checkPrevTxHashPreimage(__scrypt_ts_prevTxHashPreimage, __scrypt_ts_prevouts, __scrypt_ts_shPreimage.inputIndex);
38
38
 
39
- _opcat_labs_scrypt_ts_opcat_2_1_2__rs__Backtrace.verifyFromScript(backtraceInfo, this.minterScriptHash, __scrypt_ts_spentScriptHashes[__scrypt_ts_shPreimage.inputIndex * 32 : (__scrypt_ts_shPreimage.inputIndex + 1) * 32], __scrypt_ts_prevTxHashPreimage.inputList);
39
+ _opcat_labs_scrypt_ts_opcat_2_1_3__rs__Backtrace.verifyFromScript(backtraceInfo, this.minterScriptHash, __scrypt_ts_spentScriptHashes[__scrypt_ts_shPreimage.inputIndex * 32 : (__scrypt_ts_shPreimage.inputIndex + 1) * 32], __scrypt_ts_prevTxHashPreimage.inputList);
40
40
  this.checkGuard(guardState, __scrypt_ts_shPreimage.spentScriptHash, __scrypt_ts_shPreimage.inputIndex, guardInputIndex, __scrypt_ts_spentScriptHashes, __scrypt_ts_spentDataHashes);
41
41
  if(len(__scrypt_ts_nextState.ownerAddr) == 32) {
42
42
  require(unlockArgs.contractInputIndex >= 0 && unlockArgs.contractInputIndex < __scrypt_ts_inputCount);
43
- require(__scrypt_ts_nextState.ownerAddr == _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.getSpentScriptHash(__scrypt_ts_spentScriptHashes, unlockArgs.contractInputIndex));
43
+ require(__scrypt_ts_nextState.ownerAddr == _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.getSpentScriptHash(__scrypt_ts_spentScriptHashes, unlockArgs.contractInputIndex));
44
44
  } else {
45
- _opcat_labs_cat_sdk_2_1_2__rs__OwnerUtils.checkUserOwner(unlockArgs.userPubKey, __scrypt_ts_nextState.ownerAddr);
45
+ _opcat_labs_cat_sdk_2_1_3__rs__OwnerUtils.checkUserOwner(unlockArgs.userPubKey, __scrypt_ts_nextState.ownerAddr);
46
46
  require(checkSig(unlockArgs.userSig, unlockArgs.userPubKey));
47
47
  }
48
48
  require(true);
49
49
  }
50
- function checkGuard(_opcat_labs_cat_sdk_2_1_2__rs__CAT721GuardConstState guardState, bytes t_cat721ScriptHash, int t_cat721InputIndex, int guardInputIndex, bytes t_spentScriptsCtx, bytes t_spentDataHashesCtx) : bool {
51
- bytes guardScriptHash = _opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.getSpentScriptHash(t_spentScriptsCtx, guardInputIndex);
50
+ function checkGuard(_opcat_labs_cat_sdk_2_1_3__rs__CAT721GuardConstState guardState, bytes t_cat721ScriptHash, int t_cat721InputIndex, int guardInputIndex, bytes t_spentScriptsCtx, bytes t_spentDataHashesCtx) : bool {
51
+ bytes guardScriptHash = _opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.getSpentScriptHash(t_spentScriptsCtx, guardInputIndex);
52
52
  require(guardScriptHash == this.guardVariantScriptHashes[0] || guardScriptHash == this.guardVariantScriptHashes[1] || guardScriptHash == this.guardVariantScriptHashes[2] || guardScriptHash == this.guardVariantScriptHashes[3]);
53
- require(_opcat_labs_scrypt_ts_opcat_2_1_2__rs__ContextUtils.getSpentDataHash(t_spentDataHashesCtx, guardInputIndex) == _opcat_labs_cat_sdk_2_1_2__rs__CAT721GuardStateLib.stateHash(guardState));
53
+ require(_opcat_labs_scrypt_ts_opcat_2_1_3__rs__ContextUtils.getSpentDataHash(t_spentDataHashesCtx, guardInputIndex) == _opcat_labs_cat_sdk_2_1_3__rs__CAT721GuardStateLib.stateHash(guardState));
54
54
  int cat721ScriptIndex = unpack(guardState.nftScriptIndexes[t_cat721InputIndex : t_cat721InputIndex + 1]);
55
55
  require(guardState.nftScriptHashes[(cat721ScriptIndex)] == t_cat721ScriptHash);
56
56
  return true;
57
57
  }
58
- static function serializeState(_opcat_labs_cat_sdk_2_1_2__rs__CAT721State __scrypt_ts_curState): bytes {
58
+ static function serializeState(_opcat_labs_cat_sdk_2_1_3__rs__CAT721State __scrypt_ts_curState): bytes {
59
59
  return num2bin(len(__scrypt_ts_curState.ownerAddr), 2) + __scrypt_ts_curState.ownerAddr + num2bin(len(pack(__scrypt_ts_curState.localId)), 2) + pack(__scrypt_ts_curState.localId) + hash160(hash160(__scrypt_ts_curState.ownerAddr) + hash160(pack(__scrypt_ts_curState.localId)));
60
60
  }
61
- static function stateHash(_opcat_labs_cat_sdk_2_1_2__rs__CAT721State __scrypt_ts_curState): bytes {
61
+ static function stateHash(_opcat_labs_cat_sdk_2_1_3__rs__CAT721State __scrypt_ts_curState): bytes {
62
62
  return sha256(num2bin(len(__scrypt_ts_curState.ownerAddr), 2) + __scrypt_ts_curState.ownerAddr + num2bin(len(pack(__scrypt_ts_curState.localId)), 2) + pack(__scrypt_ts_curState.localId) + hash160(hash160(__scrypt_ts_curState.ownerAddr) + hash160(pack(__scrypt_ts_curState.localId))));
63
63
  }
64
64
  }