@opcat-labs/cat-sdk 3.2.0 → 3.3.0

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 (137) hide show
  1. package/artifacts/.templates/cat20/cat20Admin.scrypt.tpl +4 -4
  2. package/artifacts/.templates/cat20/cat20Guard_12_12_2.scrypt.tpl +2 -2
  3. package/artifacts/.templates/cat20/cat20Guard_12_12_4.scrypt.tpl +2 -2
  4. package/artifacts/.templates/cat20/cat20Guard_6_6_2.scrypt.tpl +2 -2
  5. package/artifacts/.templates/cat20/cat20Guard_6_6_4.scrypt.tpl +2 -2
  6. package/artifacts/.templates/cat20/minters/cat20ClosedMinter.scrypt.tpl +2 -2
  7. package/artifacts/.templates/cat20/minters/cat20OpenMinter.scrypt.tpl +2 -2
  8. package/artifacts/.templates/cat721/cat721Guard_12_12_2.scrypt.tpl +2 -2
  9. package/artifacts/.templates/cat721/cat721Guard_12_12_4.scrypt.tpl +2 -2
  10. package/artifacts/.templates/cat721/cat721Guard_6_6_2.scrypt.tpl +2 -2
  11. package/artifacts/.templates/cat721/cat721Guard_6_6_4.scrypt.tpl +2 -2
  12. package/artifacts/.templates/cat721/minters/cat721ClosedMinter.scrypt.tpl +2 -2
  13. package/artifacts/.templates/cat721/minters/cat721OpenMinter.scrypt.tpl +2 -2
  14. package/artifacts/cat20/cat20.json +52 -34
  15. package/artifacts/cat20/cat20.scrypt +18 -18
  16. package/artifacts/cat20/cat20Admin.json +54 -36
  17. package/artifacts/cat20/cat20Admin.scrypt +30 -30
  18. package/artifacts/cat20/cat20GuardStateLib.json +39 -21
  19. package/artifacts/cat20/cat20GuardStateLib.scrypt +5 -5
  20. package/artifacts/cat20/cat20Guard_12_12_2.json +53 -35
  21. package/artifacts/cat20/cat20Guard_12_12_2.scrypt +29 -29
  22. package/artifacts/cat20/cat20Guard_12_12_4.json +53 -35
  23. package/artifacts/cat20/cat20Guard_12_12_4.scrypt +29 -29
  24. package/artifacts/cat20/cat20Guard_6_6_2.json +53 -35
  25. package/artifacts/cat20/cat20Guard_6_6_2.scrypt +29 -29
  26. package/artifacts/cat20/cat20Guard_6_6_4.json +53 -35
  27. package/artifacts/cat20/cat20Guard_6_6_4.scrypt +29 -29
  28. package/artifacts/cat20/cat20StateLib.json +40 -22
  29. package/artifacts/cat20/cat20StateLib.scrypt +5 -5
  30. package/artifacts/cat20/minters/cat20ClosedMinter.json +52 -34
  31. package/artifacts/cat20/minters/cat20ClosedMinter.scrypt +22 -22
  32. package/artifacts/cat20/minters/cat20OpenMinter.json +52 -34
  33. package/artifacts/cat20/minters/cat20OpenMinter.scrypt +18 -18
  34. package/artifacts/cat20/types.json +5 -5
  35. package/artifacts/cat20/types.scrypt +5 -5
  36. package/artifacts/cat721/cat721.json +52 -34
  37. package/artifacts/cat721/cat721.scrypt +18 -18
  38. package/artifacts/cat721/cat721GuardStateLib.json +39 -21
  39. package/artifacts/cat721/cat721GuardStateLib.scrypt +5 -5
  40. package/artifacts/cat721/cat721Guard_12_12_2.json +52 -34
  41. package/artifacts/cat721/cat721Guard_12_12_2.scrypt +26 -26
  42. package/artifacts/cat721/cat721Guard_12_12_4.json +52 -34
  43. package/artifacts/cat721/cat721Guard_12_12_4.scrypt +26 -26
  44. package/artifacts/cat721/cat721Guard_6_6_2.json +52 -34
  45. package/artifacts/cat721/cat721Guard_6_6_2.scrypt +26 -26
  46. package/artifacts/cat721/cat721Guard_6_6_4.json +52 -34
  47. package/artifacts/cat721/cat721Guard_6_6_4.scrypt +26 -26
  48. package/artifacts/cat721/cat721StateLib.json +40 -22
  49. package/artifacts/cat721/cat721StateLib.scrypt +5 -5
  50. package/artifacts/cat721/minters/cat721ClosedMinter.json +52 -34
  51. package/artifacts/cat721/minters/cat721ClosedMinter.scrypt +18 -18
  52. package/artifacts/cat721/minters/cat721OpenMintInfo.json +5 -5
  53. package/artifacts/cat721/minters/cat721OpenMintInfo.scrypt +4 -4
  54. package/artifacts/cat721/minters/cat721OpenMinter.json +57 -39
  55. package/artifacts/cat721/minters/cat721OpenMinter.scrypt +22 -22
  56. package/artifacts/cat721/minters/cat721OpenMinterMerkleTree.json +37 -19
  57. package/artifacts/cat721/minters/cat721OpenMinterMerkleTree.scrypt +6 -6
  58. package/artifacts/cat721/types.json +5 -5
  59. package/artifacts/cat721/types.scrypt +5 -5
  60. package/artifacts/constants.json +2 -2
  61. package/artifacts/constants.scrypt +1 -1
  62. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/backtrace.scrypt +13 -13
  63. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scrypt +16 -16
  64. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt +1 -1
  65. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stdUtils.scrypt +12 -12
  66. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txHashPreimageUtils.scrypt +7 -7
  67. package/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txUtils.scrypt +12 -12
  68. package/artifacts/scrypt-ts-opcat/assets/smart-contract/types/structs.scrypt +15 -9
  69. package/artifacts/types.json +2 -2
  70. package/artifacts/types.scrypt +2 -2
  71. package/artifacts/utils/ownerUtils.json +32 -14
  72. package/artifacts/utils/ownerUtils.scrypt +3 -3
  73. package/artifacts/utils/safeMath.json +32 -14
  74. package/artifacts/utils/safeMath.scrypt +1 -1
  75. package/dist/artifacts/cat20/cat20.json +52 -34
  76. package/dist/artifacts/cat20/cat20.scrypt +18 -18
  77. package/dist/artifacts/cat20/cat20Admin.json +54 -36
  78. package/dist/artifacts/cat20/cat20Admin.scrypt +30 -30
  79. package/dist/artifacts/cat20/cat20GuardStateLib.json +39 -21
  80. package/dist/artifacts/cat20/cat20GuardStateLib.scrypt +5 -5
  81. package/dist/artifacts/cat20/cat20Guard_12_12_2.json +53 -35
  82. package/dist/artifacts/cat20/cat20Guard_12_12_2.scrypt +29 -29
  83. package/dist/artifacts/cat20/cat20Guard_12_12_4.json +53 -35
  84. package/dist/artifacts/cat20/cat20Guard_12_12_4.scrypt +29 -29
  85. package/dist/artifacts/cat20/cat20Guard_6_6_2.json +53 -35
  86. package/dist/artifacts/cat20/cat20Guard_6_6_2.scrypt +29 -29
  87. package/dist/artifacts/cat20/cat20Guard_6_6_4.json +53 -35
  88. package/dist/artifacts/cat20/cat20Guard_6_6_4.scrypt +29 -29
  89. package/dist/artifacts/cat20/cat20StateLib.json +40 -22
  90. package/dist/artifacts/cat20/cat20StateLib.scrypt +5 -5
  91. package/dist/artifacts/cat20/minters/cat20ClosedMinter.json +52 -34
  92. package/dist/artifacts/cat20/minters/cat20ClosedMinter.scrypt +22 -22
  93. package/dist/artifacts/cat20/minters/cat20OpenMinter.json +52 -34
  94. package/dist/artifacts/cat20/minters/cat20OpenMinter.scrypt +18 -18
  95. package/dist/artifacts/cat20/types.json +5 -5
  96. package/dist/artifacts/cat20/types.scrypt +5 -5
  97. package/dist/artifacts/cat721/cat721.json +52 -34
  98. package/dist/artifacts/cat721/cat721.scrypt +18 -18
  99. package/dist/artifacts/cat721/cat721GuardStateLib.json +39 -21
  100. package/dist/artifacts/cat721/cat721GuardStateLib.scrypt +5 -5
  101. package/dist/artifacts/cat721/cat721Guard_12_12_2.json +52 -34
  102. package/dist/artifacts/cat721/cat721Guard_12_12_2.scrypt +26 -26
  103. package/dist/artifacts/cat721/cat721Guard_12_12_4.json +52 -34
  104. package/dist/artifacts/cat721/cat721Guard_12_12_4.scrypt +26 -26
  105. package/dist/artifacts/cat721/cat721Guard_6_6_2.json +52 -34
  106. package/dist/artifacts/cat721/cat721Guard_6_6_2.scrypt +26 -26
  107. package/dist/artifacts/cat721/cat721Guard_6_6_4.json +52 -34
  108. package/dist/artifacts/cat721/cat721Guard_6_6_4.scrypt +26 -26
  109. package/dist/artifacts/cat721/cat721StateLib.json +40 -22
  110. package/dist/artifacts/cat721/cat721StateLib.scrypt +5 -5
  111. package/dist/artifacts/cat721/minters/cat721ClosedMinter.json +52 -34
  112. package/dist/artifacts/cat721/minters/cat721ClosedMinter.scrypt +18 -18
  113. package/dist/artifacts/cat721/minters/cat721OpenMintInfo.json +5 -5
  114. package/dist/artifacts/cat721/minters/cat721OpenMintInfo.scrypt +4 -4
  115. package/dist/artifacts/cat721/minters/cat721OpenMinter.json +57 -39
  116. package/dist/artifacts/cat721/minters/cat721OpenMinter.scrypt +22 -22
  117. package/dist/artifacts/cat721/minters/cat721OpenMinterMerkleTree.json +37 -19
  118. package/dist/artifacts/cat721/minters/cat721OpenMinterMerkleTree.scrypt +6 -6
  119. package/dist/artifacts/cat721/types.json +5 -5
  120. package/dist/artifacts/cat721/types.scrypt +5 -5
  121. package/dist/artifacts/constants.json +2 -2
  122. package/dist/artifacts/constants.scrypt +1 -1
  123. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/backtrace.scrypt +13 -13
  124. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scrypt +16 -16
  125. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stateUtils.scrypt +1 -1
  126. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/stdUtils.scrypt +12 -12
  127. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txHashPreimageUtils.scrypt +7 -7
  128. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/builtin-libs/txUtils.scrypt +12 -12
  129. package/dist/artifacts/scrypt-ts-opcat/assets/smart-contract/types/structs.scrypt +15 -9
  130. package/dist/artifacts/types.json +2 -2
  131. package/dist/artifacts/types.scrypt +2 -2
  132. package/dist/artifacts/utils/ownerUtils.json +32 -14
  133. package/dist/artifacts/utils/ownerUtils.scrypt +3 -3
  134. package/dist/artifacts/utils/safeMath.json +32 -14
  135. package/dist/artifacts/utils/safeMath.scrypt +1 -1
  136. package/package.json +4 -4
  137. package/scrypt.index.json +13 -13
@@ -1,31 +1,31 @@
1
1
 
2
2
 
3
3
 
4
- struct _opcat_labs_cat_sdk_3_2_0__rs__CAT721GuardConstState {
4
+ struct _opcat_labs_cat_sdk_3_3_0__rs__CAT721GuardConstState {
5
5
  bytes deployerAddr;
6
6
  bytes[4] nftScriptHashes;
7
7
  bytes nftBurnMasks;
8
8
  bytes nftScriptIndexes;
9
9
  }
10
10
 
11
- struct _opcat_labs_cat_sdk_3_2_0__rs__CAT721State {
11
+ struct _opcat_labs_cat_sdk_3_3_0__rs__CAT721State {
12
12
  bytes ownerAddr;
13
13
  int localId;
14
14
  }
15
15
 
16
- struct _opcat_labs_cat_sdk_3_2_0__rs__CAT721ClosedMinterState {
16
+ struct _opcat_labs_cat_sdk_3_3_0__rs__CAT721ClosedMinterState {
17
17
  bytes nftScriptHash;
18
18
  int maxLocalId;
19
19
  int nextLocalId;
20
20
  }
21
21
 
22
- struct _opcat_labs_cat_sdk_3_2_0__rs__CAT721MerkleLeaf {
22
+ struct _opcat_labs_cat_sdk_3_3_0__rs__CAT721MerkleLeaf {
23
23
  bytes contentDataHash;
24
24
  int localId;
25
25
  bool isMined;
26
26
  }
27
27
 
28
- struct _opcat_labs_cat_sdk_3_2_0__rs__CAT721OpenMinterState {
28
+ struct _opcat_labs_cat_sdk_3_3_0__rs__CAT721OpenMinterState {
29
29
  bytes nftScriptHash;
30
30
  bytes merkleRoot;
31
31
  int nextLocalId;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "version": 10,
3
3
  "compilerVersion": "1.22.0+commit.47800da",
4
- "contract": "_opcat_labs_cat_sdk_3_2_0__rs__ConstantsLib",
4
+ "contract": "_opcat_labs_cat_sdk_3_3_0__rs__ConstantsLib",
5
5
  "md5": "d41d8cd98f00b204e9800998ecf8427e",
6
6
  "structs": [],
7
7
  "library": [
8
8
  {
9
- "name": "_opcat_labs_cat_sdk_3_2_0__rs__ConstantsLib",
9
+ "name": "_opcat_labs_cat_sdk_3_3_0__rs__ConstantsLib",
10
10
  "params": [],
11
11
  "properties": [],
12
12
  "genericTypes": []
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
3
 
4
- library _opcat_labs_cat_sdk_3_2_0__rs__ConstantsLib {
4
+ library _opcat_labs_cat_sdk_3_3_0__rs__ConstantsLib {
5
5
  static const bytes ZERO_SHA1256_HASH = Sha256(b'0000000000000000000000000000000000000000000000000000000000000000');
6
6
  static const bytes TOKEN_SCRIPT_HASH_PLACEHOLDER_FF = Sha256(b'00000000000000000000000000000000000000000000000000000000000000ff');
7
7
  static const bytes TOKEN_SCRIPT_HASH_PLACEHOLDER_FE = Sha256(b'00000000000000000000000000000000000000000000000000000000000000fe');
@@ -6,37 +6,37 @@ import "stdUtils.scrypt";
6
6
 
7
7
 
8
8
 
9
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ChainTxVerifyResponse {
9
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ChainTxVerifyResponse {
10
10
  bytes prevPrevScript;
11
11
  bytes prevPrevOutpoint;
12
12
  }
13
13
 
14
- library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__Backtrace {
14
+ library _opcat_labs_scrypt_ts_opcat_3_3_0__rs__Backtrace {
15
15
  static const bytes GENESIS_SCRIPT_HASH = b'836c4b45ab7a625549ca7c799b02d3304adf996557929ee809613e602d26c1f8';
16
- static function checkPrevTxHashPreimage(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimage txHashPreimage, bytes t_prevouts, int t_inputIndex) : bool {
17
- bytes txHash = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimageUtils.getTxHashFromTxHashPreimage(txHashPreimage);
16
+ static function checkPrevTxHashPreimage(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimage txHashPreimage, bytes t_prevouts, int t_inputIndex) : bool {
17
+ bytes txHash = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimageUtils.getTxHashFromTxHashPreimage(txHashPreimage);
18
18
  require(txHash == t_prevouts[t_inputIndex * 36 : t_inputIndex * 36 + 32]);
19
19
  return true;
20
20
  }
21
- static function verifyFromOutpoint(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__BacktraceInfo backtraceInfo, bytes t_genesisOutpoint, bytes t_selfScript, bytes t_prevTxInputList) : bool {
22
- _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ChainTxVerifyResponse res = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__Backtrace.verifyChainTxs(backtraceInfo, t_prevTxInputList);
21
+ static function verifyFromOutpoint(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__BacktraceInfo backtraceInfo, bytes t_genesisOutpoint, bytes t_selfScript, bytes t_prevTxInputList) : bool {
22
+ _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ChainTxVerifyResponse res = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__Backtrace.verifyChainTxs(backtraceInfo, t_prevTxInputList);
23
23
  if(res.prevPrevOutpoint == t_genesisOutpoint) {
24
- require(res.prevPrevScript == _opcat_labs_scrypt_ts_opcat_3_2_0__rs__Backtrace.GENESIS_SCRIPT_HASH);
24
+ require(res.prevPrevScript == _opcat_labs_scrypt_ts_opcat_3_3_0__rs__Backtrace.GENESIS_SCRIPT_HASH);
25
25
  }
26
26
  require(res.prevPrevOutpoint == t_genesisOutpoint || res.prevPrevScript == t_selfScript);
27
27
  return true;
28
28
  }
29
- static function verifyFromScript(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__BacktraceInfo backtraceInfo, bytes t_genesisScript, bytes t_selfScript, bytes t_prevTxInputList) : bool {
30
- _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ChainTxVerifyResponse res = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__Backtrace.verifyChainTxs(backtraceInfo, t_prevTxInputList);
29
+ static function verifyFromScript(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__BacktraceInfo backtraceInfo, bytes t_genesisScript, bytes t_selfScript, bytes t_prevTxInputList) : bool {
30
+ _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ChainTxVerifyResponse res = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__Backtrace.verifyChainTxs(backtraceInfo, t_prevTxInputList);
31
31
  require(res.prevPrevScript == t_genesisScript || res.prevPrevScript == t_selfScript);
32
32
  return true;
33
33
  }
34
- static function verifyChainTxs(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__BacktraceInfo backtraceInfo, bytes t_prevTxInputList) : _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ChainTxVerifyResponse {
35
- require(t_prevTxInputList[backtraceInfo.prevTxInputIndex * 72 : (backtraceInfo.prevTxInputIndex + 1) * 72] == _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.mergeInput(backtraceInfo.prevTxInput));
34
+ static function verifyChainTxs(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__BacktraceInfo backtraceInfo, bytes t_prevTxInputList) : _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ChainTxVerifyResponse {
35
+ require(t_prevTxInputList[backtraceInfo.prevTxInputIndex * 72 : (backtraceInfo.prevTxInputIndex + 1) * 72] == _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.mergeInput(backtraceInfo.prevTxInput));
36
36
  bytes prevPrevTxHash = backtraceInfo.prevTxInput.prevTxHash;
37
- require(prevPrevTxHash == _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimageUtils.getTxHashFromTxHashPreimage(backtraceInfo.prevPrevTxPreimage));
37
+ require(prevPrevTxHash == _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimageUtils.getTxHashFromTxHashPreimage(backtraceInfo.prevPrevTxPreimage));
38
38
  bytes prevPrevScript = backtraceInfo.prevPrevTxPreimage.outputList[backtraceInfo.prevTxInput.prevOutputIndex * 72 + 8 : (backtraceInfo.prevTxInput.prevOutputIndex) * 72 + 8 + 32];
39
- bytes prevPrevOutpoint = prevPrevTxHash + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.uint32ToByteString(backtraceInfo.prevTxInput.prevOutputIndex);
39
+ bytes prevPrevOutpoint = prevPrevTxHash + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.uint32ToByteString(backtraceInfo.prevTxInput.prevOutputIndex);
40
40
  return {prevPrevScript, prevPrevOutpoint};
41
41
  }
42
42
  }
@@ -5,7 +5,7 @@ import "stdUtils.scrypt";
5
5
 
6
6
 
7
7
 
8
- library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils {
8
+ library _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils {
9
9
  static const PrivKey privKey = PrivKey(0x26f00fe2340a84335ebdf30f57e9bb58487117b29355718f5e46bf5168d7df97);
10
10
  static const PubKey pubKey = PubKey(b'02ba79df5f8ae7604a9830f03c7933028186aede0675a16f025dc4f8be8eec0382');
11
11
  static const int invK = 0xc8ffdbaa05d93aa4ede79ec58f06a72562048b775a3507c2bf44bde4f007c40a;
@@ -18,7 +18,7 @@ library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils {
18
18
  static function sign(int h, PrivKey privKey, int inverseK, int r, bytes rBigEndian, bytes sigHashType) : Sig {
19
19
  int s = inverseK * (h + r * privKey);
20
20
 
21
- s = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils.normalize(s, 115792089237316195423570985008687907852837564279074904382605163141518161494337);
21
+ s = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils.normalize(s, 115792089237316195423570985008687907852837564279074904382605163141518161494337);
22
22
  if(s > 115792089237316195423570985008687907852837564279074904382605163141518161494337 / 2) {
23
23
  s = 115792089237316195423570985008687907852837564279074904382605163141518161494337 - s;
24
24
  }
@@ -32,13 +32,13 @@ library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils {
32
32
  static function fromBEUnsigned(bytes b) : int {
33
33
  return unpack(reverseBytes(b, 32) + b'00');
34
34
  }
35
- static function checkSHPreimage(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__SHPreimage shPreimage, bytes sigHashType) : Sig {
36
- SigHashPreimage preimage = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils.serializeSHPreimage(shPreimage);
35
+ static function checkSHPreimage(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__SHPreimage shPreimage, bytes sigHashType) : Sig {
36
+ SigHashPreimage preimage = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils.serializeSHPreimage(shPreimage);
37
37
  bytes h = hash256(preimage);
38
- Sig sig = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils.sign(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils.fromBEUnsigned(h), _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils.privKey, 90914631784428570546048907090666684794265392153046400654824470772421497439242, 7252565254521500021189571868467740368187828957595681190666767817830690399852, _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils.rBigEndian, sigHashType);
38
+ Sig sig = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils.sign(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils.fromBEUnsigned(h), _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils.privKey, 90914631784428570546048907090666684794265392153046400654824470772421497439242, 7252565254521500021189571868467740368187828957595681190666767817830690399852, _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils.rBigEndian, sigHashType);
39
39
  return sig;
40
40
  }
41
- static function serializeSHPreimage(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__SHPreimage shPreimage) : SigHashPreimage {
41
+ static function serializeSHPreimage(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__SHPreimage shPreimage) : SigHashPreimage {
42
42
  require(len(shPreimage.nVersion) == 4);
43
43
  require(len(shPreimage.hashPrevouts) == 32);
44
44
  require(len(shPreimage.spentScriptHash) == 32);
@@ -53,41 +53,41 @@ library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils {
53
53
  require(shPreimage.inputIndex >= 0);
54
54
  require(shPreimage.nLockTime >= 0);
55
55
  require(shPreimage.sigHashType == 1 || shPreimage.sigHashType == 2 || shPreimage.sigHashType == 3 || shPreimage.sigHashType == 0x81 || shPreimage.sigHashType == 0x82 || shPreimage.sigHashType == 0x83);
56
- bytes preimage = shPreimage.nVersion + shPreimage.hashPrevouts + shPreimage.spentScriptHash + shPreimage.spentDataHash + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.satoshisToByteString(shPreimage.value) + shPreimage.nSequence + shPreimage.hashSpentAmounts + shPreimage.hashSpentScriptHashes + shPreimage.hashSpentDataHashes + shPreimage.hashSequences + shPreimage.hashOutputs + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.toLEUnsigned(shPreimage.inputIndex, 4) + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.toLEUnsigned(shPreimage.nLockTime, 4) + num2bin(shPreimage.sigHashType, 4);
56
+ bytes preimage = shPreimage.nVersion + shPreimage.hashPrevouts + shPreimage.spentScriptHash + shPreimage.spentDataHash + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.satoshisToByteString(shPreimage.value) + shPreimage.nSequence + shPreimage.hashSpentAmounts + shPreimage.hashSpentScriptHashes + shPreimage.hashSpentDataHashes + shPreimage.hashSequences + shPreimage.hashOutputs + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.toLEUnsigned(shPreimage.inputIndex, 4) + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.toLEUnsigned(shPreimage.nLockTime, 4) + num2bin(shPreimage.sigHashType, 4);
57
57
  return SigHashPreimage(preimage);
58
58
  }
59
- static function checkPrevouts(bytes prevouts, bytes t_hashPrevouts, int t_inputIndex, int t_inputCount) : _opcat_labs_scrypt_ts_opcat_3_2_0__rs__Outpoint {
59
+ static function checkPrevouts(bytes prevouts, bytes t_hashPrevouts, int t_inputIndex, int t_inputCount) : _opcat_labs_scrypt_ts_opcat_3_3_0__rs__Outpoint {
60
60
  require(hash256(prevouts) == t_hashPrevouts);
61
61
  require(t_inputIndex < t_inputCount);
62
- require(t_inputCount == _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.checkLenDivisibleBy(prevouts, 36));
62
+ require(t_inputCount == _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.checkLenDivisibleBy(prevouts, 36));
63
63
  bytes b = prevouts[t_inputIndex * 36 : (t_inputIndex + 1) * 36];
64
- return {b[0 : 32], _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.byteStringToUInt32(b[32 : 36])};
64
+ return {b[0 : 32], _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.byteStringToUInt32(b[32 : 36])};
65
65
  }
66
66
  static function checkSpentScripts(bytes spentScriptHashes, bytes t_hashSpentScripts, int t_inputCount) : bool {
67
67
  require(hash256(spentScriptHashes) == t_hashSpentScripts);
68
- require(t_inputCount == _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.checkLenDivisibleBy(spentScriptHashes, 32));
68
+ require(t_inputCount == _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.checkLenDivisibleBy(spentScriptHashes, 32));
69
69
  return true;
70
70
  }
71
71
  static function checkSpentAmounts(bytes spentAmounts, bytes hashSpentAmounts) : int {
72
72
  require(hash256(spentAmounts) == hashSpentAmounts);
73
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.checkLenDivisibleBy(spentAmounts, 8);
73
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.checkLenDivisibleBy(spentAmounts, 8);
74
74
  }
75
75
  static function checkSpentDataHashes(bytes spentDataHashes, bytes hashSpentDataHashes, int inputCount) : bool {
76
76
  require(hash256(spentDataHashes) == hashSpentDataHashes);
77
- require(inputCount == _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.checkLenDivisibleBy(spentDataHashes, 32));
77
+ require(inputCount == _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.checkLenDivisibleBy(spentDataHashes, 32));
78
78
  return true;
79
79
  }
80
80
  static function getSpentScriptHash(bytes spentScriptHashes, int inputIndex) : bytes {
81
81
  return spentScriptHashes[inputIndex * 32 : (inputIndex + 1) * 32];
82
82
  }
83
83
  static function getSpentAmount(bytes spentAmounts, int inputIndex) : int {
84
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(spentAmounts[inputIndex * 8 : (inputIndex + 1) * 8]);
84
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(spentAmounts[inputIndex * 8 : (inputIndex + 1) * 8]);
85
85
  }
86
86
  static function getSpentDataHash(bytes spentDataHashes, int inputIndex) : bytes {
87
87
  return spentDataHashes[inputIndex * 32 : (inputIndex + 1) * 32];
88
88
  }
89
- static function checknLockTime(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__SHPreimage shPreimage, int nlockTime) : bool {
90
- int nSequence = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(shPreimage.nSequence);
89
+ static function checknLockTime(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__SHPreimage shPreimage, int nlockTime) : bool {
90
+ int nSequence = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(shPreimage.nSequence);
91
91
  return (nSequence < 4294967295 && (nlockTime < 500000000 ? shPreimage.nLockTime < 500000000 : true) && shPreimage.nLockTime >= nlockTime);
92
92
  }
93
93
  }
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
3
 
4
- library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StateUtils {
4
+ library _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StateUtils {
5
5
  static function checkInputState(int t_inputIndex, bytes stateHash, bytes t_spentDataHashes) : bool {
6
6
  require(t_spentDataHashes[t_inputIndex * 32 : (t_inputIndex + 1) * 32] == stateHash);
7
7
  return true;
@@ -1,12 +1,12 @@
1
1
 
2
2
 
3
3
 
4
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ReadVarintResult {
4
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ReadVarintResult {
5
5
  bytes data;
6
6
  int nextPos;
7
7
  }
8
8
 
9
- library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils {
9
+ library _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils {
10
10
  static function checkLenDivisibleBy(bytes b, int n) : int {
11
11
  int l = len(b);
12
12
  require(l % n == 0);
@@ -14,15 +14,15 @@ library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils {
14
14
  }
15
15
  static function uint64ToByteString(int n) : bytes {
16
16
  require(n >= 0 && n <= 18446744073709551615);
17
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.toLEUnsigned(n, 8);
17
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.toLEUnsigned(n, 8);
18
18
  }
19
19
  static function uint32ToByteString(int n) : bytes {
20
20
  require(n >= 0 && n <= 4294967295);
21
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.toLEUnsigned(n, 4);
21
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.toLEUnsigned(n, 4);
22
22
  }
23
23
  static function byteStringToUInt32(bytes b) : int {
24
24
  require(len(b) == 4);
25
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(b);
25
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(b);
26
26
  }
27
27
  static function toLEUnsigned(int n, int l) : bytes {
28
28
  bytes m = num2bin(n, l + 1);
@@ -46,7 +46,7 @@ library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils {
46
46
  b = b'ff';
47
47
  size = 8;
48
48
  }
49
- return b + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.toLEUnsigned(n, size);
49
+ return b + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.toLEUnsigned(n, size);
50
50
  }
51
51
  static function pushData(bytes buf) : bytes {
52
52
  int n = len(buf);
@@ -67,27 +67,27 @@ library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils {
67
67
  } else {
68
68
  require(false);
69
69
  }
70
- return header + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.toLEUnsigned(n, size);
70
+ return header + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.toLEUnsigned(n, size);
71
71
  }
72
- static function readVarint(bytes buf, int pos) : _opcat_labs_scrypt_ts_opcat_3_2_0__rs__ReadVarintResult {
72
+ static function readVarint(bytes buf, int pos) : _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ReadVarintResult {
73
73
  int l = 0;
74
74
  bytes ret = b'';
75
75
  int nextPos = pos;
76
76
  bytes header = buf[pos : pos + 1];
77
77
  if(header == b'fd') {
78
- l = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(buf[pos + 1 : pos + 3]);
78
+ l = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(buf[pos + 1 : pos + 3]);
79
79
  ret = buf[3 : 3 + l];
80
80
  nextPos = pos + 3 + l;
81
81
  } else if(header == b'fe') {
82
- l = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(buf[pos + 1 : pos + 5]);
82
+ l = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(buf[pos + 1 : pos + 5]);
83
83
  ret = buf[pos + 5 : pos + 5 + l];
84
84
  nextPos = pos + 5 + l;
85
85
  } else if(header == b'ff') {
86
- l = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(buf[pos + 1 : pos + 9]);
86
+ l = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(buf[pos + 1 : pos + 9]);
87
87
  ret = buf[pos + 9 : pos + 9 + l];
88
88
  nextPos = pos + 9 + l;
89
89
  } else {
90
- l = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(buf[pos : pos + 1]);
90
+ l = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(buf[pos : pos + 1]);
91
91
  ret = buf[pos + 1 : pos + 1 + l];
92
92
  nextPos = pos + 1 + l;
93
93
  }
@@ -4,17 +4,17 @@ import "stdUtils.scrypt";
4
4
 
5
5
 
6
6
 
7
- library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimageUtils {
8
- static function getTxHashFromTxHashPreimage(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimage txHashPreimage) : bytes {
7
+ library _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimageUtils {
8
+ static function getTxHashFromTxHashPreimage(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimage txHashPreimage) : bytes {
9
9
  require(len(txHashPreimage.version) == 4);
10
- int inputCount = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.checkLenDivisibleBy(txHashPreimage.inputList, 72);
11
- int outputCount = _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.checkLenDivisibleBy(txHashPreimage.outputList, 72);
12
- return hash256(txHashPreimage.version + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.writeVarInt(inputCount) + txHashPreimage.inputList + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.writeVarInt(outputCount) + txHashPreimage.outputList + txHashPreimage.nLockTime);
10
+ int inputCount = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.checkLenDivisibleBy(txHashPreimage.inputList, 72);
11
+ int outputCount = _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.checkLenDivisibleBy(txHashPreimage.outputList, 72);
12
+ return hash256(txHashPreimage.version + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.writeVarInt(inputCount) + txHashPreimage.inputList + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.writeVarInt(outputCount) + txHashPreimage.outputList + txHashPreimage.nLockTime);
13
13
  }
14
- static function getInputByteString(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimage txHashPreimage, int inputIndex) : bytes {
14
+ static function getInputByteString(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimage txHashPreimage, int inputIndex) : bytes {
15
15
  return txHashPreimage.inputList[inputIndex * 72 : (inputIndex + 1) * 72];
16
16
  }
17
- static function getOutputByteString(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimage txHashPreimage, int outputIndex) : bytes {
17
+ static function getOutputByteString(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimage txHashPreimage, int outputIndex) : bytes {
18
18
  return txHashPreimage.outputList[outputIndex * 72 : (outputIndex + 1) * 72];
19
19
  }
20
20
  }
@@ -4,10 +4,10 @@ import "stdUtils.scrypt";
4
4
 
5
5
 
6
6
 
7
- library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils {
7
+ library _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils {
8
8
  static const int ZERO_SATS = 0;
9
9
  static function buildOutput(bytes scriptHash, int satoshis) : bytes {
10
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.buildDataOutput(scriptHash, satoshis, sha256(b''));
10
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.buildDataOutput(scriptHash, satoshis, sha256(b''));
11
11
  }
12
12
  static function buildDataOutput(bytes scriptHash, int satoshis, bytes dataHash) : bytes {
13
13
  int scriptHashLen = len(scriptHash);
@@ -15,34 +15,34 @@ library _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils {
15
15
  require(scriptHashLen == 32);
16
16
  require(dataHashLen == 32);
17
17
  require(satoshis >= 0);
18
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.satoshisToByteString(satoshis) + scriptHash + dataHash;
18
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.satoshisToByteString(satoshis) + scriptHash + dataHash;
19
19
  }
20
- static function buildChangeOutput(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxOut change) : bytes {
21
- return change.satoshis > 0 ? _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.buildDataOutput(change.scriptHash, change.satoshis, change.dataHash) : b'';
20
+ static function buildChangeOutput(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxOut change) : bytes {
21
+ return change.satoshis > 0 ? _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.buildDataOutput(change.scriptHash, change.satoshis, change.dataHash) : b'';
22
22
  }
23
- static function mergeInput(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxIn txInput) : bytes {
23
+ static function mergeInput(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxIn txInput) : bytes {
24
24
  require(len(txInput.prevTxHash) == 32);
25
25
  require(len(txInput.scriptHash) == 32);
26
- return (txInput.prevTxHash + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.uint32ToByteString(txInput.prevOutputIndex) + txInput.scriptHash + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.uint32ToByteString(txInput.sequence));
26
+ return (txInput.prevTxHash + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.uint32ToByteString(txInput.prevOutputIndex) + txInput.scriptHash + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.uint32ToByteString(txInput.sequence));
27
27
  }
28
28
  static function buildOpReturnOutput(bytes data) : bytes {
29
29
  bytes script = b'6a' + pack(len(data)) + data;
30
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.satoshisToByteString(0) + sha256(script) + sha256(b'');
30
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.satoshisToByteString(0) + sha256(script) + sha256(b'');
31
31
  }
32
32
  static function buildP2PKHScript(Ripemd160 addr) : bytes {
33
33
  return (OpCode.OP_DUP + OpCode.OP_HASH160 + pack(20) + addr + OpCode.OP_EQUALVERIFY + OpCode.OP_CHECKSIG);
34
34
  }
35
35
  static function buildP2PKHOutput(int amount, Ripemd160 addr) : bytes {
36
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.buildDataOutput(sha256(_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils.buildP2PKHScript(addr)), amount, sha256(b''));
36
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.buildDataOutput(sha256(_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils.buildP2PKHScript(addr)), amount, sha256(b''));
37
37
  }
38
38
  static function buildOpreturnScript(bytes data) : bytes {
39
- return OpCode.OP_FALSE + OpCode.OP_RETURN + _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.pushData(data);
39
+ return OpCode.OP_FALSE + OpCode.OP_RETURN + _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.pushData(data);
40
40
  }
41
41
  static function satoshisToByteString(int n) : bytes {
42
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.uint64ToByteString(n);
42
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.uint64ToByteString(n);
43
43
  }
44
44
  static function byteStringToSatoshis(bytes bs) : int {
45
45
  require(len(bs) == 8);
46
- return _opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils.fromLEUnsigned(bs);
46
+ return _opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils.fromLEUnsigned(bs);
47
47
  }
48
48
  }
@@ -1,33 +1,33 @@
1
1
 
2
2
 
3
3
 
4
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxOut {
4
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxOut {
5
5
  bytes scriptHash;
6
6
  bytes dataHash;
7
7
  int satoshis;
8
8
  }
9
9
 
10
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxIn {
10
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxIn {
11
11
  bytes prevTxHash;
12
12
  int prevOutputIndex;
13
13
  int sequence;
14
14
  bytes scriptHash;
15
15
  }
16
16
 
17
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimage {
17
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimage {
18
18
  bytes version;
19
19
  bytes inputList;
20
20
  bytes outputList;
21
21
  bytes nLockTime;
22
22
  }
23
23
 
24
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__BacktraceInfo {
25
- _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxIn prevTxInput;
24
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__BacktraceInfo {
25
+ _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxIn prevTxInput;
26
26
  int prevTxInputIndex;
27
- _opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxHashPreimage prevPrevTxPreimage;
27
+ _opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimage prevPrevTxPreimage;
28
28
  }
29
29
 
30
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__SHPreimage {
30
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__SHPreimage {
31
31
  bytes nVersion;
32
32
  bytes hashPrevouts;
33
33
  bytes spentScriptHash;
@@ -44,7 +44,13 @@ struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__SHPreimage {
44
44
  int sigHashType;
45
45
  }
46
46
 
47
- struct _opcat_labs_scrypt_ts_opcat_3_2_0__rs__Outpoint {
47
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__Outpoint {
48
48
  bytes txHash;
49
49
  int outputIndex;
50
- }
50
+ }
51
+
52
+ struct _opcat_labs_scrypt_ts_opcat_3_3_0__rs__ChangeInfo {
53
+ Ripemd160 pubkeyhash;
54
+ int satoshis;
55
+ Sha256 dataHash;
56
+ }
@@ -5,7 +5,7 @@
5
5
  "md5": "d41d8cd98f00b204e9800998ecf8427e",
6
6
  "structs": [
7
7
  {
8
- "name": "_opcat_labs_cat_sdk_3_2_0__rs__CAT20ContractUnlockArgs",
8
+ "name": "_opcat_labs_cat_sdk_3_3_0__rs__CAT20ContractUnlockArgs",
9
9
  "params": [
10
10
  {
11
11
  "name": "spendType",
@@ -27,7 +27,7 @@
27
27
  "genericTypes": []
28
28
  },
29
29
  {
30
- "name": "_opcat_labs_cat_sdk_3_2_0__rs__CAT721ContractUnlockArgs",
30
+ "name": "_opcat_labs_cat_sdk_3_3_0__rs__CAT721ContractUnlockArgs",
31
31
  "params": [
32
32
  {
33
33
  "name": "userPubKey",
@@ -1,14 +1,14 @@
1
1
 
2
2
 
3
3
 
4
- struct _opcat_labs_cat_sdk_3_2_0__rs__CAT20ContractUnlockArgs {
4
+ struct _opcat_labs_cat_sdk_3_3_0__rs__CAT20ContractUnlockArgs {
5
5
  int spendType;
6
6
  PubKey userPubKey;
7
7
  Sig userSig;
8
8
  int spendScriptInputIndex;
9
9
  }
10
10
 
11
- struct _opcat_labs_cat_sdk_3_2_0__rs__CAT721ContractUnlockArgs {
11
+ struct _opcat_labs_cat_sdk_3_3_0__rs__CAT721ContractUnlockArgs {
12
12
  PubKey userPubKey;
13
13
  Sig userSig;
14
14
  int contractInputIndex;
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 10,
3
3
  "compilerVersion": "1.22.0+commit.47800da",
4
- "contract": "_opcat_labs_cat_sdk_3_2_0__rs__OwnerUtils",
4
+ "contract": "_opcat_labs_cat_sdk_3_3_0__rs__OwnerUtils",
5
5
  "md5": "d41d8cd98f00b204e9800998ecf8427e",
6
6
  "structs": [
7
7
  {
8
- "name": "_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxOut",
8
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__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_3_2_0__rs__TxIn",
26
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__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_3_2_0__rs__TxHashPreimage",
48
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__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_3_2_0__rs__BacktraceInfo",
70
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__BacktraceInfo",
71
71
  "params": [
72
72
  {
73
73
  "name": "prevTxInput",
74
- "type": "_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxIn"
74
+ "type": "_opcat_labs_scrypt_ts_opcat_3_3_0__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_3_2_0__rs__TxHashPreimage"
82
+ "type": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxHashPreimage"
83
83
  }
84
84
  ],
85
85
  "genericTypes": []
86
86
  },
87
87
  {
88
- "name": "_opcat_labs_scrypt_ts_opcat_3_2_0__rs__SHPreimage",
88
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__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_3_2_0__rs__Outpoint",
150
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__Outpoint",
151
151
  "params": [
152
152
  {
153
153
  "name": "txHash",
@@ -161,7 +161,25 @@
161
161
  "genericTypes": []
162
162
  },
163
163
  {
164
- "name": "_opcat_labs_scrypt_ts_opcat_3_2_0__rs__ReadVarintResult",
164
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__ChangeInfo",
165
+ "params": [
166
+ {
167
+ "name": "pubkeyhash",
168
+ "type": "Ripemd160"
169
+ },
170
+ {
171
+ "name": "satoshis",
172
+ "type": "int"
173
+ },
174
+ {
175
+ "name": "dataHash",
176
+ "type": "Sha256"
177
+ }
178
+ ],
179
+ "genericTypes": []
180
+ },
181
+ {
182
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__ReadVarintResult",
165
183
  "params": [
166
184
  {
167
185
  "name": "data",
@@ -177,25 +195,25 @@
177
195
  ],
178
196
  "library": [
179
197
  {
180
- "name": "_opcat_labs_cat_sdk_3_2_0__rs__OwnerUtils",
198
+ "name": "_opcat_labs_cat_sdk_3_3_0__rs__OwnerUtils",
181
199
  "params": [],
182
200
  "properties": [],
183
201
  "genericTypes": []
184
202
  },
185
203
  {
186
- "name": "_opcat_labs_scrypt_ts_opcat_3_2_0__rs__TxUtils",
204
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__TxUtils",
187
205
  "params": [],
188
206
  "properties": [],
189
207
  "genericTypes": []
190
208
  },
191
209
  {
192
- "name": "_opcat_labs_scrypt_ts_opcat_3_2_0__rs__ContextUtils",
210
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__ContextUtils",
193
211
  "params": [],
194
212
  "properties": [],
195
213
  "genericTypes": []
196
214
  },
197
215
  {
198
- "name": "_opcat_labs_scrypt_ts_opcat_3_2_0__rs__StdUtils",
216
+ "name": "_opcat_labs_scrypt_ts_opcat_3_3_0__rs__StdUtils",
199
217
  "params": [],
200
218
  "properties": [],
201
219
  "genericTypes": []
@@ -4,17 +4,17 @@ import "../scrypt-ts-opcat/assets/smart-contract/builtin-libs/contextUtils.scryp
4
4
 
5
5
 
6
6
 
7
- library _opcat_labs_cat_sdk_3_2_0__rs__OwnerUtils {
7
+ library _opcat_labs_cat_sdk_3_3_0__rs__OwnerUtils {
8
8
  static function pubKeyHashtoLockingScript(bytes pubKeyHash) : bytes {
9
9
  require(len(pubKeyHash) == 20);
10
10
  return b'76a914' + pubKeyHash + b'88ac';
11
11
  }
12
12
  static function toLockingScript(bytes pubKey) : bytes {
13
- _opcat_labs_cat_sdk_3_2_0__rs__OwnerUtils.checkPubKey(pubKey);
13
+ _opcat_labs_cat_sdk_3_3_0__rs__OwnerUtils.checkPubKey(pubKey);
14
14
  return b'76a914' + hash160(pubKey) + b'88ac';
15
15
  }
16
16
  static function checkUserOwner(bytes pubKey, bytes ownerAddr) : bool {
17
- require(_opcat_labs_cat_sdk_3_2_0__rs__OwnerUtils.toLockingScript(pubKey) == ownerAddr);
17
+ require(_opcat_labs_cat_sdk_3_3_0__rs__OwnerUtils.toLockingScript(pubKey) == ownerAddr);
18
18
  return true;
19
19
  }
20
20
  static function checkPubKey(bytes pubKey) : bool {