tx · 7217WYestxuoVxtWZbt3ZJPp3HypBYcuFUSseP1uRpav 3Mp1GGUhbaJVu7Eaf8bKMGr3B29GVjrketT: -0.01400000 Waves 2019.11.14 11:35 [764500] smart account 3Mp1GGUhbaJVu7Eaf8bKMGr3B29GVjrketT > SELF 0.00000000 Waves
{ "type": 13, "id": "7217WYestxuoVxtWZbt3ZJPp3HypBYcuFUSseP1uRpav", "fee": 1400000, "feeAssetId": null, "timestamp": 1573720503198, "version": 1, "sender": "3Mp1GGUhbaJVu7Eaf8bKMGr3B29GVjrketT", "senderPublicKey": "DbiR14ueb9NPcXN29auNX8QYMDkJ1f1K4wZwA1aYrJmy", "proofs": [ "2ikvFAbacKtJFrKZtpPN4hPKFZYZPr3C6T3VaFbDNQdiMpMhuk11PzCcTiEYyRUkn5L2gzWkdphT2ngdZF9WEPaS" ], "script": "base64:AAIDAAAAAAAAAA0IARIDCgEIEgQKAggBAAAAAgAAAAALdGlja2V0UHJpY2UAAAAAAAAAJxAAAAAABU1SVGlkAgAAACw4YWZZcmJEQnI2VHc1SmdhV1VnbTJHbmNZN3JMODdKdkdHN2FXZXpXTUdnWgAAAAIAAAAKY29udGV4dE9iagEAAAAJYnV5VGlja2V0AAAAAQAAAA1hZGRyZXNUb0xlYXNlBAAAAAckbWF0Y2gwCAUAAAAKY29udGV4dE9iagAAAAdwYXltZW50AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9BdHRhY2hlZFBheW1lbnQEAAAAAXAFAAAAByRtYXRjaDADAwkAAAAAAAACCAUAAAABcAAAAAZhbW91bnQFAAAAC3RpY2tldFByaWNlCQAAAAAAAAIJAAJYAAAAAQkBAAAAB2V4dHJhY3QAAAABCAUAAAABcAAAAAdhc3NldElkBQAAAAVNUlRpZAcEAAAAD3RpY2tldEFtb3VudE5ldwkAAGQAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAAx0aWNrZXRBbW91bnQAAAAAAAAAAAEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAGdGlja2V0CQABpAAAAAEFAAAAD3RpY2tldEFtb3VudE5ldwUAAAANYWRkcmVzVG9MZWFzZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAMdGlja2V0QW1vdW50BQAAAA90aWNrZXRBbW91bnROZXcFAAAAA25pbAkAAAIAAAABAgAAACZJbmNvcnJlY3QgYW1vdW50IG9yIGFzc2V0SWQgaW4gcGF5bWVudAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAAAAApjb250ZXh0T2JqAQAAAAlhZGRXaW5uZXIAAAACAAAAB2xvdHRlcnkAAAAGdGlja2V0BAAAAA5sb3R0ZXJ5QWRkcmVzcwkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABBQAAAAdsb3R0ZXJ5AwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAEdGhpcwUAAAAHbG90dGVyeQQAAAANd2lubmVyQWRkcmVzcwkABB0AAAACBQAAAA5sb3R0ZXJ5QWRkcmVzcwIAAAAGd2lubmVyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAA13aW5uaW5nVGlja2V0BQAAAAZ0aWNrZXQFAAAAA25pbAkAAAIAAAABAgAAACN5b3UgdG91Y2ggaW5jb3JyZWN0IGxvdHRlcnkgYWRkcmVzcwAAAACPZbfj", "chainId": 84, "height": 764500, "spentComplexity": 0 } View: original | compacted Prev: B3kAmFFgRkfHfiDmFzvb6oUjRxAeYQ2MzCqjkiWGMBuB Next: Hk9Rr6yaGvgWAAmLLzQy5QEuHK3z9AmrDCzEL53sEJo Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | @Callable(c) | |
9 | 9 | func buyTicket (d) = { | |
10 | - | let e = { | |
11 | - | let f = c.payment | |
12 | - | if ($isInstanceOf(f, "AttachedPayment")) | |
13 | - | then { | |
14 | - | let g = f | |
15 | - | if (if ((g.amount != a)) | |
16 | - | then (toBase58String(extract(g.assetId)) != b) | |
17 | - | else false) | |
18 | - | then throw("Incorrect amount or assetId in payment") | |
19 | - | else g | |
20 | - | } | |
21 | - | else throw("Payment not attached") | |
22 | - | } | |
23 | - | let h = (getIntegerValue(this, "ticketAmount") + 1) | |
24 | - | WriteSet([DataEntry(("ticket" + toString(h)), d), DataEntry("ticketAmount", h)]) | |
10 | + | let e = c.payment | |
11 | + | if ($isInstanceOf(e, "AttachedPayment")) | |
12 | + | then { | |
13 | + | let f = e | |
14 | + | if (if ((f.amount == a)) | |
15 | + | then (toBase58String(extract(f.assetId)) == b) | |
16 | + | else false) | |
17 | + | then { | |
18 | + | let g = (getIntegerValue(this, "ticketAmount") + 1) | |
19 | + | WriteSet([DataEntry(("ticket" + toString(g)), d), DataEntry("ticketAmount", g)]) | |
20 | + | } | |
21 | + | else throw("Incorrect amount or assetId in payment") | |
22 | + | } | |
23 | + | else throw("Payment not attached") | |
25 | 24 | } | |
26 | 25 | ||
27 | 26 | ||
28 | 27 | ||
29 | 28 | @Callable(c) | |
30 | - | func addWinner (i | |
31 | - | let | |
32 | - | if (isDefined(getString(this, | |
29 | + | func addWinner (h,i) = { | |
30 | + | let j = extract(addressFromString(h)) | |
31 | + | if (isDefined(getString(this, h))) | |
33 | 32 | then { | |
34 | - | let | |
35 | - | WriteSet([DataEntry("winningTicket", | |
33 | + | let k = getString(j, "winner") | |
34 | + | WriteSet([DataEntry("winningTicket", i)]) | |
36 | 35 | } | |
37 | 36 | else throw("you touch incorrect lottery address") | |
38 | 37 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 10000 | |
5 | 5 | ||
6 | 6 | let b = "8afYrbDBr6Tw5JgaWUgm2GncY7rL87JvGG7aWezWMGgZ" | |
7 | 7 | ||
8 | 8 | @Callable(c) | |
9 | 9 | func buyTicket (d) = { | |
10 | - | let e = { | |
11 | - | let f = c.payment | |
12 | - | if ($isInstanceOf(f, "AttachedPayment")) | |
13 | - | then { | |
14 | - | let g = f | |
15 | - | if (if ((g.amount != a)) | |
16 | - | then (toBase58String(extract(g.assetId)) != b) | |
17 | - | else false) | |
18 | - | then throw("Incorrect amount or assetId in payment") | |
19 | - | else g | |
20 | - | } | |
21 | - | else throw("Payment not attached") | |
22 | - | } | |
23 | - | let h = (getIntegerValue(this, "ticketAmount") + 1) | |
24 | - | WriteSet([DataEntry(("ticket" + toString(h)), d), DataEntry("ticketAmount", h)]) | |
10 | + | let e = c.payment | |
11 | + | if ($isInstanceOf(e, "AttachedPayment")) | |
12 | + | then { | |
13 | + | let f = e | |
14 | + | if (if ((f.amount == a)) | |
15 | + | then (toBase58String(extract(f.assetId)) == b) | |
16 | + | else false) | |
17 | + | then { | |
18 | + | let g = (getIntegerValue(this, "ticketAmount") + 1) | |
19 | + | WriteSet([DataEntry(("ticket" + toString(g)), d), DataEntry("ticketAmount", g)]) | |
20 | + | } | |
21 | + | else throw("Incorrect amount or assetId in payment") | |
22 | + | } | |
23 | + | else throw("Payment not attached") | |
25 | 24 | } | |
26 | 25 | ||
27 | 26 | ||
28 | 27 | ||
29 | 28 | @Callable(c) | |
30 | - | func addWinner (i | |
31 | - | let | |
32 | - | if (isDefined(getString(this, | |
29 | + | func addWinner (h,i) = { | |
30 | + | let j = extract(addressFromString(h)) | |
31 | + | if (isDefined(getString(this, h))) | |
33 | 32 | then { | |
34 | - | let | |
35 | - | WriteSet([DataEntry("winningTicket", | |
33 | + | let k = getString(j, "winner") | |
34 | + | WriteSet([DataEntry("winningTicket", i)]) | |
36 | 35 | } | |
37 | 36 | else throw("you touch incorrect lottery address") | |
38 | 37 | } | |
39 | 38 | ||
40 | 39 |
github/deemru/w8io/169f3d6 47.24 ms ◑