tx · FssQmkuRz22Yy3oADxDj7YEfp5Pxh4ZnwGZGmfJQ1Ri2 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh: -0.01000000 Waves 2023.04.18 12:17 [2539801] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves
{ "type": 13, "id": "FssQmkuRz22Yy3oADxDj7YEfp5Pxh4ZnwGZGmfJQ1Ri2", "fee": 1000000, "feeAssetId": null, "timestamp": 1681809494956, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "2qL9Q41EbnixRwW85ETfzNAaWo7he2BKRe4CtPqrFhcPWdBnBh3qGMvLE1Jmk5BMikjN2k3iGULvBNjqTtUEyNJH" ], "script": "base64:BgIECAISABAAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCCXRlc3QucmlkZQEQa2V5UHVibGljS2V5TGlzdAAJALkJAgkAzAgCAgIlcwkAzAgCAhVtdWx0aXNpZ1B1YmxpY0tleUxpc3QFA25pbAUDU0VQAQh0aHJvd0VycgEBcwkAAgEJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwETcHViS2V5U3RyaW5nVG9CeXRlcwIGcmVzdWx0DHB1YktleVN0cmluZwkAzQgCBQZyZXN1bHQJANkEAQUMcHViS2V5U3RyaW5nARZnZXRNdWx0aXNpZ1B1YktleXNMaXN0AAQScmF3TXVsdGlzaWdQdWJLZXlzCQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMJARBrZXlQdWJsaWNLZXlMaXN0AAIACQC1CQIFEnJhd011bHRpc2lnUHViS2V5cwUDU0VQAR5nZXRQdXRibGljS2V5c0FzQnl0ZVZlY3Rvckxpc3QABA5yYXdQdWJLZXlzTGlzdAkBFmdldE11bHRpc2lnUHViS2V5c0xpc3QACgACJGwFDnJ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ZWVkcyAzCQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAQ92YWxpZFByb29mQ291bnQDDnB1YmxpY0tleXNMaXN0CnByb29mc0xpc3QJYm9keUJ5dGVzBAdyYXdMaXN0CgACJGwFDnB1YmxpY0tleXNMaXN0CgACJHMJAJADAQUCJGwKAAUkYWNjMAkAlQoDBQNuaWwFCnByb29mc0xpc3QFCWJvZHlCeXRlcwoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQERY29tcGFyZUxpc3RIZWxwZXICBQIkYQkAkQMCBQIkbAUCJGkKAQUkZjBfMgICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkAAgECE0xpc3Qgc2l6ZSBleGNlZWRzIDMJAQUkZjBfMgIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMEBG5vcm0JAQlub3JtaWxpemUBCAUHcmF3TGlzdAJfMQkBB3N1bUxpc3QBBQRub3JtAQFpAQR0ZXN0AAUDbmlsAQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAXMFByRtYXRjaDAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkECnByb29mc0xpc3QIBQJ0eAZwcm9vZnMEDnB1YmxpY0tleXNMaXN0CQEeZ2V0UHV0YmxpY0tleXNBc0J5dGVWZWN0b3JMaXN0AAkAAgEJAKQDAQkAkAMBBQpwcm9vZnNMaXN0HhQkdg==", "height": 2539801, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HpTrwcrNgEG3TbjNBu9ut76Lfh6aQeJhexhBUNQ8Povb Next: 9282MN2U9tmBZha3kQ8RnJYBMS5k2GyDrivU8tRS34u8 Diff:
Old | New | Differences | |
---|---|---|---|
147 | 147 | case _ => | |
148 | 148 | let proofsList = tx.proofs | |
149 | 149 | let publicKeysList = getPutblicKeysAsByteVectorList() | |
150 | - | ( | |
150 | + | throw(toString(size(proofsList))) | |
151 | 151 | } | |
152 | 152 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let contractFilename = "test.ride" | |
7 | 7 | ||
8 | 8 | func keyPublicKeyList () = makeString(["%s", "multisigPublicKeyList"], SEP) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func throwErr (s) = throw(((contractFilename + ": ") + s)) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func pubKeyStringToBytes (result,pubKeyString) = (result :+ fromBase58String(pubKeyString)) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getMultisigPubKeysList () = { | |
18 | 18 | let rawMultisigPubKeys = valueOrElse(getString(this, keyPublicKeyList()), "") | |
19 | 19 | split(rawMultisigPubKeys, SEP) | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getPutblicKeysAsByteVectorList () = { | |
24 | 24 | let rawPubKeysList = getMultisigPubKeysList() | |
25 | 25 | let $l = rawPubKeysList | |
26 | 26 | let $s = size($l) | |
27 | 27 | let $acc0 = nil | |
28 | 28 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
29 | 29 | then $a | |
30 | 30 | else pubKeyStringToBytes($a, $l[$i]) | |
31 | 31 | ||
32 | 32 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
33 | 33 | then $a | |
34 | 34 | else throw("List size exceeds 3") | |
35 | 35 | ||
36 | 36 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func validateProof (publicKey,proof,bodyBytes) = if (sigVerify(bodyBytes, proof, publicKey)) | |
41 | 41 | then 1 | |
42 | 42 | else 0 | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func compareHelper (lst,proof) = { | |
46 | 46 | let $t0927968 = lst | |
47 | 47 | let results = $t0927968._1 | |
48 | 48 | let publicKey = $t0927968._2 | |
49 | 49 | let bodyBytes = $t0927968._3 | |
50 | 50 | $Tuple3((results :+ validateProof(publicKey, proof, bodyBytes)), publicKey, bodyBytes) | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func compare (proofsList,publicKey,bodyBytes) = { | |
55 | 55 | let $l = proofsList | |
56 | 56 | let $s = size($l) | |
57 | 57 | let $acc0 = $Tuple3(nil, publicKey, bodyBytes) | |
58 | 58 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
59 | 59 | then $a | |
60 | 60 | else compareHelper($a, $l[$i]) | |
61 | 61 | ||
62 | 62 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
63 | 63 | then $a | |
64 | 64 | else throw("List size exceeds 3") | |
65 | 65 | ||
66 | 66 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func accum (sum,val) = (sum + val) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func sumList (list) = { | |
74 | 74 | let $l = list | |
75 | 75 | let $s = size($l) | |
76 | 76 | let $acc0 = 0 | |
77 | 77 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
78 | 78 | then $a | |
79 | 79 | else accum($a, $l[$i]) | |
80 | 80 | ||
81 | 81 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
82 | 82 | then $a | |
83 | 83 | else throw("List size exceeds 3") | |
84 | 84 | ||
85 | 85 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func compareListHelper (proofs,publicKey) = { | |
90 | 90 | let $t014301475 = proofs | |
91 | 91 | let results = $t014301475._1 | |
92 | 92 | let proofsList = $t014301475._2 | |
93 | 93 | let bodyBytes = $t014301475._3 | |
94 | 94 | let compareList = compare(proofsList, publicKey, bodyBytes)._1 | |
95 | 95 | let sum = sumList(compareList) | |
96 | 96 | $Tuple3((results :+ sum), proofsList, bodyBytes) | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func normilizeHelper (results,next) = (results :+ min([1, next])) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func normilize (results) = { | |
104 | 104 | let $l = results | |
105 | 105 | let $s = size($l) | |
106 | 106 | let $acc0 = nil | |
107 | 107 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
108 | 108 | then $a | |
109 | 109 | else normilizeHelper($a, $l[$i]) | |
110 | 110 | ||
111 | 111 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
112 | 112 | then $a | |
113 | 113 | else throw("List size exceeds 3") | |
114 | 114 | ||
115 | 115 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func validProofCount (publicKeysList,proofsList,bodyBytes) = { | |
120 | 120 | let rawList = { | |
121 | 121 | let $l = publicKeysList | |
122 | 122 | let $s = size($l) | |
123 | 123 | let $acc0 = $Tuple3(nil, proofsList, bodyBytes) | |
124 | 124 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
125 | 125 | then $a | |
126 | 126 | else compareListHelper($a, $l[$i]) | |
127 | 127 | ||
128 | 128 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
129 | 129 | then $a | |
130 | 130 | else throw("List size exceeds 3") | |
131 | 131 | ||
132 | 132 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
133 | 133 | } | |
134 | 134 | let norm = normilize(rawList._1) | |
135 | 135 | sumList(norm) | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(i) | |
140 | 140 | func test () = nil | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | @Verifier(tx) | |
144 | 144 | func verify () = match tx { | |
145 | 145 | case s: SetScriptTransaction => | |
146 | 146 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
147 | 147 | case _ => | |
148 | 148 | let proofsList = tx.proofs | |
149 | 149 | let publicKeysList = getPutblicKeysAsByteVectorList() | |
150 | - | ( | |
150 | + | throw(toString(size(proofsList))) | |
151 | 151 | } | |
152 | 152 |
github/deemru/w8io/026f985 37.10 ms ◑