tx · 2D83yC4yfMtTZn5621LijY6tTByi1hR7n4ejG4dNe5gH 3N8UuPS2A64qPqpmRVtp6fzzLM2BYfzFivU: -0.01000000 Waves 2020.09.18 11:02 [1182467] smart account 3N8UuPS2A64qPqpmRVtp6fzzLM2BYfzFivU > SELF 0.00000000 Waves
{ "type": 13, "id": "2D83yC4yfMtTZn5621LijY6tTByi1hR7n4ejG4dNe5gH", "fee": 1000000, "feeAssetId": null, "timestamp": 1600416122327, "version": 2, "chainId": 84, "sender": "3N8UuPS2A64qPqpmRVtp6fzzLM2BYfzFivU", "senderPublicKey": "Fz26PTYjZQxYwkspbEWEikdfX6PYPyNdfaoEF2Fg3zSC", "proofs": [ "3315V7Q69SN3f2zenZgnqYSo1iEShZcXgsfWxBuvwVtufmz6zbCqcJTdUC1ZJaDQCAyQ4HQ3w23TUK146ekF3ABu" ], "script": "base64:AAIEAAAAAAAAAAoIAhIECgIBCBIAAAAABQAAAAAESlBZTgEAAAAgpkwt1dw/HjX4xz4uw1W7wTtHqP/hoq/OIPS85VScd2AAAAAAB1BBUjdQQVkBAAAAIJedbhD+DwLKhAB/H26DYx4Zv6xpfO57kM3OSOXSB0EjAAAAAARQQVI3AQAAACDOWED9mOK0xZN34xzFUmgrQZwssasR1XxpyjfnkulHjAAAAAAOb3duZXJQdWJsaWNLZXkBAAAAINbyv5Ac0MRdf7uiiOo57gRy8h66G93ymjYom8jUMkVUAAAAAAxvd25lckFkZHJlc3MBAAAAGgFUtSS1d0YPQx+n9cPT3SOeYlp0Lfx0PO5IAAAAAgAAAAFpAQAAAAlidXlUaWNrZXQAAAACAAAACnN3YXBBbW91bnQAAAAIdGlja2V0SWQEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAEUEFSNwkAAAIAAAABAgAAABR3b3JrcyB3aXRoIFBBUjcgb25seQQAAAAKY3VycmVudEtleQkA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AZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACAAAAAAAAAAAABQAAAA1jdXJyZW50QW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAKY3VycmVudEtleQAAAAAAAAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADWN1cnJlbnRBbW91bnQFAAAABFBBUjcFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tleXYA3xU=", "height": 1182467, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let JPYN = base58'CCA3xSCed22LYv22gZ646XjKQikbGYRe49StqbrSkNEK' | |
5 | + | ||
6 | + | let PAR7PAY = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4' | |
7 | + | ||
8 | + | let PAR7 = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
9 | + | ||
10 | + | let ownerPublicKey = base58'FU4wEpLzTjfekkKGGSaXKgBmP1LNJu6ewSw82z6AjoXH' | |
11 | + | ||
12 | + | let ownerAddress = base58'3N6Rt4Da5LZhkz28Upf5GXWwpWXGQxBcqDR' | |
13 | + | ||
14 | + | @Callable(i) | |
15 | + | func buyTicket (swapAmount,ticketId) = { | |
16 | + | let pmt = i.payments[0] | |
17 | + | if ((pmt.assetId != PAR7)) | |
18 | + | then throw("works with PAR7 only") | |
19 | + | else { | |
20 | + | let currentKey = toBase58String(i.caller.bytes) | |
21 | + | let currentAmount = match getInteger(this, currentKey) { | |
22 | + | case a: Int => | |
23 | + | a | |
24 | + | case _ => | |
25 | + | 0 | |
26 | + | } | |
27 | + | let newAmount = (currentAmount + pmt.amount) | |
28 | + | let currentAddress = toBase58String(ownerAddress) | |
29 | + | let currentTotalAmount = match getInteger(this, currentAddress) { | |
30 | + | case a: Int => | |
31 | + | a | |
32 | + | case _ => | |
33 | + | 0 | |
34 | + | } | |
35 | + | let newTotalAmount = (currentTotalAmount + pmt.amount) | |
36 | + | let rateAmount = (pmt.amount * swapAmount) | |
37 | + | let ticket = toBytes(ticketId) | |
38 | + | [IntegerEntry(currentKey, newAmount), IntegerEntry(currentAddress, newTotalAmount), ScriptTransfer(i.caller, rateAmount, ticket)] | |
39 | + | } | |
40 | + | } | |
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | @Callable(i) | |
45 | + | func withdraw () = { | |
46 | + | let currentKey = toBase58String(i.caller.bytes) | |
47 | + | let currentAmount = match getInteger(this, currentKey) { | |
48 | + | case a: Int => | |
49 | + | a | |
50 | + | case _ => | |
51 | + | 0 | |
52 | + | } | |
53 | + | if ((0 > currentAmount)) | |
54 | + | then throw("Can't withdraw negative amount") | |
55 | + | else [IntegerEntry(currentKey, 0), ScriptTransfer(i.caller, currentAmount, PAR7)] | |
56 | + | } | |
57 | + | ||
58 | + | ||
59 | + | @Verifier(tx) | |
60 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
61 | + |
github/deemru/w8io/169f3d6 23.66 ms ◑