tx · DKcu7BzHKrs3JtWuFfRXUP46nxCdSZaAQvRZdSouNGrF 3MzzEb4efYF2f3zKmwezJJx2VTK5WZw1GU2: -0.01000000 Waves 2019.06.29 16:37 [563484] smart account 3MzzEb4efYF2f3zKmwezJJx2VTK5WZw1GU2 > SELF 0.00000000 Waves
{ "type": 13, "id": "DKcu7BzHKrs3JtWuFfRXUP46nxCdSZaAQvRZdSouNGrF", "fee": 1000000, "feeAssetId": null, "timestamp": 1561815546684, "version": 1, "sender": "3MzzEb4efYF2f3zKmwezJJx2VTK5WZw1GU2", "senderPublicKey": "GzBa567pVnLWcVXEP3nA8p7SUTA8VYCArN5ErCUzdps7", "proofs": [ "LmNJzxMEyQTya5maQDLZL9c6Ad7EPxHxTaNCd7gG1zTwaTmev2uLKz42EgZu3g3NfYRCRAefMKjv2nTW8VX9VbC" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAAAd0b2tlbklkAgAAACxDTFVTUUNGa0V0V0hBZTFjS0JIZGNNSEsxY1pXdDR2VkRicTNGTmpNbTh2TAAAAAMAAAABaQEAAAAJZmxpcFRva2VuAAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAATY2FuIGhvbGQgVG9rZW4gT25seQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZAAAAAIFAAAADWN1cnJlbnRBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50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AAAABQAAAAZhbW91bnQJAAACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5gr+FWg==", "chainId": 84, "height": 563484, "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 | + | let tokenId = "CLUSQCFkEtWHAe1cKBHdcMHK1cZWt4vVDbq3FNjMm8vL" | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func flipToken () = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | if (!(isDefined(pmt.assetId))) | |
10 | + | then throw("can hold Token Only") | |
11 | + | else { | |
12 | + | let currentKey = toBase58String(i.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(i) | |
27 | + | func deposit () = { | |
28 | + | let pmt = extract(i.payment) | |
29 | + | if (isDefined(pmt.assetId)) | |
30 | + | then throw("can hold waves only at the moment") | |
31 | + | else { | |
32 | + | let currentKey = toBase58String(i.caller.bytes) | |
33 | + | let currentAmount = match getInteger(this, currentKey) { | |
34 | + | case a: Int => | |
35 | + | a | |
36 | + | case _ => | |
37 | + | 0 | |
38 | + | } | |
39 | + | let newAmount = (currentAmount + pmt.amount) | |
40 | + | WriteSet([DataEntry(currentKey, newAmount)]) | |
41 | + | } | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
47 | + | func withdraw (amount) = { | |
48 | + | let currentKey = toBase58String(i.caller.bytes) | |
49 | + | let currentAmount = match getInteger(this, currentKey) { | |
50 | + | case a: Int => | |
51 | + | a | |
52 | + | case _ => | |
53 | + | 0 | |
54 | + | } | |
55 | + | let newAmount = (currentAmount - amount) | |
56 | + | if ((0 > amount)) | |
57 | + | then throw("Can't withdraw negative amount") | |
58 | + | else if ((0 > newAmount)) | |
59 | + | then throw("Not enough balance") | |
60 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
61 | + | } | |
62 | + | ||
63 | + | ||
64 | + | @Verifier(tx) | |
65 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
66 | + |
github/deemru/w8io/026f985 20.66 ms ◑