tx · 8ZL2wPCQYBpaiHKekgytdt6gsJjL4oY8e74K82S1nzb4 3MzmMwLwGx26c6SEQyghZvoYckQzmq4jusd: -0.14000000 Waves 2022.12.15 16:07 [2361461] smart account 3MzmMwLwGx26c6SEQyghZvoYckQzmq4jusd > SELF 0.00000000 Waves
{ "type": 13, "id": "8ZL2wPCQYBpaiHKekgytdt6gsJjL4oY8e74K82S1nzb4", "fee": 14000000, "feeAssetId": null, "timestamp": 1671109667029, "version": 2, "chainId": 84, "sender": "3MzmMwLwGx26c6SEQyghZvoYckQzmq4jusd", "senderPublicKey": "4enJnpb22dKBKv5LQx9eLesMHfLz9H6j8iJF1z6aYx7T", "proofs": [ "3Zwp4sACRNw69XCPiyzo7jhmaSbag7avEeNVXMo4SZbHBttgZKEQNjPKKSiZMAse5xLfiPgUjUmhLQC4Td43q8YD", "3Mh9u6QaxWJrQRzQd776Fz4bRoYXvYTmA3qJDi43FMU1hggpiKwBLjwHyDDjXn181G7xu9rvwg3HT972DymEocMN" ], "script": "base64:BgICCAINAA1rUG9vbEluT3JlY2xlAgVwb29sXwANa1Bvb2xBc3NldElkQQIKQV9hc3NldF9pZAANa1Bvb2xBc3NldElkQgIKQl9hc3NldF9pZAAGb3JhY2xlCQEHQWRkcmVzcwEBGgFUSBOXDMDTM8wlMoC2KfenZGiAq+PMe0uZARNnZXRCYXNlNThGcm9tT3JhY2xlAQNrZXkEByRtYXRjaDAJAJ0IAgUGb3JhY2xlBQNrZXkDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAZzdHJpbmcFByRtYXRjaDAJANkEAQUGc3RyaW5nBAdub3RoaW5nBQckbWF0Y2gwCQACAQkArAICBQNrZXkCCGlzIGVtcHR5AA1rQWRtaW5QdWJLZXkxAgthZG1pbl9wdWJfMQANa0FkbWluUHViS2V5MgILYWRtaW5fcHViXzIADWtBZG1pblB1YktleTMCC2FkbWluX3B1Yl8zABJrQWRtaW5JbnZva2VQdWJLZXkCEGFkbWluX2ludm9rZV9wdWIAD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QUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsFCmlzUmlnaHRGZWUHBRBzaWduZWRCeU9uZUFkbWluBwUPaXNUcmFuc2ZlcldhdmVzBwkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAACBeal/Q==", "height": 2361461, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EKRiNP3KrQaJomqA9KtZExcxoxNz3mvCevpYWwFCnrif Next: 3nXZ9anWQVkegX2wVBimik4HLNHgWGCoD2a1pmFJ53oo Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kPoolInOrecle = "pool_" | |
5 | 5 | ||
6 | 6 | let kPoolAssetIdA = "A_asset_id" | |
7 | 7 | ||
8 | 8 | let kPoolAssetIdB = "B_asset_id" | |
9 | 9 | ||
10 | 10 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
11 | 11 | ||
12 | 12 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
13 | 13 | case string: String => | |
14 | 14 | fromBase58String(string) | |
15 | 15 | case nothing => | |
16 | 16 | throw((key + "is empty")) | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | let kAdminPubKey1 = "admin_pub_1" | |
21 | 21 | ||
22 | 22 | let kAdminPubKey2 = "admin_pub_2" | |
23 | 23 | ||
24 | 24 | let kAdminPubKey3 = "admin_pub_3" | |
25 | 25 | ||
26 | 26 | let kAdminInvokePubKey = "admin_invoke_pub" | |
27 | 27 | ||
28 | 28 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
29 | 29 | ||
30 | 30 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
31 | 31 | ||
32 | 32 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
33 | 33 | ||
34 | 34 | let adminInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Verifier(tx) | |
38 | 38 | func verify () = { | |
39 | 39 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
40 | 40 | then 1 | |
41 | 41 | else 0 | |
42 | 42 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
43 | 43 | then 1 | |
44 | 44 | else 0 | |
45 | 45 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
46 | 46 | then 1 | |
47 | 47 | else 0 | |
48 | 48 | let adminPubKeyInvokeSigned = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminInvoke)) | |
49 | 49 | then 1 | |
50 | 50 | else 0 | |
51 | 51 | match tx { | |
52 | 52 | case t: MassTransferTransaction => | |
53 | 53 | func poolInOracle (a,transfer) = { | |
54 | 54 | let poolAddress = match transfer.recipient { | |
55 | 55 | case add: Address => | |
56 | 56 | toString(add) | |
57 | 57 | case _ => | |
58 | 58 | throw("Not known type of recipient") | |
59 | 59 | } | |
60 | 60 | if (isDefined(getString(oracle, (kPoolInOrecle + poolAddress)))) | |
61 | 61 | then if ((valueOrElse(getString(transfer.recipient, kPoolAssetIdA), "") == "WAVES")) | |
62 | 62 | then true | |
63 | 63 | else (valueOrElse(getString(transfer.recipient, kPoolAssetIdB), "") == "WAVES") | |
64 | 64 | else false | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | let isRightFee = (t.fee == (500000 + (fraction(50000, size(t.transfers), 100000, CEILING) * 100000))) | |
68 | 68 | let isTransferWaves = (t.assetId == unit) | |
69 | 69 | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyInvokeSigned) >= 1) | |
70 | 70 | if (if (if ({ | |
71 | 71 | let $l = t.transfers | |
72 | 72 | let $s = size($l) | |
73 | 73 | let $acc0 = true | |
74 | 74 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
75 | 75 | then $a | |
76 | 76 | else poolInOracle($a, $l[$i]) | |
77 | 77 | ||
78 | 78 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
79 | 79 | then $a | |
80 | 80 | else throw("List size exceeds 27") | |
81 | 81 | ||
82 | 82 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27) | |
83 | 83 | }) | |
84 | 84 | then isRightFee | |
85 | 85 | else false) | |
86 | 86 | then signedByOneAdmin | |
87 | 87 | else false) | |
88 | 88 | then isTransferWaves | |
89 | 89 | else false | |
90 | 90 | case _ => | |
91 | 91 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
92 | 92 | } | |
93 | 93 | } | |
94 | 94 |
github/deemru/w8io/026f985 23.78 ms ◑