tx · FK1mseFSZGYNv7aNaDDWh9sMDem5s66bMp7BeSREj4yV 3N3v2zVJyynhzc39qG5wrE244prmxQ4bgV4: -0.01000000 Waves 2023.03.14 12:56 [2489560] smart account 3N3v2zVJyynhzc39qG5wrE244prmxQ4bgV4 > SELF 0.00000000 Waves
{ "type": 13, "id": "FK1mseFSZGYNv7aNaDDWh9sMDem5s66bMp7BeSREj4yV", "fee": 1000000, "feeAssetId": null, "timestamp": 1678787821891, "version": 2, "chainId": 84, "sender": "3N3v2zVJyynhzc39qG5wrE244prmxQ4bgV4", "senderPublicKey": "B9tjfxvdWuoHAvWusCmsxYMGHa4o2uzQmod3uHjLmF5G", "proofs": [ "5mxxNvPNV9sTTjeTD9LjUMqdrngraKkqQLXWetqpktWDcWGzhJzwJp1yGZ6dshbzF8ZW1zMVkzyoiuPBT6b3aSFM" ], "script": "base64:BgICCAILAAZvcmFjbGUJAQdBZGRyZXNzAQEaAVRIE5cMwNMzzCUygLYp96dkaICr48x7S5kBE2dldEJhc2U1OEZyb21PcmFjbGUBA2tleQQHJG1hdGNoMAkAnQgCBQZvcmFjbGUFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkA2QQBBQZzdHJpbmcEB25vdGhpbmcFByRtYXRjaDAJAAIBCQCsAgIFA2tleQIIaXMgZW1wdHkADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMADGtSb3V0aW5nQWRkcgIPcm91dGluZ19hZGRyZXNzAAxhZG1pblB1YktleTEJARNnZXRCYXNlNThGcm9tT3JhY2xlAQUNa0FkbWluUHViS2V5MQAMYWRtaW5QdWJLZXkyCQETZ2V0QmFzZTU4RnJvbU9yYWNsZQEFDWtBZG1pblB1YktleTIADGFkbWluUHViS2V5MwkBE2dldEJhc2U1OEZyb21PcmFjbGUBBQ1rQWRtaW5Qd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AnR4BnByb29mcwAABQxhZG1pblB1YktleTEAAQAABBJhZG1pblB1YktleTJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQxhZG1pblB1YktleTIAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAKH4XHY", "height": 2489560, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 6dTMKXHrBZVXcD91DkV44XSr7zN8HHZtTsgbv1G5tG5Y Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
5 | + | ||
6 | + | func getBase58FromOracle (key) = match getString(oracle, key) { | |
7 | + | case string: String => | |
8 | + | fromBase58String(string) | |
9 | + | case nothing => | |
10 | + | throw((key + "is empty")) | |
11 | + | } | |
12 | + | ||
13 | + | ||
14 | + | let kAdminPubKey1 = "admin_pub_1" | |
15 | + | ||
16 | + | let kAdminPubKey2 = "admin_pub_2" | |
17 | + | ||
18 | + | let kAdminPubKey3 = "admin_pub_3" | |
19 | + | ||
20 | + | let kRoutingAddr = "routing_address" | |
21 | + | ||
22 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
23 | + | ||
24 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
25 | + | ||
26 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
27 | + | ||
28 | + | let routingAddress = Address(getBase58FromOracle(kRoutingAddr)) | |
29 | + | ||
30 | + | let keyPrefixPoolName = "pool_" | |
31 | + | ||
32 | + | ||
33 | + | @Verifier(tx) | |
34 | + | func verify () = match tx { | |
35 | + | case inv: InvokeScriptTransaction => | |
36 | + | let isRightFee = if ((inv.fee == 900000)) | |
37 | + | then (inv.feeAssetId == unit) | |
38 | + | else false | |
39 | + | let isRoutingCall = if ((inv.dApp == routingAddress)) | |
40 | + | then (inv.function == "routingTrade") | |
41 | + | else false | |
42 | + | let isExchangeCallCPMM = if (if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
43 | + | then (inv.function == "callFunction") | |
44 | + | else false) | |
45 | + | then (inv.args[0] == "exchange") | |
46 | + | else false | |
47 | + | let isExchangeCall = if (isDefined(getString(oracle, (keyPrefixPoolName + toString(addressFromRecipient(inv.dApp)))))) | |
48 | + | then (inv.function == "exchange") | |
49 | + | else false | |
50 | + | if (if (if (if (if (isExchangeCall) | |
51 | + | then true | |
52 | + | else isExchangeCallCPMM) | |
53 | + | then true | |
54 | + | else isRoutingCall) | |
55 | + | then (size(inv.payments) == 1) | |
56 | + | else false) | |
57 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
58 | + | else false) | |
59 | + | then isRightFee | |
60 | + | else false | |
61 | + | case _ => | |
62 | + | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
63 | + | then 1 | |
64 | + | else 0 | |
65 | + | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
66 | + | then 1 | |
67 | + | else 0 | |
68 | + | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
69 | + | then 1 | |
70 | + | else 0 | |
71 | + | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
72 | + | } | |
73 | + |
github/deemru/w8io/026f985 14.63 ms ◑