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