tx · 3jgTk36wFLEBiG1DHJRWJYWpLhrbu7ibGzbeV6ZNYrmE

3MsfPLcgQY8V3SpQss9hw5ydZ3SdoooQ9xy:  -0.00300000 Waves

2022.09.29 19:41 [2250656] smart account 3MsfPLcgQY8V3SpQss9hw5ydZ3SdoooQ9xy > SELF 0.00000000 Waves

{ "type": 13, "id": "3jgTk36wFLEBiG1DHJRWJYWpLhrbu7ibGzbeV6ZNYrmE", "fee": 300000, "feeAssetId": null, "timestamp": 1664469814588, "version": 2, "chainId": 84, "sender": "3MsfPLcgQY8V3SpQss9hw5ydZ3SdoooQ9xy", "senderPublicKey": "4mZ3UeajXYuJVqUiK9DfeKYAVuR279UJFfMQi4WBbBnf", "proofs": [ "5FLz2Wqw83UTD5hZR5RMPJ8fx4zA6qrJjsgPJmB1rAqfZwTyACdYUoJQy7tM4SMdHQuTRkqtoPTdurDu3WnenkUn" ], "script": "base64:AAIFAAAAAAAAAAwIAhIICgYICAgICAEAAAAGAAAAAAVydWxlcgIAAAAsQmd4cENtNHd4Ylc4U0tMUEtabmY0S1UyRDZaVTI5b3Y4TWdacmthU0FxcFkAAAAACGJvYm1hX2lkAgAAACw1eHlyVW9KdVhKY1l4YzhSZnJvV2o0UWVMYXc2eGhCZkFkU3JlU3RZQ1JNbgAAAAAIYnVnZ3NfaWQCAAAALEg1VVV1UEo3V0JYempnNloxYWhCVXhqN1ZXb1ZGRmZHM0JNenlBQW5SV3Q2AQAAAA5nZXRBc3NldFN0cmluZwAAAAEAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAUAAAAHYXNzZXRJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABYgUAAAAHJG1hdGNoMAkAAlgAAAABBQAAAAFiAgAAAAVXQVZFUwEAAAANZ2V0QXNzZXRCeXRlcwAAAAEAAAAHYXNzZXRJZAMJAAAAAAAAAgUAAAAHYXNzZXRJZAIAAAAFV0FWRVMFAAAABHVuaXQJAAJZAAAAAQ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R4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V59xpFwQ==", "height": 2250656, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 966iURjdFwRzoAnk3AdtLMob75U4ZycvuGRFvKLtMrtH Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let ruler = "BgxpCm4wxbW8SKLPKZnf4KU2D6ZU29ov8MgZrkaSAqpY"
5+
6+let bobma_id = "5xyrUoJuXJcYxc8RfroWj4QeLaw6xhBfAdSreStYCRMn"
7+
8+let buggs_id = "H5UUuPJ7WBXzjg6Z1ahBUxj7VWoVFFfG3BMzyAAnRWt6"
9+
10+func getAssetString (assetId) = match assetId {
11+ case b: ByteVector =>
12+ toBase58String(b)
13+ case _ =>
14+ "WAVES"
15+}
16+
17+
18+func getAssetBytes (assetId) = if ((assetId == "WAVES"))
19+ then unit
20+ else fromBase58String(assetId)
21+
22+
23+func myBalance (assetId) = match assetId {
24+ case b: ByteVector =>
25+ assetBalance(this, b)
26+ case _ =>
27+ wavesBalance(this).available
28+}
29+
30+
31+@Callable(i)
32+func trade (a,p1,p1t,p2,p2t,min) = {
33+ let callerPbk = toBase58String(i.callerPublicKey)
34+ if ((callerPbk != ruler))
35+ then throw("No-no-no")
36+ else {
37+ let pmt = i.payments[0]
38+ let assetIn = value(pmt.assetId)
39+ let amountIn = value(pmt.amount)
40+ let entry1 = if ((p1t == "p"))
41+ then invoke(Address(toBytes(p1)), "swap", [a, 0], [AttachedPayment(assetIn, amountIn)])
42+ else invoke(Address(toBytes(p1)), "exchange", [0], [AttachedPayment(assetIn, amountIn)])
43+ if ((entry1 == entry1))
44+ then {
45+ let nb = myBalance(getAssetBytes(a))
46+ let entry2 = if ((p1t == "p"))
47+ then invoke(Address(toBytes(p2)), "swap", [assetIn, 0], [AttachedPayment(getAssetBytes(a), nb)])
48+ else invoke(Address(toBytes(p2)), "exchange", [0], [AttachedPayment(getAssetBytes(a), nb)])
49+ if ((entry2 == entry2))
50+ then {
51+ let nb2 = myBalance(assetIn)
52+ if ((nb2 > amountIn))
53+ then [ScriptTransfer(i.caller, nb2, assetIn)]
54+ else throw(("Ooops, " + toString(nb2)))
55+ }
56+ else throw("Strict value is not equal to itself.")
57+ }
58+ else throw("Strict value is not equal to itself.")
59+ }
60+ }
61+
62+
63+@Verifier(tx)
64+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
65+

github/deemru/w8io/169f3d6 
16.86 ms