tx · A7TxxgxVCGqwsQ1VBmpzkWabSjBNYf3X779oZJogdFwf 3N6oXVUcbvJaxDCzTRWGpabYBuT375H3Ny6: -0.01000000 Waves 2019.09.09 12:06 [668341] smart account 3N6oXVUcbvJaxDCzTRWGpabYBuT375H3Ny6 > SELF 0.00000000 Waves
{ "type": 13, "id": "A7TxxgxVCGqwsQ1VBmpzkWabSjBNYf3X779oZJogdFwf", "fee": 1000000, "feeAssetId": null, "timestamp": 1568019960432, "version": 1, "sender": "3N6oXVUcbvJaxDCzTRWGpabYBuT375H3Ny6", "senderPublicKey": "FpxGaYAJ2o1rBwgdKC2G7qXagFRBrz66PGu4CUAAMpr1", "proofs": [ "3sufTRLBBGd87eueof27jPdiuzKXaoMrKo8CHBkeepBmQGNYRHVo7EUsL3wjrSGZ1safuVywG4QgNvkoWtdQNkM1" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAgAAAAJ0eAEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAACdHgAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAWWW91IGNhbiB1c2UgV2F2ZXMgb25seQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAnR4AAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACW5ld0Ftb3VudAkAAGQAAAACBQAAAA1jdXJyZW50QW1vdW50CAUAAAADcG10AAAABmFtb3VudAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwAAAACdHgBAAAACHdpdGhkcmF3AAAAAQAAAAZhbW91bnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAJ0eAAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAUAAAAGYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAZhbW91bnQJAAACAAAAAQIAAAAeQ2FuYHQgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAnR4AAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleSkdtRI=", "chainId": 84, "height": 668341, "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(tx) | |
7 | + | func deposit () = { | |
8 | + | let pmt = extract(tx.payment) | |
9 | + | if (isDefined(pmt.assetId)) | |
10 | + | then throw("You can use Waves only") | |
11 | + | else { | |
12 | + | let currentKey = toBase58String(tx.caller.bytes) | |
13 | + | let currentAmount = match getInteger(this, currentKey) { | |
14 | + | case a: Int => | |
15 | + | a | |
16 | + | case _ => | |
17 | + | 0 | |
18 | + | } | |
19 | + | let newAmount = (currentAmount + pmt.amount) | |
20 | + | WriteSet([DataEntry(currentKey, newAmount)]) | |
21 | + | } | |
22 | + | } | |
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | @Callable(tx) | |
27 | + | func withdraw (amount) = { | |
28 | + | let currentKey = toBase58String(tx.caller.bytes) | |
29 | + | let currentAmount = match getInteger(this, currentKey) { | |
30 | + | case a: Int => | |
31 | + | a | |
32 | + | case _ => | |
33 | + | 0 | |
34 | + | } | |
35 | + | let newAmount = (currentAmount - amount) | |
36 | + | if ((0 > amount)) | |
37 | + | then throw("Can`t withdraw negative amount") | |
38 | + | else if ((0 > newAmount)) | |
39 | + | then throw("Not enough balance") | |
40 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(tx.caller, amount, unit)])) | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | @Verifier(tx) | |
45 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
46 | + |
github/deemru/w8io/169f3d6 16.93 ms ◑