tx · 9v4qjRjJKqBWyxjDGtJ7XwH985SXTb2Y91riYqkD5rzp 3Mq6Xi74TdKAn4Tc2z94XFNFHW4wTzcjzrv: -0.01000000 Waves 2020.10.15 19:52 [1221950] smart account 3Mq6Xi74TdKAn4Tc2z94XFNFHW4wTzcjzrv > SELF 0.00000000 Waves
{ "type": 13, "id": "9v4qjRjJKqBWyxjDGtJ7XwH985SXTb2Y91riYqkD5rzp", "fee": 1000000, "feeAssetId": null, "timestamp": 1602780762958, "version": 2, "chainId": 84, "sender": "3Mq6Xi74TdKAn4Tc2z94XFNFHW4wTzcjzrv", "senderPublicKey": "oPX9GuojrJHmxZUmx5kbqpoAQjrH9rYhzbQv6bXVcvC", "proofs": [ "4y8jog2DHL3GNCwMAiSb4A4tM4YJw7VQoTThUTnb66EjjL89L3HJZS5DZR3v6jeuSLWkZNcTPqrM1oDcHsX56qeR" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAAHTXlUb2tlbgEAAAAgRcBshwjyRR7E4jbQIGP2jvCbtpj52Gvg2osXltv2/UMEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAAAAAAAAgkBAAAAB2V4dHJhY3QAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAAB015VG9rZW4HBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABkAAAAAgUAAAANY3VycmVudEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsCQAAAgAAAAECAAAAGENhbiBkZXBvc2l0IG9ubHkgTXlUb2tlbgAAAAFpAQAAAAh3aXRoZHJhdwAAAAEAAAAGYW1vdW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAUAAAAGYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAZhbW91bnQJAAACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAAxKV2K", "height": 1221950, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(a) | |
7 | + | func deposit () = { | |
8 | + | let b = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
9 | + | let c = extract(a.payment) | |
10 | + | if (if (isDefined(c.assetId)) | |
11 | + | then (extract(c.assetId) == b) | |
12 | + | else false) | |
13 | + | then { | |
14 | + | let d = toBase58String(a.caller.bytes) | |
15 | + | let e = { | |
16 | + | let f = getInteger(this, d) | |
17 | + | if ($isInstanceOf(f, "Int")) | |
18 | + | then { | |
19 | + | let g = f | |
20 | + | g | |
21 | + | } | |
22 | + | else 0 | |
23 | + | } | |
24 | + | let h = (e + c.amount) | |
25 | + | WriteSet([DataEntry(d, h)]) | |
26 | + | } | |
27 | + | else throw("Can deposit only MyToken") | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | @Callable(a) | |
33 | + | func withdraw (i) = { | |
34 | + | let d = toBase58String(a.caller.bytes) | |
35 | + | let e = { | |
36 | + | let f = getInteger(this, d) | |
37 | + | if ($isInstanceOf(f, "Int")) | |
38 | + | then { | |
39 | + | let g = f | |
40 | + | g | |
41 | + | } | |
42 | + | else 0 | |
43 | + | } | |
44 | + | let h = (e - i) | |
45 | + | if ((0 > i)) | |
46 | + | then throw("Can't withdraw negative amount") | |
47 | + | else if ((0 > h)) | |
48 | + | then throw("Not enough balance") | |
49 | + | else ScriptResult(WriteSet([DataEntry(d, h)]), TransferSet([ScriptTransfer(a.caller, i, unit)])) | |
50 | + | } | |
51 | + | ||
52 | + |
github/deemru/w8io/169f3d6 15.67 ms ◑