tx · 5wH1DbL5DZ4Lf7o2ZXFg7Xhk4aS2Ha8YPJcWA7vMXimh 3N4i3G2EdWNjLewRyPASraLZDLU98iZqp5B: -0.01400000 Waves 2020.11.25 11:39 [1280697] smart account 3N4i3G2EdWNjLewRyPASraLZDLU98iZqp5B > SELF 0.00000000 Waves
{ "type": 13, "id": "5wH1DbL5DZ4Lf7o2ZXFg7Xhk4aS2Ha8YPJcWA7vMXimh", "fee": 1400000, "feeAssetId": null, "timestamp": 1606293607717, "version": 2, "chainId": 84, "sender": "3N4i3G2EdWNjLewRyPASraLZDLU98iZqp5B", "senderPublicKey": "837cMoxDMWe57Su67yzZSTmUoj7HkvcMiJw94P8WSG9m", "proofs": [ "3MZU6id7DLuyMPvW4aTCHXY3DxgGcBK2ToKuZvpxnf6aJnrExYesTwj1DdA2n4dXw4pbGQqtWSBnWobCqaCZGvPf" ], "script": "base64:AAIEAAAAAAAAAAkIAhIAEgMKAQEAAAACAAAAAAROT05FAgAAAARub25lAAAAAAdteUFzc2V0AQAAACA/VuWCpRDHaZvfSuThWYz2ZLDampw1x4St1VF6zkzElwAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMDCQEAAAACIT0AAAACCAkAAZEAAAACBQAAAANwbXQAAAAAAAAAAAAAAAAHYXNzZXRJZAUAAAAHbXlBc3NldAkAAAIAAAABAgAAAENXcm9uZyBhc3NldCwgcmVxdWlyZWQ6IDVHRlk4UXNLY3JZcjN5U1JRQ2FKN3dSaVk2ZlZmSFRyb1lNQlF3MW1EdkM2BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQA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": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: GgGwUdS3bKLd9WqVwziK65qB9WzXgJW24c5eUci1iLpc Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let NONE = "none" | |
5 | + | ||
6 | + | let myAsset = base58'5GFY8QsKcrYr3ySRQCaJ7wRiY6fVfHTroYMBQw1mDvC6' | |
7 | + | ||
8 | + | @Callable(i) | |
9 | + | func deposit () = { | |
10 | + | let pmt = value(i.payments) | |
11 | + | if ((pmt[0].assetId != myAsset)) | |
12 | + | then throw("Wrong asset, required: 5GFY8QsKcrYr3ySRQCaJ7wRiY6fVfHTroYMBQw1mDvC6") | |
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[0].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("negative amount!") | |
40 | + | else if ((0 > newAmount)) | |
41 | + | then throw("not enough balance") | |
42 | + | else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, myAsset)] | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | @Verifier(tx) | |
47 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
48 | + |
github/deemru/w8io/169f3d6 18.57 ms ◑