tx · HsUUp1ReSHsakkfUcTNA5kkzjLqJcirj3PAywnoztoYH 3MuQJ2by8GXusfNAEdX1jYW2WMQbjVzwxzX: -0.01000000 Waves 2023.09.27 14:45 [2773770] smart account 3MuQJ2by8GXusfNAEdX1jYW2WMQbjVzwxzX > SELF 0.00000000 Waves
{ "type": 13, "id": "HsUUp1ReSHsakkfUcTNA5kkzjLqJcirj3PAywnoztoYH", "fee": 1000000, "feeAssetId": null, "timestamp": 1695815185075, "version": 2, "chainId": 84, "sender": "3MuQJ2by8GXusfNAEdX1jYW2WMQbjVzwxzX", "senderPublicKey": "DCZ3si1pk7A23sVSwzZtghP1jZR2YyYEH2WaMxvELct9", "proofs": [ "5BRTx5R1vrxKjFsMX3v48fqdGwCyakokyb22yFnJbHVA38bvGWFzSJyvbJgJAKZkehD9R4k1aAQ4cqpVGiHsvfPJ" ], "script": "base64:BgIqCAISBAoCCAgSBAoCCAESBQoDAgECEgQKAgIBEgUKAwICAhIAEgQKAggYDwARa0ZhY3RvcnlQdWJsaWNLZXkCFCVzX19mYWN0b3J5UHVibGljS2V5ABFrU2VydmljZVB1YmxpY0tleQIUJXNfX3NlcnZpY2VQdWJsaWNLZXkAD2tPd25lclB1YmxpY0tleQISJXNfX293bmVyUHVibGljS2V5ABFrQ3JlYXRvclB1YmxpY0tleQIUJXNfX2NyZWF0b3JQdWJsaWNLZXkADWtCb3RQdWJsaWNLZXkCECVzX19ib3RQdWJsaWNLZXkACWtWZXJpZmllZAIMJXNfX3ZlcmlmaWVkAQh2ZXJpZmllZAAJAQt2YWx1ZU9yRWxzZQIJAJsIAgUEdGhpcwUJa1ZlcmlmaWVkBwAOZmFjdG9yeUFkZHJlc3MJAKcIAQkBEUBleHRyTmF0aXZlKDEwNTIpAgUEdGhpcwURa0ZhY3RvcnlQdWJsaWNLZXkADnNlcnZpY2VBZGRyZXNzCQCnCAEJARFAZXh0ck5hdGl2ZSgxMDUyKQIFDmZhY3RvcnlBZGRyZXNzBRFrU2VydmljZVB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AAIJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEBAVQEDGJvdFB1YmxpY0tleQkBEUBleHRyTmF0aXZlKDEwNTIpAgUOZmFjdG9yeUFkZHJlc3MFDWtCb3RQdWJsaWNLZXkEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACBU9yZGVyCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQxib3RQdWJsaWNLZXkDCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24DCQEIdmVyaWZpZWQABwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQMJAQEhAQUHdGVzdG5ldAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXm2ZHf2", "height": 2773770, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AdfbHKt54m7jJkCh6ENyEiKLWa8SScd7MzWRjYxA5QsR Next: Eb2V6VxfsWYPxZ1bepS1zDAAqbQK8nXwiZecGZ1zoxB Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kFactoryPublicKey = "%s__factoryPublicKey" | |
5 | 5 | ||
6 | 6 | let kServicePublicKey = "%s__servicePublicKey" | |
7 | 7 | ||
8 | 8 | let kOwnerPublicKey = "%s__ownerPublicKey" | |
9 | 9 | ||
10 | 10 | let kCreatorPublicKey = "%s__creatorPublicKey" | |
11 | 11 | ||
12 | 12 | let kBotPublicKey = "%s__botPublicKey" | |
13 | 13 | ||
14 | 14 | let kVerified = "%s__verified" | |
15 | 15 | ||
16 | 16 | func verified () = valueOrElse(getBoolean(this, kVerified), false) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | let factoryAddress = addressFromPublicKey(getBinaryValue(this, kFactoryPublicKey)) | |
20 | 20 | ||
21 | 21 | let serviceAddress = addressFromPublicKey(getBinaryValue(factoryAddress, kServicePublicKey)) | |
22 | 22 | ||
23 | 23 | let ownerAddress = addressFromPublicKey(getBinaryValue(this, kOwnerPublicKey)) | |
24 | 24 | ||
25 | 25 | func mustAddress (i,address) = if ((i.caller == address)) | |
26 | 26 | then true | |
27 | 27 | else throw() | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func mustThis (i) = mustAddress(i, this) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func mustService (i) = mustAddress(i, serviceAddress) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func mustOwner (i) = mustAddress(i, ownerAddress) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func mustFactory (i) = mustAddress(i, factoryAddress) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | @Callable(i) | |
43 | 43 | func stringEntry (key,val) = if (mustService(i)) | |
44 | 44 | then $Tuple2([StringEntry(key, val)], key) | |
45 | 45 | else $Tuple2(nil, unit) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(i) | |
50 | 50 | func integerEntry (key,val) = if (mustService(i)) | |
51 | 51 | then $Tuple2([IntegerEntry(key, val)], key) | |
52 | 52 | else $Tuple2(nil, unit) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | 57 | func transferAsset (recipientBytes,amount,assetId) = if (mustService(i)) | |
58 | 58 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
59 | 59 | else $Tuple2(nil, unit) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func transferWaves (recipientBytes,amount) = if (mustService(i)) | |
65 | 65 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
66 | 66 | else $Tuple2(nil, unit) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(i) | |
71 | 71 | func init (factoryPublicKey,ownerPublicKey,creatorPublicKey) = { | |
72 | 72 | let checkCaller = mustThis(i) | |
73 | 73 | if ((checkCaller == checkCaller)) | |
74 | 74 | then $Tuple2([BinaryEntry(kFactoryPublicKey, factoryPublicKey), BinaryEntry(kOwnerPublicKey, ownerPublicKey), BinaryEntry(kCreatorPublicKey, creatorPublicKey)], unit) | |
75 | 75 | else throw("Strict value is not equal to itself.") | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | 81 | func approve () = { | |
82 | 82 | let checkCaller = mustFactory(i) | |
83 | 83 | if ((checkCaller == checkCaller)) | |
84 | 84 | then $Tuple2([BooleanEntry(kVerified, true)], unit) | |
85 | 85 | else throw("Strict value is not equal to itself.") | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(i) | |
91 | 91 | func call (function,args) = { | |
92 | 92 | let checkCaller = mustOwner(i) | |
93 | 93 | if ((checkCaller == checkCaller)) | |
94 | 94 | then { | |
95 | 95 | let result = reentrantInvoke(serviceAddress, function, [args], i.payments) | |
96 | 96 | $Tuple2(nil, result) | |
97 | 97 | } | |
98 | 98 | else throw("Strict value is not equal to itself.") | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Verifier(tx) | |
103 | 103 | func verify () = { | |
104 | 104 | let testnet = (take(drop(this.bytes, 1), 1) == base58'2T') | |
105 | 105 | let botPublicKey = getBinaryValue(factoryAddress, kBotPublicKey) | |
106 | 106 | match tx { | |
107 | 107 | case _: Order => | |
108 | 108 | sigVerify(tx.bodyBytes, tx.proofs[0], botPublicKey) | |
109 | 109 | case _: InvokeScriptTransaction => | |
110 | 110 | if (verified()) | |
111 | 111 | then false | |
112 | 112 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
113 | 113 | case _ => | |
114 | 114 | if (!(testnet)) | |
115 | 115 | then false | |
116 | 116 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
117 | 117 | } | |
118 | 118 | } | |
119 | 119 |
github/deemru/w8io/03bedc9 25.45 ms ◑![]()