tx · 3Ccit2mVkhPqhHME6ko2beUCHby8kaimUVNHFjCDZJnK 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh: -0.01000000 Waves 2023.04.18 11:30 [2539755] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves
{ "type": 13, "id": "3Ccit2mVkhPqhHME6ko2beUCHby8kaimUVNHFjCDZJnK", "fee": 1000000, "feeAssetId": null, "timestamp": 1681806648457, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "4YWDsgkuWZB2tKbJyEfCA3QZidNhUGjMEy77C54qceJ1Q537TdgHcgt9bi8GTzdQNALb5a32yC5PjxTPqU5U15oU" ], "script": "base64:BgICCAIPAANTRVACAl9fABBjb250cmFjdEZpbGVuYW1lAgl0ZXN0LnJpZGUBEGtleVB1YmxpY0tleUxpc3QACQC5CQIJAMwIAgICJXMJAMwIAgIVbXVsdGlzaWdQdWJsaWNLZXlMaXN0BQNuaWwFA1NFUAEIdGhyb3dFcnIBAXMJAAIBCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBHGdldE11bHRpc2lnUHViS2V5c0xpc3RPclVuaXQABBJyYXdNdWx0aXNpZ1B1YktleXMJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwkBEGtleVB1YmxpY0tleUxpc3QAAgAJALUJAgUScmF3TXVsdGlzaWdQdWJLZXlzBQNTRVABDXZhbGlkYXRlUHJvb2YDCXB1YmxpY0tleQVwcm9vZglib2R5Qnl0ZXMDCQAAAgUJcHVibGljS2V5BQVwcm9vZgABAAABDWNvbXBhcmVIZWxwZXICA2xzdAVwcm9vZgQJJHQwNjQ2Njg3BQNsc3QEB3Jlc3VsdHMIBQkkdDA2NDY2ODcCXzEECXB1YmxpY0tleQgFCSR0MDY0N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QCVCgMFA25pbAUKcHJvb2ZzTGlzdAUJYm9keUJ5dGVzCgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJARFjb21wYXJlTGlzdEhlbHBlcgIFAiRhCQCRAwIFAiRsBQIkaQoBBSRmMF8yAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQACAQIUTGlzdCBzaXplIGV4Y2VlZHMgMTAJAQUkZjBfMgIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgQEbm9ybQkBCW5vcm1pbGl6ZQEIBQdyYXdMaXN0Al8xBQRub3JtAQR0ZXN0AAQKcHJvb2ZzTGlzdAkAzAgCAQJ4VwkAzAgCAQMbQ78FA25pbAQOcHVibGljS2V5c0xpc3QJAMwIAgECeFcJAMwIAgECeFcJAMwIAgEDG0O/CQDMCAIBBAYtWU8JAMwIAgEDG0O/BQNuaWwECWJvZHlCeXRlcwEDG0O/BAFiCQEPdmFsaWRQcm9vZkNvdW50AwUOcHVibGljS2V5c0xpc3QFCnByb29mc0xpc3QFCWJvZHlCeXRlcwkAlAoCCQEHc3VtTGlzdAEFAWIFAWIAAKCljd8=", "height": 2539755, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: qvFXR9FbxCFRfpfaaETcqyPSV5TC78F9L9skvACKDk9 Next: g9EppYougCkRqymBuioic1trHhoW1t4oyaXE6KjtoTw Diff:
Old | New | Differences | |
---|---|---|---|
117 | 117 | ||
118 | 118 | ||
119 | 119 | func test () = { | |
120 | - | let | |
121 | - | let | |
120 | + | let proofsList = [base58'AAA', base58'AAAA'] | |
121 | + | let publicKeysList = [base58'AAA', base58'AAA', base58'AAAA', base58'AAAAA', base58'AAAA'] | |
122 | 122 | let bodyBytes = base58'AAAA' | |
123 | 123 | let b = validProofCount(publicKeysList, proofsList, bodyBytes) | |
124 | 124 | $Tuple2(sumList(b), b) |
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 getMultisigPubKeysListOrUnit () = { | |
15 | 15 | let rawMultisigPubKeys = valueOrElse(getString(this, keyPublicKeyList()), "") | |
16 | 16 | split(rawMultisigPubKeys, SEP) | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func validateProof (publicKey,proof,bodyBytes) = if ((publicKey == proof)) | |
21 | 21 | then 1 | |
22 | 22 | else 0 | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func compareHelper (lst,proof) = { | |
26 | 26 | let $t0646687 = lst | |
27 | 27 | let results = $t0646687._1 | |
28 | 28 | let publicKey = $t0646687._2 | |
29 | 29 | let bodyBytes = $t0646687._3 | |
30 | 30 | $Tuple3((results :+ validateProof(publicKey, proof, bodyBytes)), publicKey, bodyBytes) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func compare (proofsList,publicKey,bodyBytes) = { | |
35 | 35 | let $l = proofsList | |
36 | 36 | let $s = size($l) | |
37 | 37 | let $acc0 = $Tuple3(nil, publicKey, bodyBytes) | |
38 | 38 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
39 | 39 | then $a | |
40 | 40 | else compareHelper($a, $l[$i]) | |
41 | 41 | ||
42 | 42 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
43 | 43 | then $a | |
44 | 44 | else throw("List size exceeds 10") | |
45 | 45 | ||
46 | 46 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func accum (sum,val) = (sum + val) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func sumList (list) = { | |
54 | 54 | let $l = list | |
55 | 55 | let $s = size($l) | |
56 | 56 | let $acc0 = 0 | |
57 | 57 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
58 | 58 | then $a | |
59 | 59 | else accum($a, $l[$i]) | |
60 | 60 | ||
61 | 61 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
62 | 62 | then $a | |
63 | 63 | else throw("List size exceeds 10") | |
64 | 64 | ||
65 | 65 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func compareListHelper (proofs,publicKey) = { | |
70 | 70 | let $t011511196 = proofs | |
71 | 71 | let results = $t011511196._1 | |
72 | 72 | let proofsList = $t011511196._2 | |
73 | 73 | let bodyBytes = $t011511196._3 | |
74 | 74 | let compareList = compare(proofsList, publicKey, bodyBytes)._1 | |
75 | 75 | let sum = sumList(compareList) | |
76 | 76 | $Tuple3((results :+ sum), proofsList, bodyBytes) | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func normilizeHelper (results,next) = (results :+ min([1, next])) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func normilize (results) = { | |
84 | 84 | let $l = results | |
85 | 85 | let $s = size($l) | |
86 | 86 | let $acc0 = nil | |
87 | 87 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
88 | 88 | then $a | |
89 | 89 | else normilizeHelper($a, $l[$i]) | |
90 | 90 | ||
91 | 91 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
92 | 92 | then $a | |
93 | 93 | else throw("List size exceeds 10") | |
94 | 94 | ||
95 | 95 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func validProofCount (publicKeysList,proofsList,bodyBytes) = { | |
100 | 100 | let rawList = { | |
101 | 101 | let $l = publicKeysList | |
102 | 102 | let $s = size($l) | |
103 | 103 | let $acc0 = $Tuple3(nil, proofsList, bodyBytes) | |
104 | 104 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
105 | 105 | then $a | |
106 | 106 | else compareListHelper($a, $l[$i]) | |
107 | 107 | ||
108 | 108 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
109 | 109 | then $a | |
110 | 110 | else throw("List size exceeds 10") | |
111 | 111 | ||
112 | 112 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
113 | 113 | } | |
114 | 114 | let norm = normilize(rawList._1) | |
115 | 115 | norm | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func test () = { | |
120 | - | let | |
121 | - | let | |
120 | + | let proofsList = [base58'AAA', base58'AAAA'] | |
121 | + | let publicKeysList = [base58'AAA', base58'AAA', base58'AAAA', base58'AAAAA', base58'AAAA'] | |
122 | 122 | let bodyBytes = base58'AAAA' | |
123 | 123 | let b = validProofCount(publicKeysList, proofsList, bodyBytes) | |
124 | 124 | $Tuple2(sumList(b), b) | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 |
github/deemru/w8io/026f985 27.70 ms ◑