tx · 3jbQSkvH9LFHzDAHaNL3nPeAnbj8k7BamxvoavxDiGea 3MuKvqQ5wQfi8baEeqzkmF95bEgiFaE1u8u: -0.02000000 Waves 2021.05.03 17:45 [1509655] smart account 3MuKvqQ5wQfi8baEeqzkmF95bEgiFaE1u8u > SELF 0.00000000 Waves
{ "type": 13, "id": "3jbQSkvH9LFHzDAHaNL3nPeAnbj8k7BamxvoavxDiGea", "fee": 2000000, "feeAssetId": null, "timestamp": 1620053134603, "version": 2, "chainId": 84, "sender": "3MuKvqQ5wQfi8baEeqzkmF95bEgiFaE1u8u", "senderPublicKey": "8YezcjKbhhibHoaqiSpQurGP2GZkvMSJyswo9XhW1Sxb", "proofs": [ "5GTSzZMcqxwuGYmiFSMLaSDjXSrmewMM9v2bin9KmuREXRaMfFLffE7jaSXPTuu2xYoHKNfPVa76zVu2u3U6ZbvM" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAAAgAAAAAHQXNzZXRJRAEAAAAgnEctJaOJqxi+IW+FiXnrdbHx7y+ZN53+hQd/WS7zjFoAAAAAC1N0YXJ0SGVpZ2h0AAAAAAAAAAAAAAAAAQAAAAFpAQAAAAt3aXRoZHJhd29vZAAAAAEAAAAIYXJndW1lbnQEAAAAAWEJAAS1AAAAAgUAAAAIYXJndW1lbnQCAAAAAS0EAAAACGhhc1ZhbHVlBAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAACGFyZ3VtZW50AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAAF0BQAAAAckbWF0Y2gwBQAAAAF0BwMJAQAAAAIhPQAAAAIJAAGRAAAAAgUAAAABYQAAAAAAAAAAAAIAAAAEV09PRAkAAAIAAAABAgAAABJOb3QgY29ycmVjdCBzdHJpbmcDBQAAAAhoYXNWYWx1ZQkAAAIAAAABAgAAAAhIYXMgaGFzaAkABEwAAAACCQEAAAAHUmVpc3N1ZQAAAAMFAAAAB0Fzc2V0SUQAAAAAADuaygAGCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAO5rKAAUAAAAHQXNzZXRJRAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAAIYXJndW1lbnQGBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tledBCa9E=", "height": 1509655, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HBR8MtVxWXhKrBsaNEmGwQtwST9jo2gYpLGQD7ovDYCy Next: AxV4Npk8yoXeaKibF4Zu2ZAscqf5a9HF8RBGSM35kjqG Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let AssetID = base58'BX3YsnjtX8GidrNzx1uYwK4fT2K7akupYgM3AMGqmu6h' | |
5 | 5 | ||
6 | - | @Callable(i) | |
7 | - | func deposit () = { | |
8 | - | let pmt = if ((size(i.payments) == 1)) | |
9 | - | then i.payments[0] | |
10 | - | else throw("Attached payment is required") | |
11 | - | if (isDefined(pmt.assetId)) | |
12 | - | then throw("works with waves only") | |
13 | - | else { | |
14 | - | let currentKey = toBase58String(i.caller.bytes) | |
15 | - | let currentAmount = match getInteger(this, currentKey) { | |
16 | - | case a: Int => | |
17 | - | a | |
18 | - | case _ => | |
19 | - | 0 | |
20 | - | } | |
21 | - | let newAmount = (currentAmount + pmt.amount) | |
22 | - | [IntegerEntry(currentKey, newAmount)] | |
23 | - | } | |
24 | - | } | |
25 | - | ||
26 | - | ||
27 | - | ||
28 | - | @Callable(i) | |
29 | - | func withdraw (amount) = { | |
30 | - | let currentKey = toBase58String(i.caller.bytes) | |
31 | - | let currentAmount = match getInteger(this, currentKey) { | |
32 | - | case a: Int => | |
33 | - | a | |
34 | - | case _ => | |
35 | - | 0 | |
36 | - | } | |
37 | - | let newAmount = (currentAmount - amount) | |
38 | - | if ((0 > amount)) | |
39 | - | then throw("Can't withdraw negative amount") | |
40 | - | else if ((0 > newAmount)) | |
41 | - | then throw("Not enough balance") | |
42 | - | else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)] | |
43 | - | } | |
44 | - | ||
45 | - | ||
6 | + | let StartHeight = 0 | |
46 | 7 | ||
47 | 8 | @Callable(i) | |
48 | 9 | func withdrawood (argument) = { | |
57 | 18 | then throw("Not correct string") | |
58 | 19 | else if (hasValue) | |
59 | 20 | then throw("Has hash") | |
60 | - | else [Reissue( | |
21 | + | else [Reissue(AssetID, 1000000000, true), ScriptTransfer(i.caller, 1000000000, AssetID), BooleanEntry(argument, true)] | |
61 | 22 | } | |
62 | 23 | ||
63 | 24 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let AssetID = base58'BX3YsnjtX8GidrNzx1uYwK4fT2K7akupYgM3AMGqmu6h' | |
5 | 5 | ||
6 | - | @Callable(i) | |
7 | - | func deposit () = { | |
8 | - | let pmt = if ((size(i.payments) == 1)) | |
9 | - | then i.payments[0] | |
10 | - | else throw("Attached payment is required") | |
11 | - | if (isDefined(pmt.assetId)) | |
12 | - | then throw("works with waves only") | |
13 | - | else { | |
14 | - | let currentKey = toBase58String(i.caller.bytes) | |
15 | - | let currentAmount = match getInteger(this, currentKey) { | |
16 | - | case a: Int => | |
17 | - | a | |
18 | - | case _ => | |
19 | - | 0 | |
20 | - | } | |
21 | - | let newAmount = (currentAmount + pmt.amount) | |
22 | - | [IntegerEntry(currentKey, newAmount)] | |
23 | - | } | |
24 | - | } | |
25 | - | ||
26 | - | ||
27 | - | ||
28 | - | @Callable(i) | |
29 | - | func withdraw (amount) = { | |
30 | - | let currentKey = toBase58String(i.caller.bytes) | |
31 | - | let currentAmount = match getInteger(this, currentKey) { | |
32 | - | case a: Int => | |
33 | - | a | |
34 | - | case _ => | |
35 | - | 0 | |
36 | - | } | |
37 | - | let newAmount = (currentAmount - amount) | |
38 | - | if ((0 > amount)) | |
39 | - | then throw("Can't withdraw negative amount") | |
40 | - | else if ((0 > newAmount)) | |
41 | - | then throw("Not enough balance") | |
42 | - | else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)] | |
43 | - | } | |
44 | - | ||
45 | - | ||
6 | + | let StartHeight = 0 | |
46 | 7 | ||
47 | 8 | @Callable(i) | |
48 | 9 | func withdrawood (argument) = { | |
49 | 10 | let a = split(argument, "-") | |
50 | 11 | let hasValue = match getBoolean(this, argument) { | |
51 | 12 | case t: Boolean => | |
52 | 13 | t | |
53 | 14 | case _ => | |
54 | 15 | false | |
55 | 16 | } | |
56 | 17 | if ((a[0] != "WOOD")) | |
57 | 18 | then throw("Not correct string") | |
58 | 19 | else if (hasValue) | |
59 | 20 | then throw("Has hash") | |
60 | - | else [Reissue( | |
21 | + | else [Reissue(AssetID, 1000000000, true), ScriptTransfer(i.caller, 1000000000, AssetID), BooleanEntry(argument, true)] | |
61 | 22 | } | |
62 | 23 | ||
63 | 24 | ||
64 | 25 | @Verifier(tx) | |
65 | 26 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
66 | 27 |
github/deemru/w8io/169f3d6 30.65 ms ◑![]()