tx · 9282MN2U9tmBZha3kQ8RnJYBMS5k2GyDrivU8tRS34u8

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.04.18 12:27 [2539810] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "9282MN2U9tmBZha3kQ8RnJYBMS5k2GyDrivU8tRS34u8", "fee": 1000000, "feeAssetId": null, "timestamp": 1681810060812, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "67o4V5EMcoeMeF1UJJ7HSPyzqr5sEJMHrqfd6bPs4eGGqqecbg6S4TX7Pqpj8hjmSMMxFUgExJJ1UE2S3SVFT7oK" ], "script": "base64:BgIECAISABIAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCCXRlc3QucmlkZQEQa2V5UHVibGljS2V5TGlzdAAJALkJAgkAzAgCAgIlcwkAzAgCAhVtdWx0aXNpZ1B1YmxpY0tleUxpc3QFA25pbAUDU0VQAQh0aHJvd0VycgEBcwkAAgEJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwETcHViS2V5U3RyaW5nVG9CeXRlcwIGcmVzdWx0DHB1YktleVN0cmluZwkAzQgCBQZyZXN1bHQJANkEAQUMcHViS2V5U3RyaW5nARZnZXRNdWx0aXNpZ1B1YktleXNMaXN0AAQScmF3TXVsdGlzaWdQdWJLZXlzCQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMJARBrZXlQdWJsaWNLZXlMaXN0AAIACQC1CQIFEnJhd011bHRpc2lnUHViS2V5cwUDU0VQAR5nZXRQdXRibGljS2V5c0FzQnl0ZVZlY3Rvckxpc3QABA5yYXdQdWJLZXlzTGlzdAkBFmdldE11bHRpc2lnUHViS2V5c0xpc3QACgACJGwFDnJhd1B1Y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0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAXMFByRtYXRjaDAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkECnByb29mc0xpc3QJAQ9maWx0ZXJQcm9vZkxpc3QBCAUCdHgGcHJvb2ZzBA5wdWJsaWNLZXlzTGlzdAkBHmdldFB1dGJsaWNLZXlzQXNCeXRlVmVjdG9yTGlzdAAJAGYCCQEPdmFsaWRQcm9vZkNvdW50AwUOcHVibGljS2V5c0xpc3QFCnByb29mc0xpc3QIBQJ0eAlib2R5Qnl0ZXMAAODqSoY=", "height": 2539810, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FssQmkuRz22Yy3oADxDj7YEfp5Pxh4ZnwGZGmfJQ1Ri2 Next: 4RVQyaykC1p69SkvskeQPMW3Adudx1kM9scsdxQG6XsU Diff:
OldNewDifferences
136136 }
137137
138138
139+func filterProof (result,next) = if ((next != base58''))
140+ then (result :+ next)
141+ else result
142+
143+
144+func filterProofList (proofs) = {
145+ let $l = proofs
146+ let $s = size($l)
147+ let $acc0 = nil
148+ func $f0_1 ($a,$i) = if (($i >= $s))
149+ then $a
150+ else filterProof($a, $l[$i])
151+
152+ func $f0_2 ($a,$i) = if (($i >= $s))
153+ then $a
154+ else throw("List size exceeds 8")
155+
156+ $f0_2($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)
157+ }
158+
159+
139160 @Callable(i)
140161 func test () = nil
141162
145166 case s: SetScriptTransaction =>
146167 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
147168 case _ =>
148- let proofsList = tx.proofs
169+ let proofsList = filterProofList(tx.proofs)
149170 let publicKeysList = getPutblicKeysAsByteVectorList()
150- throw(toString(size(proofsList)))
171+ (validProofCount(publicKeysList, proofsList, tx.bodyBytes) > 0)
151172 }
152173
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 pubKeyStringToBytes (result,pubKeyString) = (result :+ fromBase58String(pubKeyString))
1515
1616
1717 func getMultisigPubKeysList () = {
1818 let rawMultisigPubKeys = valueOrElse(getString(this, keyPublicKeyList()), "")
1919 split(rawMultisigPubKeys, SEP)
2020 }
2121
2222
2323 func getPutblicKeysAsByteVectorList () = {
2424 let rawPubKeysList = getMultisigPubKeysList()
2525 let $l = rawPubKeysList
2626 let $s = size($l)
2727 let $acc0 = nil
2828 func $f0_1 ($a,$i) = if (($i >= $s))
2929 then $a
3030 else pubKeyStringToBytes($a, $l[$i])
3131
3232 func $f0_2 ($a,$i) = if (($i >= $s))
3333 then $a
3434 else throw("List size exceeds 3")
3535
3636 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
3737 }
3838
3939
4040 func validateProof (publicKey,proof,bodyBytes) = if (sigVerify(bodyBytes, proof, publicKey))
4141 then 1
4242 else 0
4343
4444
4545 func compareHelper (lst,proof) = {
4646 let $t0927968 = lst
4747 let results = $t0927968._1
4848 let publicKey = $t0927968._2
4949 let bodyBytes = $t0927968._3
5050 $Tuple3((results :+ validateProof(publicKey, proof, bodyBytes)), publicKey, bodyBytes)
5151 }
5252
5353
5454 func compare (proofsList,publicKey,bodyBytes) = {
5555 let $l = proofsList
5656 let $s = size($l)
5757 let $acc0 = $Tuple3(nil, publicKey, bodyBytes)
5858 func $f0_1 ($a,$i) = if (($i >= $s))
5959 then $a
6060 else compareHelper($a, $l[$i])
6161
6262 func $f0_2 ($a,$i) = if (($i >= $s))
6363 then $a
6464 else throw("List size exceeds 3")
6565
6666 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
6767 }
6868
6969
7070 func accum (sum,val) = (sum + val)
7171
7272
7373 func sumList (list) = {
7474 let $l = list
7575 let $s = size($l)
7676 let $acc0 = 0
7777 func $f0_1 ($a,$i) = if (($i >= $s))
7878 then $a
7979 else accum($a, $l[$i])
8080
8181 func $f0_2 ($a,$i) = if (($i >= $s))
8282 then $a
8383 else throw("List size exceeds 3")
8484
8585 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
8686 }
8787
8888
8989 func compareListHelper (proofs,publicKey) = {
9090 let $t014301475 = proofs
9191 let results = $t014301475._1
9292 let proofsList = $t014301475._2
9393 let bodyBytes = $t014301475._3
9494 let compareList = compare(proofsList, publicKey, bodyBytes)._1
9595 let sum = sumList(compareList)
9696 $Tuple3((results :+ sum), proofsList, bodyBytes)
9797 }
9898
9999
100100 func normilizeHelper (results,next) = (results :+ min([1, next]))
101101
102102
103103 func normilize (results) = {
104104 let $l = results
105105 let $s = size($l)
106106 let $acc0 = nil
107107 func $f0_1 ($a,$i) = if (($i >= $s))
108108 then $a
109109 else normilizeHelper($a, $l[$i])
110110
111111 func $f0_2 ($a,$i) = if (($i >= $s))
112112 then $a
113113 else throw("List size exceeds 3")
114114
115115 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
116116 }
117117
118118
119119 func validProofCount (publicKeysList,proofsList,bodyBytes) = {
120120 let rawList = {
121121 let $l = publicKeysList
122122 let $s = size($l)
123123 let $acc0 = $Tuple3(nil, proofsList, bodyBytes)
124124 func $f0_1 ($a,$i) = if (($i >= $s))
125125 then $a
126126 else compareListHelper($a, $l[$i])
127127
128128 func $f0_2 ($a,$i) = if (($i >= $s))
129129 then $a
130130 else throw("List size exceeds 3")
131131
132132 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
133133 }
134134 let norm = normilize(rawList._1)
135135 sumList(norm)
136136 }
137137
138138
139+func filterProof (result,next) = if ((next != base58''))
140+ then (result :+ next)
141+ else result
142+
143+
144+func filterProofList (proofs) = {
145+ let $l = proofs
146+ let $s = size($l)
147+ let $acc0 = nil
148+ func $f0_1 ($a,$i) = if (($i >= $s))
149+ then $a
150+ else filterProof($a, $l[$i])
151+
152+ func $f0_2 ($a,$i) = if (($i >= $s))
153+ then $a
154+ else throw("List size exceeds 8")
155+
156+ $f0_2($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)
157+ }
158+
159+
139160 @Callable(i)
140161 func test () = nil
141162
142163
143164 @Verifier(tx)
144165 func verify () = match tx {
145166 case s: SetScriptTransaction =>
146167 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
147168 case _ =>
148- let proofsList = tx.proofs
169+ let proofsList = filterProofList(tx.proofs)
149170 let publicKeysList = getPutblicKeysAsByteVectorList()
150- throw(toString(size(proofsList)))
171+ (validProofCount(publicKeysList, proofsList, tx.bodyBytes) > 0)
151172 }
152173

github/deemru/w8io/169f3d6 
29.62 ms