tx · GmdgqA7hjEkVvVm1yV5Wqy8mzuPGErsJTfsUavfQSwxy 3N1iBA7nz6KkAP7RaHtQxU3TC1io912SWBz: -0.00300000 Waves 2022.08.31 09:55 [2208295] smart account 3N1iBA7nz6KkAP7RaHtQxU3TC1io912SWBz > SELF 0.00000000 Waves
{ "type": 13, "id": "GmdgqA7hjEkVvVm1yV5Wqy8mzuPGErsJTfsUavfQSwxy", "fee": 300000, "feeAssetId": null, "timestamp": 1661928198309, "version": 2, "chainId": 84, "sender": "3N1iBA7nz6KkAP7RaHtQxU3TC1io912SWBz", "senderPublicKey": "upcZco3mz5KhMJ6hafUZU18QAKjN92atRHzDfYdeJJt", "proofs": [ "JHzDd1d6vAdq2EX3rue5mALnZKYVDZpRGge1eWoJ1y7eNmU8j7rbTPGMQtkrUnyZmaMt9X8YYArqK4izie2YoDA" ], "script": "base64:AAIFAAAAAAAAABIIAhIAEgMKAQESBwoFBAIBCB8AAAAAAAAAAwAAAANjdHgBAAAAB2RlcG9zaXQAAAAABAAAAANwbXQDCQAAZgAAAAIJAAGQAAAAAQgFAAAAA2N0eAAAAAhwYXltZW50cwAAAAAAAAAAAAkAAZEAAAACCAUAAAADY3R4AAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAHUF0IGxlYXN0IG9uZSBwYXltZW50IGV4cGVjdGVkBAAAAAdhc3NldElkAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkBAAAABXZhbHVlAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAG09ubHkgV0FWRVMgcGF5bWVudCBhY2NlcHRlZAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkABCUAAAABCAUAAAADY3R4AAAABmNhbGxlcggFAAAAA3BtdAAAAAZhbW91bnQFAAAAA25pbAAAAANjdHgBAAAACHdpdGhkcmF3AAAAAQAAAAZhbW91bnQEAAAAB2FkZHJlc3MJAAQlAAAAAQgF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AiRsBQAAAAIkaQoBAAAABSRmMF8yAAAAAgAAAAIkYQAAAAIkaQMJAABnAAAAAgUAAAACJGkFAAAAAiRzBQAAAAIkYQkAAAIAAAABAgAAABNMaXN0IHNpemUgZXhjZWVkcyA1CQEAAAAFJGYwXzIAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACBQAAAAUkYWNjMAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAgAAAAAAAAAAAwAAAAAAAAAABAAAAAAAAAAABQAAAABWejDo", "height": 2208295, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GBRLN5jvW1AYpxVYTXuEZsFvdaEP9mxdk4NAryARxodN Next: DBFu5uNFM8FXyqnof8rjuGA7YCvHqNomppJdvZ5ax3GA Full:
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(ctx) | |
7 | 7 | func deposit () = { | |
8 | 8 | let pmt = if ((size(ctx.payments) > 0)) | |
9 | 9 | then ctx.payments[0] | |
10 | 10 | else throw("At least one payment expected") | |
11 | 11 | let assetId = if (isDefined(pmt.assetId)) | |
12 | 12 | then value(pmt.assetId) | |
13 | 13 | else throw("Only WAVES payment accepted") | |
14 | 14 | [IntegerEntry(toString(ctx.caller), pmt.amount)] | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | ||
19 | 19 | @Callable(ctx) | |
20 | 20 | func withdraw (amount) = { | |
21 | 21 | let address = toString(ctx.caller) | |
22 | 22 | let current = valueOrErrorMessage(getInteger(this, address), "You don't have a deposit") | |
23 | 23 | let amt = if (if ((amount > 0)) | |
24 | 24 | then true | |
25 | 25 | else (amount > current)) | |
26 | 26 | then amount | |
27 | 27 | else throw("Amount to withdraw must be more than 0 and less than current deposit") | |
28 | 28 | if ((amount == current)) | |
29 | 29 | then [DeleteEntry(address)] | |
30 | 30 | else [IntegerEntry(address, (current - amount)), ScriptTransfer(ctx.caller, amount, unit)] | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(ctx) | |
36 | 36 | func allArgTypes (bool,bin,int,str,list) = { | |
37 | 37 | let indices = [1, 2, 3, 4, 5] | |
38 | 38 | func convertList (acc,index) = if ((index >= size(list))) | |
39 | 39 | then acc | |
40 | 40 | else { | |
41 | 41 | let ind = toString(index) | |
42 | 42 | (acc :+ match list[index] { | |
43 | 43 | case b: Boolean => | |
44 | 44 | BooleanEntry((ind + "-bool"), b) | |
45 | 45 | case b: ByteVector => | |
46 | 46 | BinaryEntry((ind + "-bin"), b) | |
47 | 47 | case i: Int => | |
48 | 48 | IntegerEntry((ind + "-int"), i) | |
49 | 49 | case s: String => | |
50 | 50 | StringEntry((ind + "-str"), s) | |
51 | 51 | case _ => | |
52 | 52 | throw("Match error") | |
53 | 53 | }) | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ([BooleanEntry("bool", bool), BinaryEntry("bin", bin), IntegerEntry("int", int), StringEntry("str", str)] ++ { | |
57 | 57 | let $l = indices | |
58 | 58 | let $s = size($l) | |
59 | 59 | let $acc0 = nil | |
60 | 60 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
61 | 61 | then $a | |
62 | 62 | else convertList($a, $l[$i]) | |
63 | 63 | ||
64 | 64 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
65 | 65 | then $a | |
66 | 66 | else throw("List size exceeds 5") | |
67 | 67 | ||
68 | 68 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
69 | 69 | }) | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 |
github/deemru/w8io/169f3d6 28.75 ms ◑