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