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:BgInCAISBAoCCAgSBAoCCAESBQoDAgECEgQKAgIBEgQKAgICEgQKAggYEwAJc2VwYXJhdG9yAgJfXwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFQBAVQACGNoYWluSWRXAQFXAQttdXN0QWRkcmVzcwIBaQdhZGRyZXNzAwkAAAIIBQFpBmNhbGxlcgUHYWRkcmVzcwYJAAIBAhFwZXJtaXNzaW9uIGRlbmllZAEIbXVzdFRoaXMBAWkJAQttdXN0QWRkcmVzcwIFAWkFBHRoaXMAEWtGYWN0b3J5UHVibGljS2V5AhQlc19fZmFjdG9yeVB1YmxpY0tleQARa1NlcnZpY2VQdWJsaWNLZXkCFCVzX19zZXJ2aWNlUHVibGljS2V5AA9rT3duZXJQdWJsaWNLZXkCEiVzX19vd25lclB1YmxpY0tleQANa0JvdFB1YmxpY0tleQIQJXNfX2JvdFB1YmxpY0tleQEaa0FjY291bnRBZGRyZXNzVG9SZXF1ZXN0SWQBDmFjY291bnRBZGRyZXNzCQC5CQIJAMwIAgIEJXMlcwkAzAgCCQClCAE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rQ2FsbGVyBAZyZXN1bHQJAP0HBAUOc2VydmljZUFkZHJlc3MFCGZ1bmN0aW9uCQDMCAIFBGFyZ3MFA25pbAgFAWkIcGF5bWVudHMJAJQKAgUDbmlsBQZyZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAxib3RQdWJsaWNLZXkJARFAZXh0ck5hdGl2ZSgxMDUyKQIFDmZhY3RvcnlBZGRyZXNzBQ1rQm90UHVibGljS2V5BAckbWF0Y2gwBQJ0eAMJAAECBQckbWF0Y2gwAgVPcmRlcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYm90UHVibGljS2V5AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uAwkBCWlzRGVmaW5lZAEJAJwIAgUEdGhpcwURa0ZhY3RvcnlQdWJsaWNLZXkHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5AwkAAAIFB2NoYWluSWQFCGNoYWluSWRXBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tled78w9w=", "height": 2863291, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 69QZEWwvi8EN6A2fHsCMUChc3S4xo1TJHfUjithqk1M3 Next: none Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# 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+
420 let kFactoryPublicKey = "%s__factoryPublicKey"
521
622 let kServicePublicKey = "%s__servicePublicKey"
925
1026 let kBotPublicKey = "%s__botPublicKey"
1127
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+
1333
1434 let factoryAddress = addressFromPublicKey(getBinaryValue(this, kFactoryPublicKey))
1535
1636 let serviceAddress = addressFromPublicKey(getBinaryValue(factoryAddress, kServicePublicKey))
1737
18-let ownerAddress = addressFromPublicKey(getBinaryValue(this, kOwnerPublicKey))
38+let accountId = getStringValue(factoryAddress, kAccountAddressToRequestId(this))
1939
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))
2541
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)
3343
3444 func mustService (i) = mustAddress(i, serviceAddress)
3545
3646
3747 func mustOwner (i) = mustAddress(i, ownerAddress)
38-
39-
40-func mustFactory (i) = mustAddress(i, factoryAddress)
4148
4249
4350 @Callable(i)
6976
7077
7178 @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) = {
8380 let checkCaller = mustThis(i)
8481 if ((checkCaller == checkCaller))
8582 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.")
8887 }
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)
9988 else throw("Strict value is not equal to itself.")
10089 }
10190
115104
116105 @Verifier(tx)
117106 func verify () = {
118- let testnet = (take(drop(this.bytes, 1), 1) == base58'2T')
119107 let botPublicKey = getBinaryValue(factoryAddress, kBotPublicKey)
120108 match tx {
121109 case _: Order =>
122110 sigVerify(tx.bodyBytes, tx.proofs[0], botPublicKey)
123111 case _: InvokeScriptTransaction =>
124- if (isReady)
112+ if (isDefined(getBinary(this, kFactoryPublicKey)))
125113 then false
126114 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
127115 case _ =>
128- if (!(testnet))
116+ if ((chainId == chainIdW))
129117 then false
130118 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
131119 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# 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+
420 let kFactoryPublicKey = "%s__factoryPublicKey"
521
622 let kServicePublicKey = "%s__servicePublicKey"
723
824 let kOwnerPublicKey = "%s__ownerPublicKey"
925
1026 let kBotPublicKey = "%s__botPublicKey"
1127
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+
1333
1434 let factoryAddress = addressFromPublicKey(getBinaryValue(this, kFactoryPublicKey))
1535
1636 let serviceAddress = addressFromPublicKey(getBinaryValue(factoryAddress, kServicePublicKey))
1737
18-let ownerAddress = addressFromPublicKey(getBinaryValue(this, kOwnerPublicKey))
38+let accountId = getStringValue(factoryAddress, kAccountAddressToRequestId(this))
1939
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))
2541
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)
3343
3444 func mustService (i) = mustAddress(i, serviceAddress)
3545
3646
3747 func mustOwner (i) = mustAddress(i, ownerAddress)
38-
39-
40-func mustFactory (i) = mustAddress(i, factoryAddress)
4148
4249
4350 @Callable(i)
4451 func stringEntry (key,val) = if (mustService(i))
4552 then $Tuple2([StringEntry(key, val)], key)
4653 else $Tuple2(nil, unit)
4754
4855
4956
5057 @Callable(i)
5158 func integerEntry (key,val) = if (mustService(i))
5259 then $Tuple2([IntegerEntry(key, val)], key)
5360 else $Tuple2(nil, unit)
5461
5562
5663
5764 @Callable(i)
5865 func transferAsset (recipientBytes,amount,assetId) = if (mustService(i))
5966 then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount)
6067 else $Tuple2(nil, unit)
6168
6269
6370
6471 @Callable(i)
6572 func transferWaves (recipientBytes,amount) = if (mustService(i))
6673 then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount)
6774 else $Tuple2(nil, unit)
6875
6976
7077
7178 @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) = {
8380 let checkCaller = mustThis(i)
8481 if ((checkCaller == checkCaller))
8582 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.")
8887 }
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)
9988 else throw("Strict value is not equal to itself.")
10089 }
10190
10291
10392
10493 @Callable(i)
10594 func call (function,args) = {
10695 let checkCaller = mustOwner(i)
10796 if ((checkCaller == checkCaller))
10897 then {
10998 let result = reentrantInvoke(serviceAddress, function, [args], i.payments)
11099 $Tuple2(nil, result)
111100 }
112101 else throw("Strict value is not equal to itself.")
113102 }
114103
115104
116105 @Verifier(tx)
117106 func verify () = {
118- let testnet = (take(drop(this.bytes, 1), 1) == base58'2T')
119107 let botPublicKey = getBinaryValue(factoryAddress, kBotPublicKey)
120108 match tx {
121109 case _: Order =>
122110 sigVerify(tx.bodyBytes, tx.proofs[0], botPublicKey)
123111 case _: InvokeScriptTransaction =>
124- if (isReady)
112+ if (isDefined(getBinary(this, kFactoryPublicKey)))
125113 then false
126114 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
127115 case _ =>
128- if (!(testnet))
116+ if ((chainId == chainIdW))
129117 then false
130118 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
131119 }
132120 }
133121

github/deemru/w8io/026f985 
29.94 ms