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