tx · J6ts2bnM5TuKnLMsiBoNuiP8twd8Rei2vsd98pTJqDjt
3Mu3e7R5nEBrDEAzznC7h68ffzL5JouGszd: -0.01000000 Waves
2023.11.28 16:13 [2863291] smart account 3Mu3e7R5nEBrDEAzznC7h68ffzL5JouGszd > SELF 0.00000000 Waves
{
"type": 13,
"id": "J6ts2bnM5TuKnLMsiBoNuiP8twd8Rei2vsd98pTJqDjt",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1701177235853,
"version": 2,
"chainId": 84,
"sender": "3Mu3e7R5nEBrDEAzznC7h68ffzL5JouGszd",
"senderPublicKey": "B4bNSdbqghMi7FKwR3XuZzFQQS6wJABczdGZPWZe7Wj5",
"proofs": [
"5g2pUEmQqFHcnpRPveM32RwE7hzL76U3MKTFPzVjdj7TmuX6UnhpTT1cFtDHPNBJZjF7FcmxWSo5idpfnWPxypWg"
],
"script": "base64:BgInCAISBAoCCAgSBAoCCAESBQoDAgECEgQKAgIBEgQKAgICEgQKAggYEwAJc2VwYXJhdG9yAgJfXwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFQBAVQACGNoYWluSWRXAQFXAQttdXN0QWRkcmVzcwIBaQdhZGRyZXNzAwkAAAIIBQFpBmNhbGxlcgUHYWRkcmVzcwYJAAIBAhFwZXJtaXNzaW9uIGRlbmllZAEIbXVzdFRoaXMBAWkJAQttdXN0QWRkcmVzcwIFAWkFBHRoaXMAEWtGYWN0b3J5UHVibGljS2V5AhQlc19fZmFjdG9yeVB1YmxpY0tleQARa1NlcnZpY2VQdWJsaWNLZXkCFCVzX19zZXJ2aWNlUHVibGljS2V5AA9rT3duZXJQdWJsaWNLZXkCEiVzX19vd25lclB1YmxpY0tleQANa0JvdFB1YmxpY0tleQIQJXNfX2JvdFB1YmxpY0tleQEaa0FjY291bnRBZGRyZXNzVG9SZXF1ZXN0SWQBDmFjY291bnRBZGRyZXNzCQC5CQIJAMwIAgIEJXMlcwkAz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IFC2NoZWNrQ2FsbGVyBAZyZXN1bHQJAP0HBAUOc2VydmljZUFkZHJlc3MFCGZ1bmN0aW9uCQDMCAIFBGFyZ3MFA25pbAgFAWkIcGF5bWVudHMJAJQKAgUDbmlsBQZyZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAxib3RQdWJsaWNLZXkJARFAZXh0ck5hdGl2ZSgxMDUyKQIFDmZhY3RvcnlBZGRyZXNzBQ1rQm90UHVibGljS2V5BAckbWF0Y2gwBQJ0eAMJAAECBQckbWF0Y2gwAgVPcmRlcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYm90UHVibGljS2V5AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uAwkBCWlzRGVmaW5lZAEJAJwIAgUEdGhpcwURa0ZhY3RvcnlQdWJsaWNLZXkHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5AwkAAAIFB2NoYWluSWQFCGNoYWluSWRXBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tled78w9w=",
"height": 2863291,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 69QZEWwvi8EN6A2fHsCMUChc3S4xo1TJHfUjithqk1M3
Next: none
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let separator = "__" |
---|
| 5 | + | |
---|
| 6 | + | let chainId = take(drop(this.bytes, 1), 1) |
---|
| 7 | + | |
---|
| 8 | + | let chainIdT = base58'2T' |
---|
| 9 | + | |
---|
| 10 | + | let chainIdW = base58'2W' |
---|
| 11 | + | |
---|
| 12 | + | func mustAddress (i,address) = if ((i.caller == address)) |
---|
| 13 | + | then true |
---|
| 14 | + | else throw("permission denied") |
---|
| 15 | + | |
---|
| 16 | + | |
---|
| 17 | + | func mustThis (i) = mustAddress(i, this) |
---|
| 18 | + | |
---|
| 19 | + | |
---|
4 | 20 | | let kFactoryPublicKey = "%s__factoryPublicKey" |
---|
5 | 21 | | |
---|
6 | 22 | | let kServicePublicKey = "%s__servicePublicKey" |
---|
|
9 | 25 | | |
---|
10 | 26 | | let kBotPublicKey = "%s__botPublicKey" |
---|
11 | 27 | | |
---|
12 | | - | let kVerified = "%s__verified" |
---|
| 28 | + | func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator) |
---|
| 29 | + | |
---|
| 30 | + | |
---|
| 31 | + | func kAccountOwner (accountId) = makeString(["%s%s", accountId, "ownerPublicKey"], separator) |
---|
| 32 | + | |
---|
13 | 33 | | |
---|
14 | 34 | | let factoryAddress = addressFromPublicKey(getBinaryValue(this, kFactoryPublicKey)) |
---|
15 | 35 | | |
---|
16 | 36 | | let serviceAddress = addressFromPublicKey(getBinaryValue(factoryAddress, kServicePublicKey)) |
---|
17 | 37 | | |
---|
18 | | - | let ownerAddress = addressFromPublicKey(getBinaryValue(this, kOwnerPublicKey)) |
---|
| 38 | + | let accountId = getStringValue(factoryAddress, kAccountAddressToRequestId(this)) |
---|
19 | 39 | | |
---|
20 | | - | let isReady = if (if (isDefined(getBinary(this, kFactoryPublicKey))) |
---|
21 | | - | then isDefined(getBinary(this, kOwnerPublicKey)) |
---|
22 | | - | else false) |
---|
23 | | - | then valueOrElse(getBoolean(this, kVerified), false) |
---|
24 | | - | else false |
---|
| 40 | + | let ownerPublicKey = getBinaryValue(factoryAddress, kAccountOwner(accountId)) |
---|
25 | 41 | | |
---|
26 | | - | func mustAddress (i,address) = if ((i.caller == address)) |
---|
27 | | - | then true |
---|
28 | | - | else throw() |
---|
29 | | - | |
---|
30 | | - | |
---|
31 | | - | func mustThis (i) = mustAddress(i, this) |
---|
32 | | - | |
---|
| 42 | + | let ownerAddress = addressFromPublicKey(ownerPublicKey) |
---|
33 | 43 | | |
---|
34 | 44 | | func mustService (i) = mustAddress(i, serviceAddress) |
---|
35 | 45 | | |
---|
36 | 46 | | |
---|
37 | 47 | | func mustOwner (i) = mustAddress(i, ownerAddress) |
---|
38 | | - | |
---|
39 | | - | |
---|
40 | | - | func mustFactory (i) = mustAddress(i, factoryAddress) |
---|
41 | 48 | | |
---|
42 | 49 | | |
---|
43 | 50 | | @Callable(i) |
---|
|
69 | 76 | | |
---|
70 | 77 | | |
---|
71 | 78 | | @Callable(i) |
---|
72 | | - | func init (factoryPublicKey,ownerPublicKey) = { |
---|
73 | | - | let checkCaller = mustThis(i) |
---|
74 | | - | if ((checkCaller == checkCaller)) |
---|
75 | | - | then $Tuple2([BinaryEntry(kFactoryPublicKey, factoryPublicKey), BinaryEntry(kOwnerPublicKey, ownerPublicKey)], unit) |
---|
76 | | - | else throw("Strict value is not equal to itself.") |
---|
77 | | - | } |
---|
78 | | - | |
---|
79 | | - | |
---|
80 | | - | |
---|
81 | | - | @Callable(i) |
---|
82 | | - | func complete (requestId,recipientPublicKey) = { |
---|
| 79 | + | func init (factoryPublicKey,creatorPublicKey) = { |
---|
83 | 80 | | let checkCaller = mustThis(i) |
---|
84 | 81 | | if ((checkCaller == checkCaller)) |
---|
85 | 82 | | then { |
---|
86 | | - | let result = reentrantInvoke(factoryAddress, "complete", [requestId, recipientPublicKey], nil) |
---|
87 | | - | $Tuple2(nil, result) |
---|
| 83 | + | let completeRequest = invoke(addressFromPublicKey(factoryPublicKey), "addAccount", [creatorPublicKey], nil) |
---|
| 84 | + | if ((completeRequest == completeRequest)) |
---|
| 85 | + | then $Tuple2([BinaryEntry(kFactoryPublicKey, factoryPublicKey)], unit) |
---|
| 86 | + | else throw("Strict value is not equal to itself.") |
---|
88 | 87 | | } |
---|
89 | | - | else throw("Strict value is not equal to itself.") |
---|
90 | | - | } |
---|
91 | | - | |
---|
92 | | - | |
---|
93 | | - | |
---|
94 | | - | @Callable(i) |
---|
95 | | - | func approve () = { |
---|
96 | | - | let checkCaller = mustFactory(i) |
---|
97 | | - | if ((checkCaller == checkCaller)) |
---|
98 | | - | then $Tuple2([BooleanEntry(kVerified, true)], unit) |
---|
99 | 88 | | else throw("Strict value is not equal to itself.") |
---|
100 | 89 | | } |
---|
101 | 90 | | |
---|
|
115 | 104 | | |
---|
116 | 105 | | @Verifier(tx) |
---|
117 | 106 | | func verify () = { |
---|
118 | | - | let testnet = (take(drop(this.bytes, 1), 1) == base58'2T') |
---|
119 | 107 | | let botPublicKey = getBinaryValue(factoryAddress, kBotPublicKey) |
---|
120 | 108 | | match tx { |
---|
121 | 109 | | case _: Order => |
---|
122 | 110 | | sigVerify(tx.bodyBytes, tx.proofs[0], botPublicKey) |
---|
123 | 111 | | case _: InvokeScriptTransaction => |
---|
124 | | - | if (isReady) |
---|
| 112 | + | if (isDefined(getBinary(this, kFactoryPublicKey))) |
---|
125 | 113 | | then false |
---|
126 | 114 | | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
127 | 115 | | case _ => |
---|
128 | | - | if (!(testnet)) |
---|
| 116 | + | if ((chainId == chainIdW)) |
---|
129 | 117 | | then false |
---|
130 | 118 | | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
131 | 119 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let separator = "__" |
---|
| 5 | + | |
---|
| 6 | + | let chainId = take(drop(this.bytes, 1), 1) |
---|
| 7 | + | |
---|
| 8 | + | let chainIdT = base58'2T' |
---|
| 9 | + | |
---|
| 10 | + | let chainIdW = base58'2W' |
---|
| 11 | + | |
---|
| 12 | + | func mustAddress (i,address) = if ((i.caller == address)) |
---|
| 13 | + | then true |
---|
| 14 | + | else throw("permission denied") |
---|
| 15 | + | |
---|
| 16 | + | |
---|
| 17 | + | func mustThis (i) = mustAddress(i, this) |
---|
| 18 | + | |
---|
| 19 | + | |
---|
4 | 20 | | let kFactoryPublicKey = "%s__factoryPublicKey" |
---|
5 | 21 | | |
---|
6 | 22 | | let kServicePublicKey = "%s__servicePublicKey" |
---|
7 | 23 | | |
---|
8 | 24 | | let kOwnerPublicKey = "%s__ownerPublicKey" |
---|
9 | 25 | | |
---|
10 | 26 | | let kBotPublicKey = "%s__botPublicKey" |
---|
11 | 27 | | |
---|
12 | | - | let kVerified = "%s__verified" |
---|
| 28 | + | func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator) |
---|
| 29 | + | |
---|
| 30 | + | |
---|
| 31 | + | func kAccountOwner (accountId) = makeString(["%s%s", accountId, "ownerPublicKey"], separator) |
---|
| 32 | + | |
---|
13 | 33 | | |
---|
14 | 34 | | let factoryAddress = addressFromPublicKey(getBinaryValue(this, kFactoryPublicKey)) |
---|
15 | 35 | | |
---|
16 | 36 | | let serviceAddress = addressFromPublicKey(getBinaryValue(factoryAddress, kServicePublicKey)) |
---|
17 | 37 | | |
---|
18 | | - | let ownerAddress = addressFromPublicKey(getBinaryValue(this, kOwnerPublicKey)) |
---|
| 38 | + | let accountId = getStringValue(factoryAddress, kAccountAddressToRequestId(this)) |
---|
19 | 39 | | |
---|
20 | | - | let isReady = if (if (isDefined(getBinary(this, kFactoryPublicKey))) |
---|
21 | | - | then isDefined(getBinary(this, kOwnerPublicKey)) |
---|
22 | | - | else false) |
---|
23 | | - | then valueOrElse(getBoolean(this, kVerified), false) |
---|
24 | | - | else false |
---|
| 40 | + | let ownerPublicKey = getBinaryValue(factoryAddress, kAccountOwner(accountId)) |
---|
25 | 41 | | |
---|
26 | | - | func mustAddress (i,address) = if ((i.caller == address)) |
---|
27 | | - | then true |
---|
28 | | - | else throw() |
---|
29 | | - | |
---|
30 | | - | |
---|
31 | | - | func mustThis (i) = mustAddress(i, this) |
---|
32 | | - | |
---|
| 42 | + | let ownerAddress = addressFromPublicKey(ownerPublicKey) |
---|
33 | 43 | | |
---|
34 | 44 | | func mustService (i) = mustAddress(i, serviceAddress) |
---|
35 | 45 | | |
---|
36 | 46 | | |
---|
37 | 47 | | func mustOwner (i) = mustAddress(i, ownerAddress) |
---|
38 | | - | |
---|
39 | | - | |
---|
40 | | - | func mustFactory (i) = mustAddress(i, factoryAddress) |
---|
41 | 48 | | |
---|
42 | 49 | | |
---|
43 | 50 | | @Callable(i) |
---|
44 | 51 | | func stringEntry (key,val) = if (mustService(i)) |
---|
45 | 52 | | then $Tuple2([StringEntry(key, val)], key) |
---|
46 | 53 | | else $Tuple2(nil, unit) |
---|
47 | 54 | | |
---|
48 | 55 | | |
---|
49 | 56 | | |
---|
50 | 57 | | @Callable(i) |
---|
51 | 58 | | func integerEntry (key,val) = if (mustService(i)) |
---|
52 | 59 | | then $Tuple2([IntegerEntry(key, val)], key) |
---|
53 | 60 | | else $Tuple2(nil, unit) |
---|
54 | 61 | | |
---|
55 | 62 | | |
---|
56 | 63 | | |
---|
57 | 64 | | @Callable(i) |
---|
58 | 65 | | func transferAsset (recipientBytes,amount,assetId) = if (mustService(i)) |
---|
59 | 66 | | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) |
---|
60 | 67 | | else $Tuple2(nil, unit) |
---|
61 | 68 | | |
---|
62 | 69 | | |
---|
63 | 70 | | |
---|
64 | 71 | | @Callable(i) |
---|
65 | 72 | | func transferWaves (recipientBytes,amount) = if (mustService(i)) |
---|
66 | 73 | | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) |
---|
67 | 74 | | else $Tuple2(nil, unit) |
---|
68 | 75 | | |
---|
69 | 76 | | |
---|
70 | 77 | | |
---|
71 | 78 | | @Callable(i) |
---|
72 | | - | func init (factoryPublicKey,ownerPublicKey) = { |
---|
73 | | - | let checkCaller = mustThis(i) |
---|
74 | | - | if ((checkCaller == checkCaller)) |
---|
75 | | - | then $Tuple2([BinaryEntry(kFactoryPublicKey, factoryPublicKey), BinaryEntry(kOwnerPublicKey, ownerPublicKey)], unit) |
---|
76 | | - | else throw("Strict value is not equal to itself.") |
---|
77 | | - | } |
---|
78 | | - | |
---|
79 | | - | |
---|
80 | | - | |
---|
81 | | - | @Callable(i) |
---|
82 | | - | func complete (requestId,recipientPublicKey) = { |
---|
| 79 | + | func init (factoryPublicKey,creatorPublicKey) = { |
---|
83 | 80 | | let checkCaller = mustThis(i) |
---|
84 | 81 | | if ((checkCaller == checkCaller)) |
---|
85 | 82 | | then { |
---|
86 | | - | let result = reentrantInvoke(factoryAddress, "complete", [requestId, recipientPublicKey], nil) |
---|
87 | | - | $Tuple2(nil, result) |
---|
| 83 | + | let completeRequest = invoke(addressFromPublicKey(factoryPublicKey), "addAccount", [creatorPublicKey], nil) |
---|
| 84 | + | if ((completeRequest == completeRequest)) |
---|
| 85 | + | then $Tuple2([BinaryEntry(kFactoryPublicKey, factoryPublicKey)], unit) |
---|
| 86 | + | else throw("Strict value is not equal to itself.") |
---|
88 | 87 | | } |
---|
89 | | - | else throw("Strict value is not equal to itself.") |
---|
90 | | - | } |
---|
91 | | - | |
---|
92 | | - | |
---|
93 | | - | |
---|
94 | | - | @Callable(i) |
---|
95 | | - | func approve () = { |
---|
96 | | - | let checkCaller = mustFactory(i) |
---|
97 | | - | if ((checkCaller == checkCaller)) |
---|
98 | | - | then $Tuple2([BooleanEntry(kVerified, true)], unit) |
---|
99 | 88 | | else throw("Strict value is not equal to itself.") |
---|
100 | 89 | | } |
---|
101 | 90 | | |
---|
102 | 91 | | |
---|
103 | 92 | | |
---|
104 | 93 | | @Callable(i) |
---|
105 | 94 | | func call (function,args) = { |
---|
106 | 95 | | let checkCaller = mustOwner(i) |
---|
107 | 96 | | if ((checkCaller == checkCaller)) |
---|
108 | 97 | | then { |
---|
109 | 98 | | let result = reentrantInvoke(serviceAddress, function, [args], i.payments) |
---|
110 | 99 | | $Tuple2(nil, result) |
---|
111 | 100 | | } |
---|
112 | 101 | | else throw("Strict value is not equal to itself.") |
---|
113 | 102 | | } |
---|
114 | 103 | | |
---|
115 | 104 | | |
---|
116 | 105 | | @Verifier(tx) |
---|
117 | 106 | | func verify () = { |
---|
118 | | - | let testnet = (take(drop(this.bytes, 1), 1) == base58'2T') |
---|
119 | 107 | | let botPublicKey = getBinaryValue(factoryAddress, kBotPublicKey) |
---|
120 | 108 | | match tx { |
---|
121 | 109 | | case _: Order => |
---|
122 | 110 | | sigVerify(tx.bodyBytes, tx.proofs[0], botPublicKey) |
---|
123 | 111 | | case _: InvokeScriptTransaction => |
---|
124 | | - | if (isReady) |
---|
| 112 | + | if (isDefined(getBinary(this, kFactoryPublicKey))) |
---|
125 | 113 | | then false |
---|
126 | 114 | | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
127 | 115 | | case _ => |
---|
128 | | - | if (!(testnet)) |
---|
| 116 | + | if ((chainId == chainIdW)) |
---|
129 | 117 | | then false |
---|
130 | 118 | | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
131 | 119 | | } |
---|
132 | 120 | | } |
---|
133 | 121 | | |
---|