@opcat-labs/cat-sdk 2.0.1 → 2.0.2

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 (148) hide show
  1. package/artifacts/cat20/cat20.json +34 -34
  2. package/artifacts/cat20/cat20.scrypt +18 -18
  3. package/artifacts/cat20/cat20Admin.json +34 -34
  4. package/artifacts/cat20/cat20Admin.scrypt +30 -30
  5. package/artifacts/cat20/cat20GuardStateLib.json +21 -21
  6. package/artifacts/cat20/cat20GuardStateLib.scrypt +5 -5
  7. package/artifacts/cat20/cat20Guard_12_12_2.json +30 -30
  8. package/artifacts/cat20/cat20Guard_12_12_2.scrypt +21 -21
  9. package/artifacts/cat20/cat20Guard_12_12_4.json +30 -30
  10. package/artifacts/cat20/cat20Guard_12_12_4.scrypt +21 -21
  11. package/artifacts/cat20/cat20Guard_6_6_2.json +30 -30
  12. package/artifacts/cat20/cat20Guard_6_6_2.scrypt +21 -21
  13. package/artifacts/cat20/cat20Guard_6_6_4.json +30 -30
  14. package/artifacts/cat20/cat20Guard_6_6_4.scrypt +21 -21
  15. package/artifacts/cat20/cat20StateLib.json +22 -22
  16. package/artifacts/cat20/cat20StateLib.scrypt +5 -5
  17. package/artifacts/cat20/minters/cat20ClosedMinter.json +32 -32
  18. package/artifacts/cat20/minters/cat20ClosedMinter.scrypt +22 -22
  19. package/artifacts/cat20/minters/cat20OpenMinter.json +32 -32
  20. package/artifacts/cat20/minters/cat20OpenMinter.scrypt +18 -18
  21. package/artifacts/cat20/types.json +5 -5
  22. package/artifacts/cat20/types.scrypt +5 -5
  23. package/artifacts/cat721/cat721.json +34 -34
  24. package/artifacts/cat721/cat721.scrypt +18 -18
  25. package/artifacts/cat721/cat721GuardStateLib.json +21 -21
  26. package/artifacts/cat721/cat721GuardStateLib.scrypt +5 -5
  27. package/artifacts/cat721/cat721Guard_12_12_2.json +29 -29
  28. package/artifacts/cat721/cat721Guard_12_12_2.scrypt +18 -18
  29. package/artifacts/cat721/cat721Guard_12_12_4.json +29 -29
  30. package/artifacts/cat721/cat721Guard_12_12_4.scrypt +18 -18
  31. package/artifacts/cat721/cat721Guard_6_6_2.json +29 -29
  32. package/artifacts/cat721/cat721Guard_6_6_2.scrypt +18 -18
  33. package/artifacts/cat721/cat721Guard_6_6_4.json +29 -29
  34. package/artifacts/cat721/cat721Guard_6_6_4.scrypt +18 -18
  35. package/artifacts/cat721/cat721StateLib.json +22 -22
  36. package/artifacts/cat721/cat721StateLib.scrypt +5 -5
  37. package/artifacts/cat721/minters/cat721ClosedMinter.json +32 -32
  38. package/artifacts/cat721/minters/cat721ClosedMinter.scrypt +18 -18
  39. package/artifacts/cat721/minters/cat721OpenMintInfo.json +5 -5
  40. package/artifacts/cat721/minters/cat721OpenMintInfo.scrypt +4 -4
  41. package/artifacts/cat721/minters/cat721OpenMinter.json +37 -37
  42. package/artifacts/cat721/minters/cat721OpenMinter.scrypt +22 -22
  43. package/artifacts/cat721/minters/cat721OpenMinterMerkleTree.json +19 -19
  44. package/artifacts/cat721/minters/cat721OpenMinterMerkleTree.scrypt +6 -6
  45. package/artifacts/cat721/types.json +5 -5
  46. package/artifacts/cat721/types.scrypt +5 -5
  47. package/artifacts/constants.json +2 -2
  48. package/artifacts/constants.scrypt +1 -1
  49. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/backtrace.scrypt +12 -12
  50. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scrypt +16 -16
  51. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt +1 -1
  52. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stdUtils.scrypt +12 -12
  53. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txHashPreimageUtils.scrypt +7 -7
  54. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txUtils.scrypt +12 -12
  55. package/artifacts/scrypt-ts-opcat/assets/smart-contract/types/structs.scrypt +8 -8
  56. package/artifacts/types.json +2 -2
  57. package/artifacts/types.scrypt +2 -2
  58. package/artifacts/utils/ownerUtils.json +14 -14
  59. package/artifacts/utils/ownerUtils.scrypt +3 -3
  60. package/artifacts/utils/safeMath.json +14 -14
  61. package/artifacts/utils/safeMath.scrypt +1 -1
  62. package/dist/artifacts/cat20/cat20.json +34 -34
  63. package/dist/artifacts/cat20/cat20.scrypt +18 -18
  64. package/dist/artifacts/cat20/cat20Admin.json +34 -34
  65. package/dist/artifacts/cat20/cat20Admin.scrypt +30 -30
  66. package/dist/artifacts/cat20/cat20GuardStateLib.json +21 -21
  67. package/dist/artifacts/cat20/cat20GuardStateLib.scrypt +5 -5
  68. package/dist/artifacts/cat20/cat20Guard_12_12_2.json +30 -30
  69. package/dist/artifacts/cat20/cat20Guard_12_12_2.scrypt +21 -21
  70. package/dist/artifacts/cat20/cat20Guard_12_12_4.json +30 -30
  71. package/dist/artifacts/cat20/cat20Guard_12_12_4.scrypt +21 -21
  72. package/dist/artifacts/cat20/cat20Guard_6_6_2.json +30 -30
  73. package/dist/artifacts/cat20/cat20Guard_6_6_2.scrypt +21 -21
  74. package/dist/artifacts/cat20/cat20Guard_6_6_4.json +30 -30
  75. package/dist/artifacts/cat20/cat20Guard_6_6_4.scrypt +21 -21
  76. package/dist/artifacts/cat20/cat20StateLib.json +22 -22
  77. package/dist/artifacts/cat20/cat20StateLib.scrypt +5 -5
  78. package/dist/artifacts/cat20/minters/cat20ClosedMinter.json +32 -32
  79. package/dist/artifacts/cat20/minters/cat20ClosedMinter.scrypt +22 -22
  80. package/dist/artifacts/cat20/minters/cat20OpenMinter.json +32 -32
  81. package/dist/artifacts/cat20/minters/cat20OpenMinter.scrypt +18 -18
  82. package/dist/artifacts/cat20/types.json +5 -5
  83. package/dist/artifacts/cat20/types.scrypt +5 -5
  84. package/dist/artifacts/cat721/cat721.json +34 -34
  85. package/dist/artifacts/cat721/cat721.scrypt +18 -18
  86. package/dist/artifacts/cat721/cat721GuardStateLib.json +21 -21
  87. package/dist/artifacts/cat721/cat721GuardStateLib.scrypt +5 -5
  88. package/dist/artifacts/cat721/cat721Guard_12_12_2.json +29 -29
  89. package/dist/artifacts/cat721/cat721Guard_12_12_2.scrypt +18 -18
  90. package/dist/artifacts/cat721/cat721Guard_12_12_4.json +29 -29
  91. package/dist/artifacts/cat721/cat721Guard_12_12_4.scrypt +18 -18
  92. package/dist/artifacts/cat721/cat721Guard_6_6_2.json +29 -29
  93. package/dist/artifacts/cat721/cat721Guard_6_6_2.scrypt +18 -18
  94. package/dist/artifacts/cat721/cat721Guard_6_6_4.json +29 -29
  95. package/dist/artifacts/cat721/cat721Guard_6_6_4.scrypt +18 -18
  96. package/dist/artifacts/cat721/cat721StateLib.json +22 -22
  97. package/dist/artifacts/cat721/cat721StateLib.scrypt +5 -5
  98. package/dist/artifacts/cat721/minters/cat721ClosedMinter.json +32 -32
  99. package/dist/artifacts/cat721/minters/cat721ClosedMinter.scrypt +18 -18
  100. package/dist/artifacts/cat721/minters/cat721OpenMintInfo.json +5 -5
  101. package/dist/artifacts/cat721/minters/cat721OpenMintInfo.scrypt +4 -4
  102. package/dist/artifacts/cat721/minters/cat721OpenMinter.json +37 -37
  103. package/dist/artifacts/cat721/minters/cat721OpenMinter.scrypt +22 -22
  104. package/dist/artifacts/cat721/minters/cat721OpenMinterMerkleTree.json +19 -19
  105. package/dist/artifacts/cat721/minters/cat721OpenMinterMerkleTree.scrypt +6 -6
  106. package/dist/artifacts/cat721/types.json +5 -5
  107. package/dist/artifacts/cat721/types.scrypt +5 -5
  108. package/dist/artifacts/constants.json +2 -2
  109. package/dist/artifacts/constants.scrypt +1 -1
  110. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/backtrace.scrypt +12 -12
  111. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scrypt +16 -16
  112. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt +1 -1
  113. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stdUtils.scrypt +12 -12
  114. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txHashPreimageUtils.scrypt +7 -7
  115. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txUtils.scrypt +12 -12
  116. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/types/structs.scrypt +8 -8
  117. package/dist/artifacts/types.json +2 -2
  118. package/dist/artifacts/types.scrypt +2 -2
  119. package/dist/artifacts/utils/ownerUtils.json +14 -14
  120. package/dist/artifacts/utils/ownerUtils.scrypt +3 -3
  121. package/dist/artifacts/utils/safeMath.json +14 -14
  122. package/dist/artifacts/utils/safeMath.scrypt +1 -1
  123. package/dist/cjs/contracts/index.js +3 -0
  124. package/dist/cjs/contracts/index.js.map +1 -1
  125. package/dist/cjs/features/cat20/index.js +5 -1
  126. package/dist/cjs/features/cat20/index.js.map +1 -1
  127. package/dist/cjs/index.js +10 -3
  128. package/dist/cjs/index.js.map +1 -1
  129. package/dist/cjs/lib/index.js +1 -0
  130. package/dist/cjs/lib/index.js.map +1 -1
  131. package/dist/esm/contracts/index.js +3 -0
  132. package/dist/esm/contracts/index.js.map +1 -1
  133. package/dist/esm/features/cat20/index.js +2 -0
  134. package/dist/esm/features/cat20/index.js.map +1 -1
  135. package/dist/esm/index.js +5 -3
  136. package/dist/esm/index.js.map +1 -1
  137. package/dist/esm/lib/index.js +1 -0
  138. package/dist/esm/lib/index.js.map +1 -1
  139. package/dist/types/contracts/index.d.ts +3 -0
  140. package/dist/types/contracts/index.d.ts.map +1 -1
  141. package/dist/types/features/cat20/index.d.ts +2 -0
  142. package/dist/types/features/cat20/index.d.ts.map +1 -1
  143. package/dist/types/index.d.ts +3 -1
  144. package/dist/types/index.d.ts.map +1 -1
  145. package/dist/types/lib/index.d.ts +1 -0
  146. package/dist/types/lib/index.d.ts.map +1 -1
  147. package/package.json +4 -4
  148. package/scrypt.index.json +10 -10
@@ -12,24 +12,24 @@ import "../scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt"
12
12
 
13
13
 
14
14
 
15
- contract _opcat_labs_cat_sdk_2_0_1__rs__CAT20Guard_6_6_4 {
15
+ contract _opcat_labs_cat_sdk_2_0_2__rs__CAT20Guard_6_6_4 {
16
16
  constructor(){}
17
- public function unlock(bytes[6] nextStateHashes, bytes[6] ownerAddrOrScriptHashes, int[6] outputTokens, int[6] tokenScriptHashIndexes, int[6] outputSatoshis, _opcat_labs_cat_sdk_2_0_1__rs__CAT20State[6] cat20States, int outputCount, _opcat_labs_scrypt_ts_opcat_2_0_1__rs__SHPreimage __scrypt_ts_shPreimage, _opcat_labs_cat_sdk_2_0_1__rs__CAT20GuardConstState __scrypt_ts_curState, bytes __scrypt_ts_spentAmounts, bytes __scrypt_ts_spentDataHashes, bytes __scrypt_ts_spentScriptHashes) {
18
- require(Tx.checkPreimageSigHashType(_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage), SigHash.ALL));
17
+ public function unlock(bytes[6] nextStateHashes, bytes[6] ownerAddrOrScriptHashes, int[6] outputTokens, int[6] tokenScriptHashIndexes, int[6] outputSatoshis, _opcat_labs_cat_sdk_2_0_2__rs__CAT20State[6] cat20States, int outputCount, _opcat_labs_scrypt_ts_opcat_2_0_2__rs__SHPreimage __scrypt_ts_shPreimage, _opcat_labs_cat_sdk_2_0_2__rs__CAT20GuardConstState __scrypt_ts_curState, bytes __scrypt_ts_spentAmounts, bytes __scrypt_ts_spentDataHashes, bytes __scrypt_ts_spentScriptHashes) {
18
+ require(Tx.checkPreimageSigHashType(_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage), SigHash.ALL));
19
19
 
20
- int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
20
+ int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
21
21
 
22
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
22
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
23
23
 
24
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
24
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
25
25
 
26
- _opcat_labs_cat_sdk_2_0_1__rs__CAT20GuardConstState __scrypt_ts_nextState = __scrypt_ts_curState;
26
+ _opcat_labs_cat_sdk_2_0_2__rs__CAT20GuardConstState __scrypt_ts_nextState = __scrypt_ts_curState;
27
27
 
28
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_0_1__rs__CAT20Guard_6_6_4.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
28
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_0_2__rs__CAT20Guard_6_6_4.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
29
29
 
30
- _opcat_labs_cat_sdk_2_0_1__rs__CAT20GuardStateLib.formalCheckState(__scrypt_ts_nextState, 6);
30
+ _opcat_labs_cat_sdk_2_0_2__rs__CAT20GuardStateLib.formalCheckState(__scrypt_ts_nextState, 6);
31
31
  int inputTokenTypes = 0;
32
- bytes[4] tokenScriptPlaceholders = [_opcat_labs_cat_sdk_2_0_1__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FF, _opcat_labs_cat_sdk_2_0_1__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FE, _opcat_labs_cat_sdk_2_0_1__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FD, _opcat_labs_cat_sdk_2_0_1__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FC];
32
+ bytes[4] tokenScriptPlaceholders = [_opcat_labs_cat_sdk_2_0_2__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FF, _opcat_labs_cat_sdk_2_0_2__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FE, _opcat_labs_cat_sdk_2_0_2__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FD, _opcat_labs_cat_sdk_2_0_2__rs__ConstantsLib.TOKEN_SCRIPT_HASH_PLACEHOLDER_FC];
33
33
  loop (4) : i {
34
34
  if(i >= 4) {
35
35
  require(__scrypt_ts_nextState.tokenScriptHashes[(i)] == tokenScriptPlaceholders[(i)]);
@@ -60,10 +60,10 @@ contract _opcat_labs_cat_sdk_2_0_1__rs__CAT20Guard_6_6_4 {
60
60
  require(tokenScriptIndex < inputTokenTypes);
61
61
  if(tokenScriptIndex != -1) {
62
62
  bytes tokenScriptHash = __scrypt_ts_nextState.tokenScriptHashes[(tokenScriptIndex)];
63
- require(tokenScriptHash == _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.getSpentScriptHash(__scrypt_ts_spentScriptHashes, (i)));
64
- _opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib.checkState(cat20States[i]);
65
- require(_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.getSpentDataHash(__scrypt_ts_spentDataHashes, (i)) == _opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib.stateHash(cat20States[i]));
66
- sumInputTokens[(tokenScriptIndex)] = _opcat_labs_cat_sdk_2_0_1__rs__SafeMath.add(sumInputTokens[(tokenScriptIndex)], cat20States[i].amount);
63
+ require(tokenScriptHash == _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.getSpentScriptHash(__scrypt_ts_spentScriptHashes, (i)));
64
+ _opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib.checkState(cat20States[i]);
65
+ require(_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.getSpentDataHash(__scrypt_ts_spentDataHashes, (i)) == _opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib.stateHash(cat20States[i]));
66
+ sumInputTokens[(tokenScriptIndex)] = _opcat_labs_cat_sdk_2_0_2__rs__SafeMath.add(sumInputTokens[(tokenScriptIndex)], cat20States[i].amount);
67
67
  tokenScriptIndexMax = tokenScriptIndex > tokenScriptIndexMax ? tokenScriptIndex : tokenScriptIndexMax;
68
68
  }
69
69
  } else {
@@ -83,17 +83,17 @@ contract _opcat_labs_cat_sdk_2_0_1__rs__CAT20Guard_6_6_4 {
83
83
  if(tokenScriptHashIndex != -1) {
84
84
  int tokenAmount = outputTokens[i];
85
85
  require(tokenAmount > 0);
86
- sumOutputTokens[(tokenScriptHashIndex)] = _opcat_labs_cat_sdk_2_0_1__rs__SafeMath.add(sumOutputTokens[(tokenScriptHashIndex)], tokenAmount);
87
- bytes tokenStateHash = _opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib.stateHash({ownerAddrOrScriptHash, tokenAmount});
86
+ sumOutputTokens[(tokenScriptHashIndex)] = _opcat_labs_cat_sdk_2_0_2__rs__SafeMath.add(sumOutputTokens[(tokenScriptHashIndex)], tokenAmount);
87
+ bytes tokenStateHash = _opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib.stateHash({ownerAddrOrScriptHash, tokenAmount});
88
88
  require(nextStateHashes[i] == tokenStateHash);
89
89
  bytes tokenScriptHash = __scrypt_ts_nextState.tokenScriptHashes[(tokenScriptHashIndex)];
90
- outputs += _opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils.buildDataOutput(tokenScriptHash, outputSatoshis[i], tokenStateHash);
90
+ outputs += _opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils.buildDataOutput(tokenScriptHash, outputSatoshis[i], tokenStateHash);
91
91
  } else {
92
92
  require(outputTokens[i] == 0);
93
93
  loop (4) : j {
94
94
  require(ownerAddrOrScriptHash != __scrypt_ts_nextState.tokenScriptHashes[j]);
95
95
  }
96
- outputs += _opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils.buildDataOutput(ownerAddrOrScriptHash, outputSatoshis[i], nextStateHashes[i]);
96
+ outputs += _opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils.buildDataOutput(ownerAddrOrScriptHash, outputSatoshis[i], nextStateHashes[i]);
97
97
  }
98
98
  } else {
99
99
  require(len(ownerAddrOrScriptHashes[i]) == 0);
@@ -105,7 +105,7 @@ contract _opcat_labs_cat_sdk_2_0_1__rs__CAT20Guard_6_6_4 {
105
105
  }
106
106
  loop (4) : i {
107
107
  require(sumInputTokens[i] == __scrypt_ts_nextState.tokenAmounts[i]);
108
- require(sumInputTokens[i] == _opcat_labs_cat_sdk_2_0_1__rs__SafeMath.add(sumOutputTokens[i], __scrypt_ts_nextState.tokenBurnAmounts[i]));
108
+ require(sumInputTokens[i] == _opcat_labs_cat_sdk_2_0_2__rs__SafeMath.add(sumOutputTokens[i], __scrypt_ts_nextState.tokenBurnAmounts[i]));
109
109
  if(i < (inputTokenTypes)) {
110
110
  require(sumInputTokens[i] > 0);
111
111
  } else {
@@ -117,10 +117,10 @@ contract _opcat_labs_cat_sdk_2_0_1__rs__CAT20Guard_6_6_4 {
117
117
  }
118
118
  require(hash256(outputs) == __scrypt_ts_shPreimage.hashOutputs);
119
119
  }
120
- static function serializeState(_opcat_labs_cat_sdk_2_0_1__rs__CAT20GuardConstState __scrypt_ts_curState): bytes {
120
+ static function serializeState(_opcat_labs_cat_sdk_2_0_2__rs__CAT20GuardConstState __scrypt_ts_curState): bytes {
121
121
  return num2bin(len(__scrypt_ts_curState.tokenScriptHashes[0]), 2) + __scrypt_ts_curState.tokenScriptHashes[0] + num2bin(len(__scrypt_ts_curState.tokenScriptHashes[1]), 2) + __scrypt_ts_curState.tokenScriptHashes[1] + num2bin(len(__scrypt_ts_curState.tokenScriptHashes[2]), 2) + __scrypt_ts_curState.tokenScriptHashes[2] + num2bin(len(__scrypt_ts_curState.tokenScriptHashes[3]), 2) + __scrypt_ts_curState.tokenScriptHashes[3] + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[0])), 2) + pack(__scrypt_ts_curState.tokenAmounts[0]) + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[1])), 2) + pack(__scrypt_ts_curState.tokenAmounts[1]) + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[2])), 2) + pack(__scrypt_ts_curState.tokenAmounts[2]) + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[3])), 2) + pack(__scrypt_ts_curState.tokenAmounts[3]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[0])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[0]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[1])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[1]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[2])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[2]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[3])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[3]) + num2bin(len(__scrypt_ts_curState.tokenScriptIndexes), 2) + __scrypt_ts_curState.tokenScriptIndexes + hash160(hash160(__scrypt_ts_curState.tokenScriptHashes[0]) + hash160(__scrypt_ts_curState.tokenScriptHashes[1]) + hash160(__scrypt_ts_curState.tokenScriptHashes[2]) + hash160(__scrypt_ts_curState.tokenScriptHashes[3]) + hash160(pack(__scrypt_ts_curState.tokenAmounts[0])) + hash160(pack(__scrypt_ts_curState.tokenAmounts[1])) + hash160(pack(__scrypt_ts_curState.tokenAmounts[2])) + hash160(pack(__scrypt_ts_curState.tokenAmounts[3])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[0])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[1])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[2])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[3])) + hash160(__scrypt_ts_curState.tokenScriptIndexes));
122
122
  }
123
- static function stateHash(_opcat_labs_cat_sdk_2_0_1__rs__CAT20GuardConstState __scrypt_ts_curState): bytes {
123
+ static function stateHash(_opcat_labs_cat_sdk_2_0_2__rs__CAT20GuardConstState __scrypt_ts_curState): bytes {
124
124
  return sha256(num2bin(len(__scrypt_ts_curState.tokenScriptHashes[0]), 2) + __scrypt_ts_curState.tokenScriptHashes[0] + num2bin(len(__scrypt_ts_curState.tokenScriptHashes[1]), 2) + __scrypt_ts_curState.tokenScriptHashes[1] + num2bin(len(__scrypt_ts_curState.tokenScriptHashes[2]), 2) + __scrypt_ts_curState.tokenScriptHashes[2] + num2bin(len(__scrypt_ts_curState.tokenScriptHashes[3]), 2) + __scrypt_ts_curState.tokenScriptHashes[3] + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[0])), 2) + pack(__scrypt_ts_curState.tokenAmounts[0]) + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[1])), 2) + pack(__scrypt_ts_curState.tokenAmounts[1]) + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[2])), 2) + pack(__scrypt_ts_curState.tokenAmounts[2]) + num2bin(len(pack(__scrypt_ts_curState.tokenAmounts[3])), 2) + pack(__scrypt_ts_curState.tokenAmounts[3]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[0])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[0]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[1])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[1]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[2])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[2]) + num2bin(len(pack(__scrypt_ts_curState.tokenBurnAmounts[3])), 2) + pack(__scrypt_ts_curState.tokenBurnAmounts[3]) + num2bin(len(__scrypt_ts_curState.tokenScriptIndexes), 2) + __scrypt_ts_curState.tokenScriptIndexes + hash160(hash160(__scrypt_ts_curState.tokenScriptHashes[0]) + hash160(__scrypt_ts_curState.tokenScriptHashes[1]) + hash160(__scrypt_ts_curState.tokenScriptHashes[2]) + hash160(__scrypt_ts_curState.tokenScriptHashes[3]) + hash160(pack(__scrypt_ts_curState.tokenAmounts[0])) + hash160(pack(__scrypt_ts_curState.tokenAmounts[1])) + hash160(pack(__scrypt_ts_curState.tokenAmounts[2])) + hash160(pack(__scrypt_ts_curState.tokenAmounts[3])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[0])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[1])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[2])) + hash160(pack(__scrypt_ts_curState.tokenBurnAmounts[3])) + hash160(__scrypt_ts_curState.tokenScriptIndexes)));
125
125
  }
126
126
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 10,
3
3
  "compilerVersion": "1.21.0+commit.2ada378",
4
- "contract": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib",
4
+ "contract": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib",
5
5
  "md5": "d41d8cd98f00b204e9800998ecf8427e",
6
6
  "structs": [
7
7
  {
8
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxOut",
8
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxOut",
9
9
  "params": [
10
10
  {
11
11
  "name": "scriptHash",
@@ -23,7 +23,7 @@
23
23
  "genericTypes": []
24
24
  },
25
25
  {
26
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxIn",
26
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxIn",
27
27
  "params": [
28
28
  {
29
29
  "name": "prevTxHash",
@@ -45,7 +45,7 @@
45
45
  "genericTypes": []
46
46
  },
47
47
  {
48
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxHashPreimage",
48
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxHashPreimage",
49
49
  "params": [
50
50
  {
51
51
  "name": "version",
@@ -67,11 +67,11 @@
67
67
  "genericTypes": []
68
68
  },
69
69
  {
70
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__BacktraceInfo",
70
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__BacktraceInfo",
71
71
  "params": [
72
72
  {
73
73
  "name": "prevTxInput",
74
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxIn"
74
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxIn"
75
75
  },
76
76
  {
77
77
  "name": "prevTxInputIndex",
@@ -79,13 +79,13 @@
79
79
  },
80
80
  {
81
81
  "name": "prevPrevTxPreimage",
82
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxHashPreimage"
82
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxHashPreimage"
83
83
  }
84
84
  ],
85
85
  "genericTypes": []
86
86
  },
87
87
  {
88
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__SHPreimage",
88
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__SHPreimage",
89
89
  "params": [
90
90
  {
91
91
  "name": "nVersion",
@@ -147,7 +147,7 @@
147
147
  "genericTypes": []
148
148
  },
149
149
  {
150
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__Outpoint",
150
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__Outpoint",
151
151
  "params": [
152
152
  {
153
153
  "name": "txHash",
@@ -161,7 +161,7 @@
161
161
  "genericTypes": []
162
162
  },
163
163
  {
164
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20GuardConstState",
164
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20GuardConstState",
165
165
  "params": [
166
166
  {
167
167
  "name": "tokenScriptHashes",
@@ -183,7 +183,7 @@
183
183
  "genericTypes": []
184
184
  },
185
185
  {
186
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20State",
186
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20State",
187
187
  "params": [
188
188
  {
189
189
  "name": "ownerAddr",
@@ -197,7 +197,7 @@
197
197
  "genericTypes": []
198
198
  },
199
199
  {
200
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState",
200
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState",
201
201
  "params": [
202
202
  {
203
203
  "name": "tokenScriptHash",
@@ -207,7 +207,7 @@
207
207
  "genericTypes": []
208
208
  },
209
209
  {
210
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20OpenMinterState",
210
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20OpenMinterState",
211
211
  "params": [
212
212
  {
213
213
  "name": "tokenScriptHash",
@@ -225,7 +225,7 @@
225
225
  "genericTypes": []
226
226
  },
227
227
  {
228
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20AdminState",
228
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20AdminState",
229
229
  "params": [
230
230
  {
231
231
  "name": "tag",
@@ -239,7 +239,7 @@
239
239
  "genericTypes": []
240
240
  },
241
241
  {
242
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ReadVarintResult",
242
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ReadVarintResult",
243
243
  "params": [
244
244
  {
245
245
  "name": "data",
@@ -255,32 +255,32 @@
255
255
  ],
256
256
  "library": [
257
257
  {
258
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib",
258
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib",
259
259
  "params": [],
260
260
  "properties": [],
261
261
  "genericTypes": [],
262
- "stateType": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20State"
262
+ "stateType": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20State"
263
263
  },
264
264
  {
265
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__OwnerUtils",
265
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__OwnerUtils",
266
266
  "params": [],
267
267
  "properties": [],
268
268
  "genericTypes": []
269
269
  },
270
270
  {
271
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils",
271
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils",
272
272
  "params": [],
273
273
  "properties": [],
274
274
  "genericTypes": []
275
275
  },
276
276
  {
277
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils",
277
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils",
278
278
  "params": [],
279
279
  "properties": [],
280
280
  "genericTypes": []
281
281
  },
282
282
  {
283
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__StdUtils",
283
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__StdUtils",
284
284
  "params": [],
285
285
  "properties": [],
286
286
  "genericTypes": []
@@ -294,7 +294,7 @@
294
294
  }
295
295
  ],
296
296
  "stateProps": [],
297
- "stateType": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20State",
297
+ "stateType": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20State",
298
298
  "buildType": "release",
299
299
  "file": "../cat20StateLib.scrypt",
300
300
  "hex": ""
@@ -6,16 +6,16 @@ import "../scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scryp
6
6
 
7
7
 
8
8
 
9
- library _opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib {
10
- static function checkState(_opcat_labs_cat_sdk_2_0_1__rs__CAT20State _state) : bool {
11
- _opcat_labs_cat_sdk_2_0_1__rs__OwnerUtils.checkOwnerAddr(_state.ownerAddr);
9
+ library _opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib {
10
+ static function checkState(_opcat_labs_cat_sdk_2_0_2__rs__CAT20State _state) : bool {
11
+ _opcat_labs_cat_sdk_2_0_2__rs__OwnerUtils.checkOwnerAddr(_state.ownerAddr);
12
12
  require(_state.amount > 0);
13
13
  return true;
14
14
  }
15
- static function serializeState(_opcat_labs_cat_sdk_2_0_1__rs__CAT20State __scrypt_ts_curState): bytes {
15
+ static function serializeState(_opcat_labs_cat_sdk_2_0_2__rs__CAT20State __scrypt_ts_curState): bytes {
16
16
  return num2bin(len(__scrypt_ts_curState.ownerAddr), 2) + __scrypt_ts_curState.ownerAddr + num2bin(len(pack(__scrypt_ts_curState.amount)), 2) + pack(__scrypt_ts_curState.amount) + hash160(hash160(__scrypt_ts_curState.ownerAddr) + hash160(pack(__scrypt_ts_curState.amount)));
17
17
  }
18
- static function stateHash(_opcat_labs_cat_sdk_2_0_1__rs__CAT20State __scrypt_ts_curState): bytes {
18
+ static function stateHash(_opcat_labs_cat_sdk_2_0_2__rs__CAT20State __scrypt_ts_curState): bytes {
19
19
  return sha256(num2bin(len(__scrypt_ts_curState.ownerAddr), 2) + __scrypt_ts_curState.ownerAddr + num2bin(len(pack(__scrypt_ts_curState.amount)), 2) + pack(__scrypt_ts_curState.amount) + hash160(hash160(__scrypt_ts_curState.ownerAddr) + hash160(pack(__scrypt_ts_curState.amount))));
20
20
  }
21
21
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 10,
3
3
  "compilerVersion": "1.21.0+commit.2ada378",
4
- "contract": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinter",
4
+ "contract": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinter",
5
5
  "md5": "ac433d4d879e73ffbb162679af90a294",
6
6
  "structs": [
7
7
  {
8
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ReadVarintResult",
8
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ReadVarintResult",
9
9
  "params": [
10
10
  {
11
11
  "name": "data",
@@ -19,7 +19,7 @@
19
19
  "genericTypes": []
20
20
  },
21
21
  {
22
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxOut",
22
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxOut",
23
23
  "params": [
24
24
  {
25
25
  "name": "scriptHash",
@@ -37,7 +37,7 @@
37
37
  "genericTypes": []
38
38
  },
39
39
  {
40
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxIn",
40
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxIn",
41
41
  "params": [
42
42
  {
43
43
  "name": "prevTxHash",
@@ -59,7 +59,7 @@
59
59
  "genericTypes": []
60
60
  },
61
61
  {
62
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxHashPreimage",
62
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxHashPreimage",
63
63
  "params": [
64
64
  {
65
65
  "name": "version",
@@ -81,11 +81,11 @@
81
81
  "genericTypes": []
82
82
  },
83
83
  {
84
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__BacktraceInfo",
84
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__BacktraceInfo",
85
85
  "params": [
86
86
  {
87
87
  "name": "prevTxInput",
88
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxIn"
88
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxIn"
89
89
  },
90
90
  {
91
91
  "name": "prevTxInputIndex",
@@ -93,13 +93,13 @@
93
93
  },
94
94
  {
95
95
  "name": "prevPrevTxPreimage",
96
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxHashPreimage"
96
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxHashPreimage"
97
97
  }
98
98
  ],
99
99
  "genericTypes": []
100
100
  },
101
101
  {
102
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__SHPreimage",
102
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__SHPreimage",
103
103
  "params": [
104
104
  {
105
105
  "name": "nVersion",
@@ -161,7 +161,7 @@
161
161
  "genericTypes": []
162
162
  },
163
163
  {
164
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__Outpoint",
164
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__Outpoint",
165
165
  "params": [
166
166
  {
167
167
  "name": "txHash",
@@ -175,7 +175,7 @@
175
175
  "genericTypes": []
176
176
  },
177
177
  {
178
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ChainTxVerifyResponse",
178
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ChainTxVerifyResponse",
179
179
  "params": [
180
180
  {
181
181
  "name": "prevPrevScript",
@@ -189,7 +189,7 @@
189
189
  "genericTypes": []
190
190
  },
191
191
  {
192
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20GuardConstState",
192
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20GuardConstState",
193
193
  "params": [
194
194
  {
195
195
  "name": "tokenScriptHashes",
@@ -211,7 +211,7 @@
211
211
  "genericTypes": []
212
212
  },
213
213
  {
214
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20State",
214
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20State",
215
215
  "params": [
216
216
  {
217
217
  "name": "ownerAddr",
@@ -225,7 +225,7 @@
225
225
  "genericTypes": []
226
226
  },
227
227
  {
228
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState",
228
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState",
229
229
  "params": [
230
230
  {
231
231
  "name": "tokenScriptHash",
@@ -235,7 +235,7 @@
235
235
  "genericTypes": []
236
236
  },
237
237
  {
238
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20OpenMinterState",
238
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20OpenMinterState",
239
239
  "params": [
240
240
  {
241
241
  "name": "tokenScriptHash",
@@ -253,7 +253,7 @@
253
253
  "genericTypes": []
254
254
  },
255
255
  {
256
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20AdminState",
256
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20AdminState",
257
257
  "params": [
258
258
  {
259
259
  "name": "tag",
@@ -269,50 +269,50 @@
269
269
  ],
270
270
  "library": [
271
271
  {
272
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxHashPreimageUtils",
272
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxHashPreimageUtils",
273
273
  "params": [],
274
274
  "properties": [],
275
275
  "genericTypes": []
276
276
  },
277
277
  {
278
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib",
278
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib",
279
279
  "params": [],
280
280
  "properties": [],
281
281
  "genericTypes": [],
282
- "stateType": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20State"
282
+ "stateType": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20State"
283
283
  },
284
284
  {
285
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__StdUtils",
285
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__StdUtils",
286
286
  "params": [],
287
287
  "properties": [],
288
288
  "genericTypes": []
289
289
  },
290
290
  {
291
- "name": "_opcat_labs_cat_sdk_2_0_1__rs__OwnerUtils",
291
+ "name": "_opcat_labs_cat_sdk_2_0_2__rs__OwnerUtils",
292
292
  "params": [],
293
293
  "properties": [],
294
294
  "genericTypes": []
295
295
  },
296
296
  {
297
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils",
297
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils",
298
298
  "params": [],
299
299
  "properties": [],
300
300
  "genericTypes": []
301
301
  },
302
302
  {
303
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__Backtrace",
303
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__Backtrace",
304
304
  "params": [],
305
305
  "properties": [],
306
306
  "genericTypes": []
307
307
  },
308
308
  {
309
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__StateUtils",
309
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__StateUtils",
310
310
  "params": [],
311
311
  "properties": [],
312
312
  "genericTypes": []
313
313
  },
314
314
  {
315
- "name": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils",
315
+ "name": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils",
316
316
  "params": [],
317
317
  "properties": [],
318
318
  "genericTypes": []
@@ -327,7 +327,7 @@
327
327
  "params": [
328
328
  {
329
329
  "name": "tokenMint",
330
- "type": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20State"
330
+ "type": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20State"
331
331
  },
332
332
  {
333
333
  "name": "issuerPubKey",
@@ -347,19 +347,19 @@
347
347
  },
348
348
  {
349
349
  "name": "backtraceInfo",
350
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__BacktraceInfo"
350
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__BacktraceInfo"
351
351
  },
352
352
  {
353
353
  "name": "__scrypt_ts_shPreimage",
354
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__SHPreimage"
354
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__SHPreimage"
355
355
  },
356
356
  {
357
357
  "name": "__scrypt_ts_changeInfo",
358
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxOut"
358
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxOut"
359
359
  },
360
360
  {
361
361
  "name": "__scrypt_ts_curState",
362
- "type": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState"
362
+ "type": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState"
363
363
  },
364
364
  {
365
365
  "name": "__scrypt_ts_prevouts",
@@ -379,7 +379,7 @@
379
379
  },
380
380
  {
381
381
  "name": "__scrypt_ts_prevTxHashPreimage",
382
- "type": "_opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxHashPreimage"
382
+ "type": "_opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxHashPreimage"
383
383
  }
384
384
  ]
385
385
  },
@@ -398,7 +398,7 @@
398
398
  }
399
399
  ],
400
400
  "stateProps": [],
401
- "stateType": "_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState",
401
+ "stateType": "_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState",
402
402
  "buildType": "release",
403
403
  "file": "../cat20ClosedMinter.scrypt",
404
404
  "hex": "512097dfd76851bf465e8f715593b217714858bbe9570ff3bd5e33840a34e20ff0262102ba79df5f8ae7604a9830f03c7933028186aede0675a16f025dc4f8be8eec0382201008ce7480da41702918d1ec8e6849ba32b4d65b1e40dc669c31a1e6306b266c0000<ownerAddress><genesisOutpoint>78547a7572537a76537a757777011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f79011f795d798277549d5c79827701209d5b79827701209d5a79827701209d597900a26958798277549d5779827701209d5679827701209d5579827701209d5479827701209d5379827701209d527900a2697800a26976519c6476529c6751686476539c67516864760281009c67516864760282009c67516864760283009c675168695d795d797e5c797e5b797e5a79767600a2637609ffffffffffffffff00a16700686976586e8b806e7c7f75007f6b6d6d6d6c7e59797e58797e57797e56797e55797e54797e5379546e8b806e7c7f75007f6b6d6d6c7e5279546e8b806e7c7f75007f6b6d6d6c7e7854807e6b6d6d6d6d6d6d6d6c56797857795779210ac407f0e4bd44bfc207355a778b046225a7068fc59ee7eda43ad905aadbffc800206c266b30e6a1319c66dc401e5bd6b432ba49688eecd118297041da8074ce0810597956795679aa7676517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01007e817757795679567956795679537956795479577995939521414136d08c5ed2bf3ba048afe6dcaebafeffffffffffffffffffffffffffffff006e6e9776009f636e936776687777777b757c6e5296a0636e7c947b757c6853798277527982775379012080517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f517f7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e7c7e01205279947f77545379935279930130787e527e54797e58797e527e53797e52797e57797e6b6d6d6d6d6d6d6c765779ac6b6d6d6d6d6d6c77695c79011a7978aa7888785878827d77527997009d6e7c966b6d6d6c775e7901207901177970aa5379886e9f69765479012478827d77527997009d6e7c967777779d537952798b0124957f7552790124957f7d7701207f75007f777801247f7501207f77768277549d767601007e817777726d726d7b755d79011c7954795279aa527988765379012078827d77527997009d6e7c967777779d6d755e79011b7954795279aa527988765379012078827d77527997009d6e7c967777779d6d750111790118790113797682775280787e78a9a97ea8770111797653798b0120957f7553790120957f775279886d755d795d795d795d79011579011d79557955795579557953798277549d5279014878827d77527997009d6e7c967777775279014878827d77527997009d6e7c96777777557952790000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e55797e780000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e54797e53797eaa6b6d6d6d6c76700124950120937f7553790124957f77886d6d6d75012179012d79012d79012d79012d79012d79012d79012d79012d79012d795e790119790124798b0120957f750124790120957f770118795b795b795b795b795b795b795b795b795b7959797656798b0148957f7556790148957f775a795a795a795a795379827701209d76827701209d707600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e787e52797600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e6b6d6d6c88597976567956795679567953798277549d5279014878827d77527997009d6e7c967777775279014878827d77527997009d6e7c96777777557952790000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e55797e780000527902fd009f637551675279030000019f6301fd7b757c52776752790500000000019f6301fe7b757c54776701ff7b757c587768686878537952796e8b806e7c7f75007f6b6d6d6c7e7777777e54797e53797eaa6b6d6d6d6c8853795a7901489558930120937f755a7901489558937f77785b797600a2637605ffffffff00a16700686976546e8b806e7c7f75007f6b6d6d6c777e787c726d726d726d726d726d726d765579876478547987675168696d6d6d6d6d6d6d0131795779787676827701219d750376a91478a97e0288ac7e7778886d013079013279ad7876827701209d750001307900a06378013179012479527982777882777801209d7601209d537900a2695379767600a2637609ffffffffffffffff00a16700686976586e8b806e7c7f75007f6b6d6d6d6c55797e53797e6b6d6d6d6c680134790134797876827d7701199c647601209c675168696d51787700a0696d013479013479788277528052797e78827752807e787e5279a95279a97ea97ea8777753790131796f7582777882777801209d7601209d537900a2695379767600a2637609ffffffffffffffff00a16700686976586e8b806e7c7f75007f6b6d6d6d6c55797e53797e6b6d6d6c775279787e01187900a063011a790119796e00a8527982777882777801209d7601209d537900a2695379767600a2637609ffffffffffffffff00a16700686976586e8b806e7c7f75007f6b6d6d6d6c55797e53797e6b6d6d6d6c776700687eaa011e79876b6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6c77"
@@ -11,53 +11,53 @@ import "../../scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scry
11
11
 
12
12
 
13
13
 
14
- contract _opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinter {
14
+ contract _opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinter {
15
15
  bytes issuerAddress;
16
16
  bytes genesisOutpoint;
17
17
  constructor(bytes ownerAddress, bytes genesisOutpoint) {
18
18
  this.issuerAddress = ownerAddress;
19
19
  this.genesisOutpoint = genesisOutpoint;
20
20
  }
21
- public function mint(_opcat_labs_cat_sdk_2_0_1__rs__CAT20State tokenMint, PubKey issuerPubKey, Sig issuerSig, int minterSatoshis, int tokenSatoshis, _opcat_labs_scrypt_ts_opcat_2_0_1__rs__BacktraceInfo backtraceInfo, _opcat_labs_scrypt_ts_opcat_2_0_1__rs__SHPreimage __scrypt_ts_shPreimage, _opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxOut __scrypt_ts_changeInfo, _opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState __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_0_1__rs__TxHashPreimage __scrypt_ts_prevTxHashPreimage) {
22
- require(Tx.checkPreimageSigHashType(_opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage), SigHash.ALL));
21
+ public function mint(_opcat_labs_cat_sdk_2_0_2__rs__CAT20State tokenMint, PubKey issuerPubKey, Sig issuerSig, int minterSatoshis, int tokenSatoshis, _opcat_labs_scrypt_ts_opcat_2_0_2__rs__BacktraceInfo backtraceInfo, _opcat_labs_scrypt_ts_opcat_2_0_2__rs__SHPreimage __scrypt_ts_shPreimage, _opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxOut __scrypt_ts_changeInfo, _opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState __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_0_2__rs__TxHashPreimage __scrypt_ts_prevTxHashPreimage) {
22
+ require(Tx.checkPreimageSigHashType(_opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage), SigHash.ALL));
23
23
 
24
- int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
24
+ int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts);
25
25
 
26
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__Outpoint __scrypt_ts_prevout = _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.checkPrevouts(__scrypt_ts_prevouts, __scrypt_ts_shPreimage.hashPrevouts, __scrypt_ts_shPreimage.inputIndex, __scrypt_ts_inputCount);
26
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__Outpoint __scrypt_ts_prevout = _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.checkPrevouts(__scrypt_ts_prevouts, __scrypt_ts_shPreimage.hashPrevouts, __scrypt_ts_shPreimage.inputIndex, __scrypt_ts_inputCount);
27
27
 
28
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
28
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount);
29
29
 
30
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
30
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__ContextUtils.checkSpentDataHashes(__scrypt_ts_spentDataHashes, __scrypt_ts_shPreimage.hashSpentDataHashes, __scrypt_ts_inputCount);
31
31
 
32
- _opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState __scrypt_ts_nextState = __scrypt_ts_curState;
32
+ _opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState __scrypt_ts_nextState = __scrypt_ts_curState;
33
33
 
34
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinter.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
34
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__StateUtils.checkInputState(__scrypt_ts_shPreimage.inputIndex, _opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinter.stateHash(__scrypt_ts_curState), __scrypt_ts_spentDataHashes);
35
35
 
36
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__Backtrace.checkPrevTxHashPreimage(__scrypt_ts_prevTxHashPreimage, __scrypt_ts_prevouts, __scrypt_ts_shPreimage.inputIndex);
36
+ _opcat_labs_scrypt_ts_opcat_2_0_2__rs__Backtrace.checkPrevTxHashPreimage(__scrypt_ts_prevTxHashPreimage, __scrypt_ts_prevouts, __scrypt_ts_shPreimage.inputIndex);
37
37
 
38
38
  bytes minterScript = __scrypt_ts_shPreimage.spentScriptHash;
39
- _opcat_labs_scrypt_ts_opcat_2_0_1__rs__Backtrace.verifyFromOutpoint(backtraceInfo, this.genesisOutpoint, __scrypt_ts_spentScriptHashes[__scrypt_ts_shPreimage.inputIndex * 32 : (__scrypt_ts_shPreimage.inputIndex + 1) * 32], __scrypt_ts_prevTxHashPreimage.inputList);
40
- _opcat_labs_cat_sdk_2_0_1__rs__OwnerUtils.checkUserOwner(issuerPubKey, this.issuerAddress);
39
+ _opcat_labs_scrypt_ts_opcat_2_0_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);
40
+ _opcat_labs_cat_sdk_2_0_2__rs__OwnerUtils.checkUserOwner(issuerPubKey, this.issuerAddress);
41
41
  require(checkSig(issuerSig, issuerPubKey));
42
- _opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinter.checkState(__scrypt_ts_nextState);
42
+ _opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinter.checkState(__scrypt_ts_nextState);
43
43
  bytes minterOutput = b'';
44
- if(minterSatoshis > _opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils.ZERO_SATS) {
45
- minterOutput = _opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils.buildDataOutput(minterScript, minterSatoshis, __scrypt_ts_shPreimage.spentDataHash);
44
+ if(minterSatoshis > _opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils.ZERO_SATS) {
45
+ minterOutput = _opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils.buildDataOutput(minterScript, minterSatoshis, __scrypt_ts_shPreimage.spentDataHash);
46
46
  }
47
- _opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib.checkState(tokenMint);
48
- bytes tokenStateHash = _opcat_labs_cat_sdk_2_0_1__rs__CAT20StateLib.stateHash(tokenMint);
49
- bytes tokenOutput = _opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils.buildDataOutput(__scrypt_ts_nextState.tokenScriptHash, tokenSatoshis, tokenStateHash);
47
+ _opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib.checkState(tokenMint);
48
+ bytes tokenStateHash = _opcat_labs_cat_sdk_2_0_2__rs__CAT20StateLib.stateHash(tokenMint);
49
+ bytes tokenOutput = _opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils.buildDataOutput(__scrypt_ts_nextState.tokenScriptHash, tokenSatoshis, tokenStateHash);
50
50
  require(hash256(minterOutput + tokenOutput +
51
- (__scrypt_ts_changeInfo.satoshis > 0 ? _opcat_labs_scrypt_ts_opcat_2_0_1__rs__TxUtils.buildOutput(__scrypt_ts_changeInfo.scriptHash, __scrypt_ts_changeInfo.satoshis) : b'')) == __scrypt_ts_shPreimage.hashOutputs);
51
+ (__scrypt_ts_changeInfo.satoshis > 0 ? _opcat_labs_scrypt_ts_opcat_2_0_2__rs__TxUtils.buildOutput(__scrypt_ts_changeInfo.scriptHash, __scrypt_ts_changeInfo.satoshis) : b'')) == __scrypt_ts_shPreimage.hashOutputs);
52
52
  }
53
- static function checkState(_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState _state) : bool {
53
+ static function checkState(_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState _state) : bool {
54
54
  require(len(_state.tokenScriptHash) == 32);
55
55
  return true;
56
56
  }
57
- static function serializeState(_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState __scrypt_ts_curState): bytes {
57
+ static function serializeState(_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState __scrypt_ts_curState): bytes {
58
58
  return num2bin(len(__scrypt_ts_curState.tokenScriptHash), 2) + __scrypt_ts_curState.tokenScriptHash + hash160(hash160(__scrypt_ts_curState.tokenScriptHash));
59
59
  }
60
- static function stateHash(_opcat_labs_cat_sdk_2_0_1__rs__CAT20ClosedMinterState __scrypt_ts_curState): bytes {
60
+ static function stateHash(_opcat_labs_cat_sdk_2_0_2__rs__CAT20ClosedMinterState __scrypt_ts_curState): bytes {
61
61
  return sha256(num2bin(len(__scrypt_ts_curState.tokenScriptHash), 2) + __scrypt_ts_curState.tokenScriptHash + hash160(hash160(__scrypt_ts_curState.tokenScriptHash)));
62
62
  }
63
63
  }