tx · BZ3CUURmsGZsp9EUVuDLE2mnhYsqXSNiX6iE7qQCgBgk 3MrC1oqVCoLkfHabhJtrLJS6GxcooQwRWuP: -0.01400000 Waves 2019.11.13 16:05 [763338] smart account 3MrC1oqVCoLkfHabhJtrLJS6GxcooQwRWuP > SELF 0.00000000 Waves
{ "type": 13, "id": "BZ3CUURmsGZsp9EUVuDLE2mnhYsqXSNiX6iE7qQCgBgk", "fee": 1400000, "feeAssetId": null, "timestamp": 1573650355651, "version": 1, "sender": "3MrC1oqVCoLkfHabhJtrLJS6GxcooQwRWuP", "senderPublicKey": "3bmZaUZ9wp3K1YZQFqTkN1oZzumQPi7WLQ9QowMaqqEZ", "proofs": [ "5u4d8QaYMPEV5gXyaX7KPmbzzr99hGACTv6Y64zNFrksNb2wzF7UujT915ZzDTJJbvhRvWji435HHkUeBjUX4Ghf" ], "script": "base64:AAIDAAAAAAAAAA0IARIDCgEIEgQKAggBAAAAAgAAAAALdGlja2V0UHJpY2UAAAAAAAAAJxAAAAAABU1SVGlkAgAAACw4YWZZcmJEQnI2VHc1SmdhV1VnbTJHbmNZN3JMODdKdkdHN2FXZXpXTUdnWgAAAAIAAAAKY29udGV4dE9iagEAAAAJYnV5VGlja2V0AAAAAQAAAA1hZGRyZXNUb0xlYXNlBAAAAAdwYXltZW50BAAAAAckbWF0Y2gwCAUAAAAKY29udGV4dE9iagAAAAdwYXltZW50AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9BdHRhY2hlZFBheW1lbnQEAAAAAXAFAAAAByRtYXRjaDADAwkBAAAAAiE9AAAAAggFAAAAAXAAAAAGYW1vdW50BQAAAAt0aWNrZXRQcmljZQkAAAAAAAACCQACWAAAAAEJAQAAAAdleHRyYWN0AAAAAQgFAAAAAXAAAAAHYXNzZXRJZAUAAAAFTVJUaWQHBQAAAAFwCQAAAgAAAAECAAAAJkluY29ycmVjdCBhbW91bnQgb3IgYXNzZXRJZCBpbiBwYXltZW50CQAAAgAAAAECAAAAFFBheW1lbnQgbm90IGF0dGFjaGVkBAAAAA90aWNrZXRBbW91bnROZXcJAABkAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAMdGlja2V0QW1vdW50AAAAAAAAAAABCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAABnRpY2tldAkAAaQAAAABBQAAAA90aWNrZXRBbW91bnROZXcFAAAADWFkZHJlc1RvTGVhc2UJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAADHRpY2tldEFtb3VudAUAAAAPdGlja2V0QW1vdW50TmV3BQAAAANuaWwAAAAKY29udGV4dE9iagEAAAAJYWRkV2lubmVyAAAAAgAAAAdsb3R0ZXJ5AAAABnRpY2tldAQAAAAObG90dGVyeUFkZHJlc3MJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQUAAAAHbG90dGVyeQMJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAAB2xvdHRlcnkEAAAADXdpbm5lckFkZHJlc3MJAAQdAAAAAgUAAAAObG90dGVyeUFkZHJlc3MCAAAABndpbm5lcgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAANd2lubmluZ1RpY2tldAUAAAAGdGlja2V0BQAAAANuaWwJAAACAAAAAQIAAAAjeW91IHRvdWNoIGluY29ycmVjdCBsb3R0ZXJ5IGFkZHJlc3MAAAAAEol68w==", "chainId": 84, "height": 763338, "spentComplexity": 0 } View: original | compacted Prev: 8f8G8pLXNC7VaYnucsGhrigfXwuYVggS2NkbhwVdiJn9 Next: 3mjXY3uUg2Jrpk9YpHbJF2V7yBJTP1UhnRfboDRPQj6P Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | func buyTicket (addresToLease) = { | |
10 | 10 | let payment = match contextObj.payment { | |
11 | 11 | case p: AttachedPayment => | |
12 | - | if (if ((p.amount | |
13 | - | then (toBase58String(extract(p.assetId)) | |
12 | + | if (if ((p.amount != ticketPrice)) | |
13 | + | then (toBase58String(extract(p.assetId)) == MRTid) | |
14 | 14 | else false) | |
15 | 15 | then p | |
16 | 16 | else throw("Incorrect amount or assetId in payment") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ticketPrice = 10000 | |
5 | 5 | ||
6 | 6 | let MRTid = "8afYrbDBr6Tw5JgaWUgm2GncY7rL87JvGG7aWezWMGgZ" | |
7 | 7 | ||
8 | 8 | @Callable(contextObj) | |
9 | 9 | func buyTicket (addresToLease) = { | |
10 | 10 | let payment = match contextObj.payment { | |
11 | 11 | case p: AttachedPayment => | |
12 | - | if (if ((p.amount | |
13 | - | then (toBase58String(extract(p.assetId)) | |
12 | + | if (if ((p.amount != ticketPrice)) | |
13 | + | then (toBase58String(extract(p.assetId)) == MRTid) | |
14 | 14 | else false) | |
15 | 15 | then p | |
16 | 16 | else throw("Incorrect amount or assetId in payment") | |
17 | 17 | case _ => | |
18 | 18 | throw("Payment not attached") | |
19 | 19 | } | |
20 | 20 | let ticketAmountNew = (getIntegerValue(this, "ticketAmount") + 1) | |
21 | 21 | WriteSet([DataEntry(("ticket" + toString(ticketAmountNew)), addresToLease), DataEntry("ticketAmount", ticketAmountNew)]) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(contextObj) | |
27 | 27 | func addWinner (lottery,ticket) = { | |
28 | 28 | let lotteryAddress = extract(addressFromString(lottery)) | |
29 | 29 | if (isDefined(getString(this, lottery))) | |
30 | 30 | then { | |
31 | 31 | let winnerAddress = getString(lotteryAddress, "winner") | |
32 | 32 | WriteSet([DataEntry("winningTicket", ticket)]) | |
33 | 33 | } | |
34 | 34 | else throw("you touch incorrect lottery address") | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 |
github/deemru/w8io/169f3d6 40.21 ms ◑