tx · 3iAiknBzHy3awW3WLFsHjE83DTcon6bFFi5WKCE2cmU7

3N4UVaMsBdLxk1bqBjYh6xxc9yqMj1Q1Hz1:  -0.00500000 Waves

2024.07.29 11:04 [3215114] smart account 3N4UVaMsBdLxk1bqBjYh6xxc9yqMj1Q1Hz1 > SELF 0.00000000 Waves

{ "type": 13, "id": "3iAiknBzHy3awW3WLFsHjE83DTcon6bFFi5WKCE2cmU7", "fee": 500000, "feeAssetId": null, "timestamp": 1722240290961, "version": 2, "chainId": 84, "sender": "3N4UVaMsBdLxk1bqBjYh6xxc9yqMj1Q1Hz1", "senderPublicKey": "BMDaTh98adjLnjo3x4684ChUrUJfXEcqNX4QjWvpZ37E", "proofs": [ "2KMv5d54JuN2eq5BXYHsNnYmdxgQTwzK6EAp3K7KspMH1QPchcLN1G64W9KdVakdNdHUZ1f6Mhc5tL9uxXPDNBXL" ], "script": "base64:BwI/CAISBAoCCAgSBAoCCAESBAoCCAQSBAoCCAISAwoBCBIFCgMCAQQSBAoCAgESBQoDAgECEgQKAgIBEgQKAgICIAAJc2VwYXJhdG9yAgJfXwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFcBAVcAEGNvbnRyYWN0RmlsZW5hbWUCFGZ1dHVyZXNfYWNjb3VudC5yaWRlAQd3cmFwRXJyAQFzCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBCHRocm93RXJyAQFzCQACAQkBB3dyYXBFcnIBBQFzAQttdXN0QWRkcmVzcwIBaQdhZGRyZXNzAwkAAAIIBQFpBmNhbGxlcgUHYWRkcmVzcwYJAQh0aHJvd0VycgECEXBlcm1pc3Npb24gZGVuaWVkAQhtdXN0VGhpcwEBaQkBC211c3RBZGRyZXNzAgUBaQUEdGhpcwALd2F2ZXNTdHJpbmcCBVdBVkVTAQxwYXJzZUFzc2V0SWQBBWlucHV0AwkAAAIFBWlucHV0BQt3YXZlc1N0cmluZwUEdW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iZSBzaWduZWQgYnkgYWNjb3VudCBvd25lciAJANgEAQUOb3duZXJQdWJsaWNLZXkFA25pbAMJAAACBQZjaGVja3MFBmNoZWNrcwYJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4DCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24DCQEJaXNEZWZpbmVkAQUWZmFjdG9yeVB1YmxpY0tleU9wdGlvbgcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkDCQAAAgUHY2hhaW5JZAUIY2hhaW5JZFcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJAQV2YWx1ZQEFFmZhY3RvcnlQdWJsaWNLZXlPcHRpb24JAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmIrW39", "height": 3215114, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 7 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let separator = "__"
5+
6+let chainId = take(drop(this.bytes, 1), 1)
7+
8+let chainIdW = base58'2W'
9+
10+let contractFilename = "futures_account.ride"
11+
12+func wrapErr (s) = ((contractFilename + ": ") + s)
13+
14+
15+func throwErr (s) = throw(wrapErr(s))
16+
17+
18+func mustAddress (i,address) = if ((i.caller == address))
19+ then true
20+ else throwErr("permission denied")
21+
22+
23+func mustThis (i) = mustAddress(i, this)
24+
25+
26+let wavesString = "WAVES"
27+
28+func parseAssetId (input) = if ((input == wavesString))
29+ then unit
30+ else fromBase58String(input)
31+
32+
33+func assetIdToString (input) = if ((input == unit))
34+ then wavesString
35+ else toBase58String(value(input))
36+
37+
38+let kFactoryPublicKey = "%s__factoryPublicKey"
39+
40+let kOwnerPublicKey = "%s__ownerPublicKey"
41+
42+func kAccountAddressToRequestId (accountAddress) = makeString(["%s%s", toString(accountAddress), "accountAddressToRequestId"], separator)
43+
44+
45+func kAccountOwner (requestId) = makeString(["%s%s", requestId, "ownerPublicKey"], separator)
46+
47+
48+func kRequestAmountAssetId (requestId) = makeString(["%s%s", requestId, "amountAssetId"], separator)
49+
50+
51+func kRequestPriceAssetId (requestId) = makeString(["%s%s", requestId, "priceAssetId"], separator)
52+
53+
54+let factoryAddress = addressFromPublicKey(getBinaryValue(this, kFactoryPublicKey))
55+
56+let kCalculatorAddress = "%s__calculatorAddress"
57+
58+let calculatorAddressOption = match getString(factoryAddress, kCalculatorAddress) {
59+ case s: String =>
60+ addressFromString(s)
61+ case _: Unit =>
62+ unit
63+ case _ =>
64+ throw("Match error")
65+}
66+
67+let calculatorAddress = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address"))
68+
69+let kMatcherPublicKey = "%s__matcherPublicKey"
70+
71+let matcherPublicKeyOption = match getString(factoryAddress, kMatcherPublicKey) {
72+ case s: String =>
73+ fromBase58String(s)
74+ case _: Unit =>
75+ unit
76+ case _ =>
77+ throw("Match error")
78+}
79+
80+let matcherPublicKey = valueOrErrorMessage(matcherPublicKeyOption, wrapErr("invalid matcher public key"))
81+
82+let requestId = getStringValue(factoryAddress, kAccountAddressToRequestId(this))
83+
84+let ownerPublicKey = getBinaryValue(factoryAddress, kAccountOwner(requestId))
85+
86+let ownerAddress = addressFromPublicKey(ownerPublicKey)
87+
88+let amountAssetId = parseAssetId(getStringValue(factoryAddress, kRequestAmountAssetId(requestId)))
89+
90+let priceAssetId = parseAssetId(getStringValue(factoryAddress, kRequestPriceAssetId(requestId)))
91+
92+func mustFactory (i) = mustAddress(i, factoryAddress)
93+
94+
95+func mustCalculator (i) = mustAddress(i, calculatorAddress)
96+
97+
98+func mustOwner (i) = mustAddress(i, ownerAddress)
99+
100+
101+@Callable(i)
102+func stringEntry (key,val) = if (mustCalculator(i))
103+ then $Tuple2([StringEntry(key, val)], key)
104+ else $Tuple2(nil, unit)
105+
106+
107+
108+@Callable(i)
109+func integerEntry (key,val) = if (mustCalculator(i))
110+ then $Tuple2([IntegerEntry(key, val)], key)
111+ else $Tuple2(nil, unit)
112+
113+
114+
115+@Callable(i)
116+func booleanEntry (key,val) = if (mustCalculator(i))
117+ then $Tuple2([BooleanEntry(key, val)], key)
118+ else $Tuple2(nil, unit)
119+
120+
121+
122+@Callable(i)
123+func binaryEntry (key,val) = if (mustCalculator(i))
124+ then $Tuple2([BinaryEntry(key, val)], key)
125+ else $Tuple2(nil, unit)
126+
127+
128+
129+@Callable(i)
130+func deleteEntry (key) = if (mustCalculator(i))
131+ then $Tuple2([DeleteEntry(key)], key)
132+ else $Tuple2(nil, unit)
133+
134+
135+
136+@Callable(i)
137+func reissue (assetId,amount,reissuable) = if (mustCalculator(i))
138+ then $Tuple2([Reissue(assetId, amount, reissuable)], amount)
139+ else $Tuple2(nil, unit)
140+
141+
142+
143+@Callable(i)
144+func burn (assetId,amount) = if (mustCalculator(i))
145+ then $Tuple2([Burn(assetId, amount)], amount)
146+ else $Tuple2(nil, unit)
147+
148+
149+
150+@Callable(i)
151+func transferAsset (recipientBytes,amount,assetId) = if (mustCalculator(i))
152+ then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount)
153+ else $Tuple2(nil, unit)
154+
155+
156+
157+@Callable(i)
158+func transferWaves (recipientBytes,amount) = if (mustCalculator(i))
159+ then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount)
160+ else $Tuple2(nil, unit)
161+
162+
163+
164+@Callable(i)
165+func init (factoryPublicKey,creatorPublicKey) = {
166+ let checkCaller = mustThis(i)
167+ if ((checkCaller == checkCaller))
168+ then {
169+ let completeRequest = invoke(addressFromPublicKey(factoryPublicKey), "call", ["addAccount", [toBase58String(creatorPublicKey)]], nil)
170+ if ((completeRequest == completeRequest))
171+ then $Tuple2([BinaryEntry(kFactoryPublicKey, factoryPublicKey)], unit)
172+ else throw("Strict value is not equal to itself.")
173+ }
174+ else throw("Strict value is not equal to itself.")
175+ }
176+
177+
178+@Verifier(tx)
179+func verify () = {
180+ let factoryPublicKeyOption = getBinary(this, kFactoryPublicKey)
181+ match tx {
182+ case o: Order =>
183+ let checks = [if ((o.matcherPublicKey == matcherPublicKey))
184+ then true
185+ else throwErr(("matcher public key must be " + toBase58String(matcherPublicKey))), if ((o.assetPair.amountAsset == amountAssetId))
186+ then true
187+ else throwErr(("amount asset id have must be " + assetIdToString(amountAssetId))), if ((o.assetPair.priceAsset == priceAssetId))
188+ then true
189+ else throwErr(("price asset id have must be" + assetIdToString(priceAssetId))), if (sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey))
190+ then true
191+ else throwErr(("tx have must be signed by account owner " + toBase58String(ownerPublicKey)))]
192+ if ((checks == checks))
193+ then true
194+ else throw("Strict value is not equal to itself.")
195+ case _: InvokeScriptTransaction =>
196+ if (isDefined(factoryPublicKeyOption))
197+ then false
198+ else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
199+ case _ =>
200+ if ((chainId == chainIdW))
201+ then sigVerify(tx.bodyBytes, tx.proofs[0], value(factoryPublicKeyOption))
202+ else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
203+ }
204+ }
205+

github/deemru/w8io/026f985 
18.02 ms