tx · Fu6ZcSwGqzzGkyrMF4SS99s5SXHZf5J6gXtHSG8gxfsv

3NBktgQbvQNKurqyDLPm6SVUUSoq7QqMhay:  -0.00100000 Waves

2022.08.02 15:35 [2166877] smart account 3NBktgQbvQNKurqyDLPm6SVUUSoq7QqMhay > SELF 0.00000000 Waves

{ "type": 13, "id": "Fu6ZcSwGqzzGkyrMF4SS99s5SXHZf5J6gXtHSG8gxfsv", "fee": 100000, "feeAssetId": null, "timestamp": 1659443651578, "version": 2, "chainId": 84, "sender": "3NBktgQbvQNKurqyDLPm6SVUUSoq7QqMhay", "senderPublicKey": "6Dpn4fndQzUDTXFhu2gHhhkrcfNC9nDsbnLof3eWAoSR", "proofs": [ "o7ChtRSzNjx8KqNJ3iYDM9HKjLrxTB5Ukocac8AkXh53Tj3aU7hhjkwANfYEPXi5dVodG7scLVSJw3NaaEqNKs6" ], "script": null, "height": 2166877, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4uMVuCAwh9qTvQQfBXGKkZ7oAqswok7PC9iPW93x1DXA Next: 8kN1rCweFnjARyFoVV2wQ1Ztd3hWs6dsZjNvVfANZC6r Full:
OldNewDifferences
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) = if ((index >= size(list)))
39- then acc
40- else {
41- let ind = toString(index)
42- (acc :+ match list[index] {
43- case b: Boolean =>
44- BooleanEntry((ind + "-bool"), b)
45- case b: ByteVector =>
46- BinaryEntry((ind + "-bin"), b)
47- case i: Int =>
48- IntegerEntry((ind + "-int"), i)
49- case s: String =>
50- StringEntry((ind + "-str"), s)
51- case _ =>
52- throw("Match error")
53- })
54- }
55-
56- ([BooleanEntry("bool", bool), BinaryEntry("bin", bin), IntegerEntry("int", int), StringEntry("str", str)] ++ {
57- let $l = indices
58- let $s = size($l)
59- let $acc0 = nil
60- func $f0_1 ($a,$i) = if (($i >= $s))
61- then $a
62- else convertList($a, $l[$i])
63-
64- func $f0_2 ($a,$i) = if (($i >= $s))
65- then $a
66- else throw("List size exceeds 5")
67-
68- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
69- })
70- }
71-
72-
1+# no script

github/deemru/w8io/169f3d6 
21.09 ms