tx · B7sdL6ciwS2pJNYvqjrB25goDeyT257D8RGeNd9PTiPG 3N4YCEhWFJxspKkkWeHqJXanJ4uYVJgPw5m: -0.00300000 Waves 2023.10.24 10:59 [2812437] smart account 3N4YCEhWFJxspKkkWeHqJXanJ4uYVJgPw5m > SELF 0.00000000 Waves
{ "type": 13, "id": "B7sdL6ciwS2pJNYvqjrB25goDeyT257D8RGeNd9PTiPG", "fee": 300000, "feeAssetId": null, "timestamp": 1698134433073, "version": 2, "chainId": 84, "sender": "3N4YCEhWFJxspKkkWeHqJXanJ4uYVJgPw5m", "senderPublicKey": "A54jVD4vMm67bBXphdnmSSRRTnyby3cF8DzRDNojE7Rr", "proofs": [ "4cn9izBb6e2VVA7K611fPEWjHaSM9xsoGZjTPEbwhKvnAvAgAya6QMxPRZmZCTDmM7tJDFi2o5wTMdo4a1voAV6E" ], "script": "base64:BgIoCAISBAoCCAgSBAoCCAESBQoDAgECEgQKAgIBEgUKAwgCAhIECgIIGBAACXNlcGFyYXRvcgICX18AEWtGYWN0b3J5UHVibGljS2V5AhQlc19fZmFjdG9yeVB1YmxpY0tleQARa1NlcnZpY2VQdWJsaWNLZXkCFCVzX19zZXJ2aWNlUHVibGljS2V5AA9rT3duZXJQdWJsaWNLZXkCEiVzX19vd25lclB1YmxpY0tleQANa0JvdFB1YmxpY0tleQIQJXNfX2JvdFB1YmxpY0tleQEaa0FjY291bnRBZGRyZXNzVG9BY2NvdW50SWQBDmFjY291bnRBZGRyZXNzCQC5CQIJAMwIAgIEJXMlcwkAzAgCCQClCAEFDmFjY291bnRBZGRyZXNzCQDMCAICGWFjY291bnRBZGRyZXNzVG9BY2NvdW50SWQFA25pbAUJc2VwYXJhdG9yAQ1rQWNjb3VudE93bmVyAQlhY2NvdW50SWQJALkJAgkAzAgCAgQlcyVzCQDMCAIFCWFjY291bnRJZAkAzAgCAgVvd25lcgUDbmlsBQlzZXBhcmF0b3IADmZhY3RvcnlBZGRyZXNzCQCnCAEJARFAZXh0ck5hdG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AWkIcGF5bWVudHMJAJQKAgUDbmlsBQZyZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAd0ZXN0bmV0CQAAAgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQEBVAQMYm90UHVibGljS2V5CQERQGV4dHJOYXRpdmUoMTA1MikCBQ5mYWN0b3J5QWRkcmVzcwUNa0JvdFB1YmxpY0tleQQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIFT3JkZXIJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGJvdFB1YmxpY0tleQMJAAECBQckbWF0Y2gwAhdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgMJAQlpc0RlZmluZWQBCQCcCAIFBHRoaXMFEWtGYWN0b3J5UHVibGljS2V5BwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQMJAQEhAQUHdGVzdG5ldAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXl+Bdhl", "height": 2812437, "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 separator = "__" | |
5 | + | ||
6 | + | let kFactoryPublicKey = "%s__factoryPublicKey" | |
7 | + | ||
8 | + | let kServicePublicKey = "%s__servicePublicKey" | |
9 | + | ||
10 | + | let kOwnerPublicKey = "%s__ownerPublicKey" | |
11 | + | ||
12 | + | let kBotPublicKey = "%s__botPublicKey" | |
13 | + | ||
14 | + | func kAccountAddressToAccountId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToAccountId"], separator) | |
15 | + | ||
16 | + | ||
17 | + | func kAccountOwner (accountId) = makeString(["%s%s", accountId, "owner"], separator) | |
18 | + | ||
19 | + | ||
20 | + | let factoryAddress = addressFromPublicKey(getBinaryValue(this, kFactoryPublicKey)) | |
21 | + | ||
22 | + | let serviceAddress = addressFromPublicKey(getBinaryValue(factoryAddress, kServicePublicKey)) | |
23 | + | ||
24 | + | let accountId = getStringValue(factoryAddress, kAccountAddressToAccountId(this)) | |
25 | + | ||
26 | + | let ownerPublicKey = getBinaryValue(factoryAddress, kAccountOwner(accountId)) | |
27 | + | ||
28 | + | let ownerAddress = addressFromPublicKey(ownerPublicKey) | |
29 | + | ||
30 | + | func mustAddress (i,address) = if ((i.caller == address)) | |
31 | + | then true | |
32 | + | else throw() | |
33 | + | ||
34 | + | ||
35 | + | func mustThis (i) = mustAddress(i, this) | |
36 | + | ||
37 | + | ||
38 | + | func mustService (i) = mustAddress(i, serviceAddress) | |
39 | + | ||
40 | + | ||
41 | + | func mustOwner (i) = mustAddress(i, ownerAddress) | |
42 | + | ||
43 | + | ||
44 | + | @Callable(i) | |
45 | + | func stringEntry (key,val) = if (mustService(i)) | |
46 | + | then $Tuple2([StringEntry(key, val)], key) | |
47 | + | else $Tuple2(nil, unit) | |
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | @Callable(i) | |
52 | + | func integerEntry (key,val) = if (mustService(i)) | |
53 | + | then $Tuple2([IntegerEntry(key, val)], key) | |
54 | + | else $Tuple2(nil, unit) | |
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | @Callable(i) | |
59 | + | func transferAsset (recipientBytes,amount,assetId) = if (mustService(i)) | |
60 | + | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
61 | + | else $Tuple2(nil, unit) | |
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | @Callable(i) | |
66 | + | func transferWaves (recipientBytes,amount) = if (mustService(i)) | |
67 | + | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
68 | + | else $Tuple2(nil, unit) | |
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | @Callable(i) | |
73 | + | func init (requestId,factoryPublicKey,creatorPublicKey) = { | |
74 | + | let checkCaller = mustThis(i) | |
75 | + | if ((checkCaller == checkCaller)) | |
76 | + | then { | |
77 | + | let completeRequest = invoke(addressFromPublicKey(factoryPublicKey), "complete", [requestId, creatorPublicKey], nil) | |
78 | + | if ((completeRequest == completeRequest)) | |
79 | + | then $Tuple2([BinaryEntry(kFactoryPublicKey, factoryPublicKey)], unit) | |
80 | + | else throw("Strict value is not equal to itself.") | |
81 | + | } | |
82 | + | else throw("Strict value is not equal to itself.") | |
83 | + | } | |
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | @Callable(i) | |
88 | + | func call (function,args) = { | |
89 | + | let checkCaller = mustOwner(i) | |
90 | + | if ((checkCaller == checkCaller)) | |
91 | + | then { | |
92 | + | let result = reentrantInvoke(serviceAddress, function, [args], i.payments) | |
93 | + | $Tuple2(nil, result) | |
94 | + | } | |
95 | + | else throw("Strict value is not equal to itself.") | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | @Verifier(tx) | |
100 | + | func verify () = { | |
101 | + | let testnet = (take(drop(this.bytes, 1), 1) == base58'2T') | |
102 | + | let botPublicKey = getBinaryValue(factoryAddress, kBotPublicKey) | |
103 | + | match tx { | |
104 | + | case _: Order => | |
105 | + | sigVerify(tx.bodyBytes, tx.proofs[0], botPublicKey) | |
106 | + | case _: InvokeScriptTransaction => | |
107 | + | if (isDefined(getBinary(this, kFactoryPublicKey))) | |
108 | + | then false | |
109 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
110 | + | case _ => | |
111 | + | if (!(testnet)) | |
112 | + | then false | |
113 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
114 | + | } | |
115 | + | } | |
116 | + |
github/deemru/w8io/fabc49c 20.87 ms ◑