tx · 13tPihNjwFEzEMywA2CKjrbTySd8KZuassJbxA5x7yw7 3MtBX7rmmQ2bwCn8MRwbY76eha1jXTyeobG: -0.01000000 Waves 2020.09.22 10:12 [1188207] smart account 3MtBX7rmmQ2bwCn8MRwbY76eha1jXTyeobG > SELF 0.00000000 Waves
{ "type": 13, "id": "13tPihNjwFEzEMywA2CKjrbTySd8KZuassJbxA5x7yw7", "fee": 1000000, "feeAssetId": null, "timestamp": 1600758788962, "version": 2, "chainId": 84, "sender": "3MtBX7rmmQ2bwCn8MRwbY76eha1jXTyeobG", "senderPublicKey": "3zeSYUKGNEmMpDhC3XZVmpx55zT5e3vhgH2nGXPcVtka", "proofs": [ "4ZLmkdHQU9MhnmcG9wTGGAjmpSDELbzc45rSN4sTd1Wx8Zts8HHzEHWp9d54wqTcPynnkef9LY2jcAA82cADGdP6" ], "script": "base64:AAIEAAAAAAAAAAoIAhIECgIBCBIAAAAABgAAAAAESlBZTgEAAAAgpkwt1dw/HjX4xz4uw1W7wTtHqP/hoq/OIPS85VScd2AAAAAABFVTRE4BAAAAICJkPx6+YEbpEWoTE9ymM/4Wfgf5d+mz8hX8mUkqMAo3AAAAAAdQQVI3UEFZAQAAACCXnW4Q/g8CyoQAfx9ug2MeGb+saXzue5DNzkjl0gdBIwAAAAAEUEFSNwEAAAAgzlhA/ZjitMWTd+McxVJoK0GcLLGrEdV8aco355LpR4wAAAAADm93bmVyUHVibGljS2V5AQAAACDW8r+QHNDEXX+7oojqOe4EcvIeuhvd8po2KJvI1DJFVAAAAAAMb3duZXJBZGRyZXNzAQAAABoBVLUktXdGD0Mfp/XD090jnmJadC38dDzuSAAAAAIAAAABaQEAAAAJYnV5VGlja2V0AAAAAgAAAApzd2FwQW1vdW50AAAACHRpY2tldElkBAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABEpQWU4JAAACAAAAAQI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aGRyYXcAAAAABAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACAAAAAAAAAAAABQAAAA1jdXJyZW50QW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAKY3VycmVudEtleQAAAAAAAAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADWN1cnJlbnRBbW91bnQFAAAABEpQWU4FAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tlebhuzDc=", "height": 1188207, "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 USDN = base58'3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC' | |
7 | + | ||
8 | + | let PAR7PAY = base58'BCqo4hvDBB2dzmidJQKkVtQtkgEQVVwMy1jjV4R4tNB4' | |
9 | + | ||
10 | + | let PAR7 = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
11 | + | ||
12 | + | let ownerPublicKey = base58'FU4wEpLzTjfekkKGGSaXKgBmP1LNJu6ewSw82z6AjoXH' | |
13 | + | ||
14 | + | let ownerAddress = base58'3N6Rt4Da5LZhkz28Upf5GXWwpWXGQxBcqDR' | |
15 | + | ||
16 | + | @Callable(i) | |
17 | + | func buyTicket (swapAmount,ticketId) = { | |
18 | + | let pmt = i.payments[0] | |
19 | + | if ((pmt.assetId != JPYN)) | |
20 | + | then throw("Payment with JPYN only") | |
21 | + | else { | |
22 | + | let currentKey = toBase58String(i.caller.bytes) | |
23 | + | let currentAmount = match getInteger(this, currentKey) { | |
24 | + | case a: Int => | |
25 | + | a | |
26 | + | case _ => | |
27 | + | 0 | |
28 | + | } | |
29 | + | let newAmount = (currentAmount + pmt.amount) | |
30 | + | let currentAddress = toBase58String(ownerAddress) | |
31 | + | let currentTotalAmount = match getInteger(this, currentAddress) { | |
32 | + | case a: Int => | |
33 | + | a | |
34 | + | case _ => | |
35 | + | 0 | |
36 | + | } | |
37 | + | let newTotalAmount = (currentTotalAmount + pmt.amount) | |
38 | + | let rateAmount = (pmt.amount * swapAmount) | |
39 | + | let ticket = toBytes(ticketId) | |
40 | + | [IntegerEntry(currentKey, newAmount), IntegerEntry(currentAddress, newTotalAmount), ScriptTransfer(i.caller, rateAmount, ticket)] | |
41 | + | } | |
42 | + | } | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
47 | + | func withdraw () = { | |
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 | + | if ((0 > currentAmount)) | |
56 | + | then throw("Can't withdraw negative amount") | |
57 | + | else [IntegerEntry(currentKey, 0), ScriptTransfer(i.caller, currentAmount, JPYN)] | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | @Verifier(tx) | |
62 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) | |
63 | + |
github/deemru/w8io/169f3d6 16.28 ms ◑