tx · 6vVHmgqPevTKeDZUg8j8CKm6MrUqptfsDDJVz2gVyM28
3N5Ju64uTPuaR4M4f9YB5LRYRNJ382MWrat: -0.00600000 Waves
2022.09.29 17:19 [2250507] smart account 3N5Ju64uTPuaR4M4f9YB5LRYRNJ382MWrat > SELF 0.00000000 Waves
{
"type": 13,
"id": "6vVHmgqPevTKeDZUg8j8CKm6MrUqptfsDDJVz2gVyM28",
"fee": 600000,
"feeAssetId": null,
"timestamp": 1664461218483,
"version": 2,
"chainId": 84,
"sender": "3N5Ju64uTPuaR4M4f9YB5LRYRNJ382MWrat",
"senderPublicKey": "AwWYbCDs6GDxAT6diG2mfEqD7tFz9JXu9k234FS135kR",
"proofs": [
"61RBfhfbWfh6tY96qcd71oAiskxdRTmHPgaEHLmW1wL67AQDr9Df67TtAMV3fBBfV4NjstanB1q1TMSQLzjxyuVw"
],
"script": "base64:AAIFAAAAAAAAAAgIAhIECgIIAQAAAAYAAAAABXJ1bGVyAgAAACxCZ3hwQ200d3hiVzhTS0xQS1puZjRLVTJENlpVMjlvdjhNZ1pya2FTQXFwWQAAAAAIYm9ibWFfaWQCAAAALDV4eXJVb0p1WEpjWXhjOFJmcm9XajRRZUxhdzZ4aEJmQWRTcmVTdFlDUk1uAAAAAAhidWdnc19pZAIAAAAsSDVVVXVQSjdXQlh6amc2WjFhaEJVeGo3VldvVkZGZkczQk16eUFBblJXdDYBAAAADmdldEFzc2V0U3RyaW5nAAAAAQAAAAdhc3NldElkBAAAAAckbWF0Y2gwBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFiBQAAAAckbWF0Y2gwCQACWAAAAAEFAAAAAWICAAAABVdBVkVTAQAAAA1nZXRBc3NldEJ5dGVzAAAAAQAAAAdhc3NldElkAwkAAAAAAAACBQAAAAdhc3NldElkAgAAAAVXQVZFUwUAAAAEdW5pdAkAAlkAAAABBQAAAAdhc3NldElkAQAAAAlteUJhbGFuY2UAA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AJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkebZMX",
"height": 2250507,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 81e4Gtet1Y441sNrCHBTSb8THfNyNdhy1W91pLxRJMD7
Next: E3QUQ9babF8rejcj5DDXAxMHN67K5QssFH7v9sASqs6v
Diff:
Old | New | | Differences |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let ruler = "BgxpCm4wxbW8SKLPKZnf4KU2D6ZU29ov8MgZrkaSAqpY" |
---|
5 | 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 | + | |
---|
6 | 31 | | @Callable(i) |
---|
7 | 32 | | func swap (assetOut,minimum) = { |
---|
8 | 33 | | let caller = toString(i.caller) |
---|
9 | 34 | | let callerPbk = toBase58String(i.callerPublicKey) |
---|
| 35 | + | let bomba_balance = myBalance(getAssetBytes(bobma_id)) |
---|
| 36 | + | let buggs_balance = myBalance(getAssetBytes(buggs_id)) |
---|
10 | 37 | | if ((callerPbk == ruler)) |
---|
11 | | - | then throw(((((("No-no-no " + callerPbk) + ", ") + ruler) + ", ") + caller)) |
---|
| 38 | + | then throw(((("No-no-no bomba: " + toString(bomba_balance)) + ", buggs: ") + toString(buggs_balance))) |
---|
12 | 39 | | else { |
---|
13 | 40 | | let pmt = i.payments[0] |
---|
14 | 41 | | let assetIn = value(pmt.assetId) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let ruler = "BgxpCm4wxbW8SKLPKZnf4KU2D6ZU29ov8MgZrkaSAqpY" |
---|
5 | 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 | + | |
---|
6 | 31 | | @Callable(i) |
---|
7 | 32 | | func swap (assetOut,minimum) = { |
---|
8 | 33 | | let caller = toString(i.caller) |
---|
9 | 34 | | let callerPbk = toBase58String(i.callerPublicKey) |
---|
| 35 | + | let bomba_balance = myBalance(getAssetBytes(bobma_id)) |
---|
| 36 | + | let buggs_balance = myBalance(getAssetBytes(buggs_id)) |
---|
10 | 37 | | if ((callerPbk == ruler)) |
---|
11 | | - | then throw(((((("No-no-no " + callerPbk) + ", ") + ruler) + ", ") + caller)) |
---|
| 38 | + | then throw(((("No-no-no bomba: " + toString(bomba_balance)) + ", buggs: ") + toString(buggs_balance))) |
---|
12 | 39 | | else { |
---|
13 | 40 | | let pmt = i.payments[0] |
---|
14 | 41 | | let assetIn = value(pmt.assetId) |
---|
15 | 42 | | let amountIn = value(pmt.amount) |
---|
16 | 43 | | [IntegerEntry("op", 1)] |
---|
17 | 44 | | } |
---|
18 | 45 | | } |
---|
19 | 46 | | |
---|
20 | 47 | | |
---|
21 | 48 | | @Verifier(tx) |
---|
22 | 49 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
23 | 50 | | |
---|