tx · DDpUWDq62oidgqFWr8YRJax3Y7f8Q5UmYnsTkmPWrNZ8
3N5Ju64uTPuaR4M4f9YB5LRYRNJ382MWrat: -0.00600000 Waves
2022.09.29 17:50 [2250540] smart account 3N5Ju64uTPuaR4M4f9YB5LRYRNJ382MWrat > SELF 0.00000000 Waves
{
"type": 13,
"id": "DDpUWDq62oidgqFWr8YRJax3Y7f8Q5UmYnsTkmPWrNZ8",
"fee": 600000,
"feeAssetId": null,
"timestamp": 1664463004547,
"version": 2,
"chainId": 84,
"sender": "3N5Ju64uTPuaR4M4f9YB5LRYRNJ382MWrat",
"senderPublicKey": "AwWYbCDs6GDxAT6diG2mfEqD7tFz9JXu9k234FS135kR",
"proofs": [
"51xd7d4BWhvKbJEAfBzdcpPnCZ8WH4jAwPurDBVAAzZevL5kBtcJ8K2gRfTqVBbU8iYqRRPgQti25hrYb7mKRPTj"
],
"script": "base64:AAIFAAAAAAAAAAgIAhIECgIIAQAAAAYAAAAABXJ1bGVyAgAAACxCZ3hwQ200d3hiVzhTS0xQS1puZjRLVTJENlpVMjlvdjhNZ1pya2FTQXFwWQAAAAAIYm9ibWFfaWQCAAAALDV4eXJVb0p1WEpjWXhjOFJmcm9XajRRZUxhdzZ4aEJmQWRTcmVTdFlDUk1uAAAAAAhidWdnc19pZAIAAAAsSDVVVXVQSjdXQlh6amc2WjFhaEJVeGo3VldvVkZGZkczQk16eUFBblJXdDYBAAAADmdldEFzc2V0U3RyaW5nAAAAAQAAAAdhc3NldElkBAAAAAckbWF0Y2gwBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFiBQAAAAckbWF0Y2gwCQACWAAAAAEFAAAAAWICAAAABVdBVkVTAQAAAA1nZXRBc3NldEJ5dGVzAAAAAQAAAAdhc3NldElkAwkAAAAAAAACBQAAAAdhc3NldElkAgAAAAVXQVZFUwUAAAAEdW5pdAkAAlkAAAABBQAAAAdhc3NldElkAQAAAAlteUJhbGFuY2UAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAWIFAAAAByRtYXRjaDAJAAPwAAAAAgUAAAAEdGhpcwUAAAABYggJAAPvAAAAAQUAAAAEdGhpcwAAAAlhdmFpbGFibGUAAAABAAAAAWkBAAAABHN3YXAAAAACAAAACGFzc2V0T3V0AAAAB21pbmltdW0EAAAADWJvbWJhX2JhbGFuY2UJAQAAAAlteUJhbGFuY2UAAAABCQEAAAANZ2V0QXNzZXRCeXRlcwAAAAEFAAAACGJvYm1hX2lkBAAAAA1idWdnc19iYWxhbmNlCQEAAAAJbXlCYWxhbmNlAAAAAQkBAAAADWdldEFzc2V0Qnl0ZXMAAAABBQAAAAhidWdnc19pZAQAAAADcG10CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAAdhc3NldEluCQEAAAAFdmFsdWUAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQEAAAACGFtb3VudEluCQEAAAAFdmFsdWUAAAABCAUAAAADcG10AAAABmFtb3VudAQAAAAJYW1vdW50T3V0CQAAaAAAAAIFAAAACGFtb3VudEluAAAAAAAAAAACCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAJYW1vdW50T3V0CQEAAAANZ2V0QXNzZXRCeXRlcwAAAAEFAAAACGFzc2V0T3V0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tled/BcxI=",
"height": 2250540,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: E3QUQ9babF8rejcj5DDXAxMHN67K5QssFH7v9sASqs6v
Next: 3aELsFYUoLishK8tVoY9GcFBTJLqbfoVMkDwMMvEGXef
Diff:
Old | New | | Differences |
---|
30 | 30 | | |
---|
31 | 31 | | @Callable(i) |
---|
32 | 32 | | func swap (assetOut,minimum) = { |
---|
33 | | - | let callerPbk = toBase58String(i.callerPublicKey) |
---|
34 | | - | if ((callerPbk != ruler)) |
---|
35 | | - | then throw("No-no-no") |
---|
36 | | - | else { |
---|
37 | | - | let bomba_balance = myBalance(getAssetBytes(bobma_id)) |
---|
38 | | - | let buggs_balance = myBalance(getAssetBytes(buggs_id)) |
---|
39 | | - | let pmt = i.payments[0] |
---|
40 | | - | let assetIn = value(pmt.assetId) |
---|
41 | | - | let amountIn = value(pmt.amount) |
---|
42 | | - | let amountOut = (amountIn * 2) |
---|
| 33 | + | let bomba_balance = myBalance(getAssetBytes(bobma_id)) |
---|
| 34 | + | let buggs_balance = myBalance(getAssetBytes(buggs_id)) |
---|
| 35 | + | let pmt = i.payments[0] |
---|
| 36 | + | let assetIn = value(pmt.assetId) |
---|
| 37 | + | let amountIn = value(pmt.amount) |
---|
| 38 | + | let amountOut = (amountIn * 2) |
---|
43 | 39 | | [ScriptTransfer(i.caller, amountOut, getAssetBytes(assetOut))] |
---|
44 | | - | } |
---|
45 | 40 | | } |
---|
46 | 41 | | |
---|
47 | 42 | | |
---|
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 | 6 | | let bobma_id = "5xyrUoJuXJcYxc8RfroWj4QeLaw6xhBfAdSreStYCRMn" |
---|
7 | 7 | | |
---|
8 | 8 | | let buggs_id = "H5UUuPJ7WBXzjg6Z1ahBUxj7VWoVFFfG3BMzyAAnRWt6" |
---|
9 | 9 | | |
---|
10 | 10 | | func getAssetString (assetId) = match assetId { |
---|
11 | 11 | | case b: ByteVector => |
---|
12 | 12 | | toBase58String(b) |
---|
13 | 13 | | case _ => |
---|
14 | 14 | | "WAVES" |
---|
15 | 15 | | } |
---|
16 | 16 | | |
---|
17 | 17 | | |
---|
18 | 18 | | func getAssetBytes (assetId) = if ((assetId == "WAVES")) |
---|
19 | 19 | | then unit |
---|
20 | 20 | | else fromBase58String(assetId) |
---|
21 | 21 | | |
---|
22 | 22 | | |
---|
23 | 23 | | func myBalance (assetId) = match assetId { |
---|
24 | 24 | | case b: ByteVector => |
---|
25 | 25 | | assetBalance(this, b) |
---|
26 | 26 | | case _ => |
---|
27 | 27 | | wavesBalance(this).available |
---|
28 | 28 | | } |
---|
29 | 29 | | |
---|
30 | 30 | | |
---|
31 | 31 | | @Callable(i) |
---|
32 | 32 | | func swap (assetOut,minimum) = { |
---|
33 | | - | let callerPbk = toBase58String(i.callerPublicKey) |
---|
34 | | - | if ((callerPbk != ruler)) |
---|
35 | | - | then throw("No-no-no") |
---|
36 | | - | else { |
---|
37 | | - | let bomba_balance = myBalance(getAssetBytes(bobma_id)) |
---|
38 | | - | let buggs_balance = myBalance(getAssetBytes(buggs_id)) |
---|
39 | | - | let pmt = i.payments[0] |
---|
40 | | - | let assetIn = value(pmt.assetId) |
---|
41 | | - | let amountIn = value(pmt.amount) |
---|
42 | | - | let amountOut = (amountIn * 2) |
---|
| 33 | + | let bomba_balance = myBalance(getAssetBytes(bobma_id)) |
---|
| 34 | + | let buggs_balance = myBalance(getAssetBytes(buggs_id)) |
---|
| 35 | + | let pmt = i.payments[0] |
---|
| 36 | + | let assetIn = value(pmt.assetId) |
---|
| 37 | + | let amountIn = value(pmt.amount) |
---|
| 38 | + | let amountOut = (amountIn * 2) |
---|
43 | 39 | | [ScriptTransfer(i.caller, amountOut, getAssetBytes(assetOut))] |
---|
44 | | - | } |
---|
45 | 40 | | } |
---|
46 | 41 | | |
---|
47 | 42 | | |
---|
48 | 43 | | @Verifier(tx) |
---|
49 | 44 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
50 | 45 | | |
---|