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:BgICCAIPAANTRVACAl9fABBjb250cmFjdEZpbGVuYW1lAgl0ZXN0LnJpZGUBEGtleVB1YmxpY0tleUxpc3QACQC5CQIJAMwIAgICJXMJAMwIAgIVbXVsdGlzaWdQdWJsaWNLZXlMaXN0BQNuaWwFA1NFUAEIdGhyb3dFcnIBAXMJAAIBCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBHGdldE11bHRpc2lnUHViS2V5c0xpc3RPclVuaXQABBJyYXdNdWx0aXNpZ1B1YktleXMJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwkBEGtleVB1YmxpY0tleUxpc3QAAgAJALUJAgUScmF3TXVsdGlzaWdQdWJLZXlzBQNTRVABDXZhbGlkYXRlUHJvb2YDCXB1YmxpY0tleQVwcm9vZglib2R5Qnl0ZXMDCQAAAgUJcHVibGljS2V5BQVwcm9vZgABAAABDWNvbXBhcmVIZWxwZXICA2xzdAVwcm9vZgQJJHQwNjQ2Njg3BQNsc3QEB3Jlc3VsdHMIBQkkdDA2NDY2ODcCXzEECXB1YmxpY0tleQgFCSR0MDY0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CQCVCgMFA25pbAUKcHJvb2ZzTGlzdAUJYm9keUJ5dGVzCgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJARFjb21wYXJlTGlzdEhlbHBlcgIFAiRhCQCRAwIFAiRsBQIkaQoBBSRmMF8yAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQACAQIUTGlzdCBzaXplIGV4Y2VlZHMgMTAJAQUkZjBfMgIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgQEbm9ybQkBCW5vcm1pbGl6ZQEIBQdyYXdMaXN0Al8xBQRub3JtAQR0ZXN0AAQOcHVibGljS2V5c0xpc3QJAMwIAgECeFcJAMwIAgEDG0O/BQNuaWwECnByb29mc0xpc3QJAMwIAgECeFcJAMwIAgECeFcJAMwIAgEDG0O/CQDMCAIBBAYtWU8JAMwIAgEDG0O/BQNuaWwECWJvZHlCeXRlcwEDG0O/BAFiCQEPdmFsaWRQcm9vZkNvdW50AwUOcHVibGljS2V5c0xpc3QFCnByb29mc0xpc3QFCWJvZHlCeXRlcwkAlAoCCQEHc3VtTGlzdAEFAWIFAWIAACeysBY=", "height": 2539754, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GXNaQKdX1CYAD5uu4mpVTVcGGPHzXAK83PbJSP12rHxU Next: 3Ccit2mVkhPqhHME6ko2beUCHby8kaimUVNHFjCDZJnK Diff:
OldNewDifferences
1717 }
1818
1919
20-func compareFunction (a,b) = if ((a == b))
20+func validateProof (publicKey,proof,bodyBytes) = if ((publicKey == proof))
2121 then 1
2222 else 0
2323
2424
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)
3031 }
3132
3233
33-func compare (list,a) = {
34- let $l = list
34+func compare (proofsList,publicKey,bodyBytes) = {
35+ let $l = proofsList
3536 let $s = size($l)
36- let $acc0 = $Tuple2(nil, a)
37+ let $acc0 = $Tuple3(nil, publicKey, bodyBytes)
3738 func $f0_1 ($a,$i) = if (($i >= $s))
3839 then $a
3940 else compareHelper($a, $l[$i])
6566 }
6667
6768
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
7375 let sum = sumList(compareList)
74- $Tuple2((result :+ sum), lst)
76+ $Tuple3((results :+ sum), proofsList, bodyBytes)
7577 }
7678
7779
78-func normilizeHelper (list,next) = (list :+ min([1, next]))
80+func normilizeHelper (results,next) = (results :+ min([1, next]))
7981
8082
81-func normilize (list) = {
82- let $l = list
83+func normilize (results) = {
84+ let $l = results
8385 let $s = size($l)
8486 let $acc0 = nil
8587 func $f0_1 ($a,$i) = if (($i >= $s))
9496 }
9597
9698
97-func listList (list1,list2) = {
98- let a = {
99- let $l = list1
99+func validProofCount (publicKeysList,proofsList,bodyBytes) = {
100+ let rawList = {
101+ let $l = publicKeysList
100102 let $s = size($l)
101- let $acc0 = $Tuple2(nil, list2)
103+ let $acc0 = $Tuple3(nil, proofsList, bodyBytes)
102104 func $f0_1 ($a,$i) = if (($i >= $s))
103105 then $a
104106 else compareListHelper($a, $l[$i])
109111
110112 $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)
111113 }
112- normilize(a._1)
114+ let norm = normilize(rawList._1)
115+ norm
113116 }
114117
115118
116119 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)
120124 $Tuple2(sumList(b), b)
121125 }
122126
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let contractFilename = "test.ride"
77
88 func keyPublicKeyList () = makeString(["%s", "multisigPublicKeyList"], SEP)
99
1010
1111 func throwErr (s) = throw(((contractFilename + ": ") + s))
1212
1313
1414 func getMultisigPubKeysListOrUnit () = {
1515 let rawMultisigPubKeys = valueOrElse(getString(this, keyPublicKeyList()), "")
1616 split(rawMultisigPubKeys, SEP)
1717 }
1818
1919
20-func compareFunction (a,b) = if ((a == b))
20+func validateProof (publicKey,proof,bodyBytes) = if ((publicKey == proof))
2121 then 1
2222 else 0
2323
2424
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)
3031 }
3132
3233
33-func compare (list,a) = {
34- let $l = list
34+func compare (proofsList,publicKey,bodyBytes) = {
35+ let $l = proofsList
3536 let $s = size($l)
36- let $acc0 = $Tuple2(nil, a)
37+ let $acc0 = $Tuple3(nil, publicKey, bodyBytes)
3738 func $f0_1 ($a,$i) = if (($i >= $s))
3839 then $a
3940 else compareHelper($a, $l[$i])
4041
4142 func $f0_2 ($a,$i) = if (($i >= $s))
4243 then $a
4344 else throw("List size exceeds 10")
4445
4546 $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)
4647 }
4748
4849
4950 func accum (sum,val) = (sum + val)
5051
5152
5253 func sumList (list) = {
5354 let $l = list
5455 let $s = size($l)
5556 let $acc0 = 0
5657 func $f0_1 ($a,$i) = if (($i >= $s))
5758 then $a
5859 else accum($a, $l[$i])
5960
6061 func $f0_2 ($a,$i) = if (($i >= $s))
6162 then $a
6263 else throw("List size exceeds 10")
6364
6465 $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)
6566 }
6667
6768
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
7375 let sum = sumList(compareList)
74- $Tuple2((result :+ sum), lst)
76+ $Tuple3((results :+ sum), proofsList, bodyBytes)
7577 }
7678
7779
78-func normilizeHelper (list,next) = (list :+ min([1, next]))
80+func normilizeHelper (results,next) = (results :+ min([1, next]))
7981
8082
81-func normilize (list) = {
82- let $l = list
83+func normilize (results) = {
84+ let $l = results
8385 let $s = size($l)
8486 let $acc0 = nil
8587 func $f0_1 ($a,$i) = if (($i >= $s))
8688 then $a
8789 else normilizeHelper($a, $l[$i])
8890
8991 func $f0_2 ($a,$i) = if (($i >= $s))
9092 then $a
9193 else throw("List size exceeds 10")
9294
9395 $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)
9496 }
9597
9698
97-func listList (list1,list2) = {
98- let a = {
99- let $l = list1
99+func validProofCount (publicKeysList,proofsList,bodyBytes) = {
100+ let rawList = {
101+ let $l = publicKeysList
100102 let $s = size($l)
101- let $acc0 = $Tuple2(nil, list2)
103+ let $acc0 = $Tuple3(nil, proofsList, bodyBytes)
102104 func $f0_1 ($a,$i) = if (($i >= $s))
103105 then $a
104106 else compareListHelper($a, $l[$i])
105107
106108 func $f0_2 ($a,$i) = if (($i >= $s))
107109 then $a
108110 else throw("List size exceeds 10")
109111
110112 $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)
111113 }
112- normilize(a._1)
114+ let norm = normilize(rawList._1)
115+ norm
113116 }
114117
115118
116119 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)
120124 $Tuple2(sumList(b), b)
121125 }
122126
123127
124128

github/deemru/w8io/026f985 
32.38 ms