tx · BGyxbz3LakMbtVWoupUhJ5qPMvZ3iH3xAGvYNYBY687w 3MvUPcLYNFkmNzkA2h8jVU1fVK416VCT3hR: -0.01000000 Waves 2022.10.18 09:18 [2277463] smart account 3MvUPcLYNFkmNzkA2h8jVU1fVK416VCT3hR > SELF 0.00000000 Waves
{ "type": 13, "id": "BGyxbz3LakMbtVWoupUhJ5qPMvZ3iH3xAGvYNYBY687w", "fee": 1000000, "feeAssetId": null, "timestamp": 1666073725756, "version": 2, "chainId": 84, "sender": "3MvUPcLYNFkmNzkA2h8jVU1fVK416VCT3hR", "senderPublicKey": "GjnhUMpwQus4JiztKNVi1bLKtwBS2UT3YpxVyqsYB4KG", "proofs": [ "458EAHeUN3bkoC7kthFW9cVsysVqeZUgjQ5eaRWkjiVVQXxVXe5sVs9pjwkJ7Vo5DHHW6WxFFVuERZjr5KKbrw57" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAHbXlUb2tlbgAAAAAJAAUUAAAAAgkABEwAAAACCQAEQgAAAAUJAAEsAAAAAgIAAAAEU2h1YgkAAS8AAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMAAAAAAAAAAAYCAAAAAAAAAAAAAAGGoAAAAAAAAAAAAgYFAAAAA25pbAUAAAAEdW5pdAAAAAAE7IHj", "height": 2277463, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bk8x4497kZb54QMJmrgwRpXcTzCp2iKVJFvw8C93NcT7 Next: 7R9SCvKejozXgX9AZRQN5DgsFA7h65ZyMWWehANb9zSe Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 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 | - | } | |
7 | + | func myToken () = $Tuple2([Issue(("Shub" + take(toBase58String(i.caller.bytes), 6)), "", 100000, 2, true)], unit) | |
44 | 8 | ||
45 | 9 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 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 | - | } | |
7 | + | func myToken () = $Tuple2([Issue(("Shub" + take(toBase58String(i.caller.bytes), 6)), "", 100000, 2, true)], unit) | |
44 | 8 | ||
45 | 9 |
github/deemru/w8io/169f3d6 37.60 ms ◑