tx · DJmvJQcwekNcUM2ZZqodo8sttN4UKboSGGvUMd5vsM57 3MsL7dFfFNVMphMjZc5peCzyrkgaaTwMZ2u: -0.01000000 Waves 2024.01.24 09:41 [2945289] smart account 3MsL7dFfFNVMphMjZc5peCzyrkgaaTwMZ2u > SELF 0.00000000 Waves
{ "type": 13, "id": "DJmvJQcwekNcUM2ZZqodo8sttN4UKboSGGvUMd5vsM57", "fee": 1000000, "feeAssetId": null, "timestamp": 1706078568308, "version": 2, "chainId": 84, "sender": "3MsL7dFfFNVMphMjZc5peCzyrkgaaTwMZ2u", "senderPublicKey": "D8hr8Byby1PWRuc4ZLMoQw9X6GdomhTcon11btWNJrf5", "proofs": [ "5HnSaiH21rj18pGEKqpgBgGDmKDSfqHLFPCFnP88hf8PRZL4jbKUhbzYbCTQ7EK3JG1qBHz4rn6BaXUx6EWsR1yX" ], "script": "base64:BgIICAISBAoCGAEEAAx2ZXJpZmllcnNLZXkCCXZlcmlmaWVycwAUdmVyaWZpZXJzUmVxdWlyZWRLZXkCEXZlcmlmaWVyc1JlcXVpcmVkABBpc0NvbnN0cnVjdGVkS2V5Ag1pc0NvbnN0cnVjdGVkAANTRVACAl9fAQFpAQtjb25zdHJ1Y3RvcgIJdmVyaWZpZXJzEXJlcXVpcmVkVmVyaWZpZXJzAwkBCWlzRGVmaW5lZAEJAKAIAQUQaXNDb25zdHJ1Y3RlZEtleQkAAgECI0NvbnN0cnVjdG9yIGNhbiBiZSBjYWxsZWQganVzdCBvbmNlAwkAZgIJAJADAQUJdmVyaWZpZXJzAAgJAAIBAhlNYXggdmVyaWZpZXJzIG51bWJlciBpcyA4AwkAZgIFEXJlcXVpcmVkVmVyaWZpZXJzCQCQAwEFCXZlcmlmaWVycwkAAgECHldyb25nIHJlcXVpcmVkIHZlcmlmaWVycyBjb3VudAkAzAgCCQEMQm9vbGVhbkVudHJ5AgUQaXNDb25zdHJ1Y3RlZEtleQYJAMwIAgkBC1N0cmluZ0VudHJ5AgUMdmVyaWZp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2945289, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let verifiersKey = "verifiers" | |
5 | + | ||
6 | + | let verifiersRequiredKey = "verifiersRequired" | |
7 | + | ||
8 | + | let isConstructedKey = "isConstructed" | |
9 | + | ||
10 | + | let SEP = "__" | |
11 | + | ||
12 | + | @Callable(i) | |
13 | + | func constructor (verifiers,requiredVerifiers) = if (isDefined(getBoolean(isConstructedKey))) | |
14 | + | then throw("Constructor can be called just once") | |
15 | + | else if ((size(verifiers) > 8)) | |
16 | + | then throw("Max verifiers number is 8") | |
17 | + | else if ((requiredVerifiers > size(verifiers))) | |
18 | + | then throw("Wrong required verifiers count") | |
19 | + | else [BooleanEntry(isConstructedKey, true), StringEntry(verifiersKey, makeString(verifiers, SEP)), IntegerEntry(verifiersRequiredKey, requiredVerifiers)] | |
20 | + | ||
21 | + | ||
22 | + | @Verifier(tx) | |
23 | + | func verify () = { | |
24 | + | let verifiers = split(valueOrElse(getString(verifiersKey), ""), SEP) | |
25 | + | let verifiersRequired = valueOrElse(getInteger(verifiersRequiredKey), 0) | |
26 | + | func sum (accum,next) = { | |
27 | + | let validatedProofsCount = accum._1 | |
28 | + | let currentProofsIndex = accum._2 | |
29 | + | let isVerified = if (sigVerify(tx.bodyBytes, tx.proofs[currentProofsIndex], fromBase58String(next))) | |
30 | + | then 1 | |
31 | + | else 0 | |
32 | + | $Tuple2((validatedProofsCount + isVerified), (currentProofsIndex + 1)) | |
33 | + | } | |
34 | + | ||
35 | + | let validationData = { | |
36 | + | let $l = verifiers | |
37 | + | let $s = size($l) | |
38 | + | let $acc0 = $Tuple2(0, 0) | |
39 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
40 | + | then $a | |
41 | + | else sum($a, $l[$i]) | |
42 | + | ||
43 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
44 | + | then $a | |
45 | + | else throw("List size exceeds 8") | |
46 | + | ||
47 | + | $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) | |
48 | + | } | |
49 | + | (validationData._1 >= verifiersRequired) | |
50 | + | } | |
51 | + |
github/deemru/w8io/169f3d6 15.52 ms ◑