tx · 614URYNza3XQP3uG8yuEtT91uGi1mfGiyE5ox5XEessf

3N1rF4PLyqW2W7f24LjoVB4AtKEVMssx31T:  -0.01000000 Waves

2019.11.21 16:15 [774995] smart account 3N1rF4PLyqW2W7f24LjoVB4AtKEVMssx31T > SELF 0.00000000 Waves

{ "type": 13, "id": "614URYNza3XQP3uG8yuEtT91uGi1mfGiyE5ox5XEessf", "fee": 1000000, "feeAssetId": null, "timestamp": 1574342156807, "version": 1, "sender": "3N1rF4PLyqW2W7f24LjoVB4AtKEVMssx31T", "senderPublicKey": "EtzCpx6XhXPqKACfZJgaJZWKiBmVet1rWP5gmTo8uRAA", "proofs": [ "2RHpevkVCMqmyZr7cBstANYyk3Y2xi43mwLtn7WBxXvZjeq3Tq94kYGnoCF4F9GZrV4qtTahnwjua8L8i6rFW4s5" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAADAAAAAAt0aWNrZXRQcmljZQAAAAAAAAAAAwAAAAAFTVJUaWQBAAAAIHChkBw36JTYWgsazkDpCyVgxVwrjSJEZ1FQeglRlz1iAQAAAA9nZXRUaWNrZXRBbW91bnQAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAADHRpY2tldEFtb3VudAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAAAAAgAAAApjb250ZXh0T2JqAQAAAAlidXlUaWNrZXQAAAABAAAADWFkZHJlc1RvTGVhc2UEAAAAByRtYXRjaDAIBQAAAApjb250ZXh0T2JqAAAAB3BheW1lbnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0F0dGFjaGVkUGF5bWVudAQAAAABcAUAAAAHJG1hdGNoMAMDCQAAZwAAAAIIBQAAAAFwAAAABmFtb3VudAUAAAALdGlja2V0UHJpY2UJAAAAAAAAAggFAAAAAXAAAAAHYXNzZXRJZAUAAAAFTVJUaWQHBAAAABN0aWNrZXRzQnV5aW5nQW1vdW50CQAAaQAAAAIIBQAAAAFwAAAABmFtb3VudAUAAAALdGlja2V0UHJpY2UJAAACAAAAAQkAAaQAAAABBQAAABN0aWNrZXRzQnV5aW5nQW1vdW50CQAAAgAAAAECAAAAJkluY29ycmVjdCBhbW91bnQgb3IgYXNzZXRJZCBpbiBwYXltZW50CQAAAgAAAAECAAAAFFBheW1lbnQgbm90IGF0dGFjaGVkAAAACmNvbnRleHRPYmoBAAAACWFkZFdpbm5lcgAAAAEAAAAHbG90dGVyeQQAAAAObG90dGVyeUFkZHJlc3MJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAHbG90dGVyeQMJAQAAAAlpc0RlZmluZWQAAAABCQAEGwAAAAIFAAAABHRoaXMFAAAAB2xvdHRlcnkEAAAADXdpbm5lckFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAADmxvdHRlcnlBZGRyZXNzAgAAAA13aW5uZXJBZGRyZXNzBAAAAAx3aW5uZXJUaWNrZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAADmxvdHRlcnlBZGRyZXNzAgAAAAx3aW5uZXJUaWNrZXQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAANd2lubmluZ1RpY2tldAkAAaQAAAABBQAAAAx3aW5uZXJUaWNrZXQFAAAADXdpbm5lckFkZHJlc3MFAAAAA25pbAkAAAIAAAABAgAAACN5b3UgdG91Y2ggaW5jb3JyZWN0IGxvdHRlcnkgYWRkcmVzcwAAAABPZOWP", "chainId": 84, "height": 774995, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let ticketPrice = 3
5+
6+let MRTid = base58'8afYrbDBr6Tw5JgaWUgm2GncY7rL87JvGG7aWezWMGgZ'
7+
8+func getTicketAmount () = match getInteger(this, "ticketAmount") {
9+ case a: Int =>
10+ a
11+ case _ =>
12+ 0
13+}
14+
15+
16+@Callable(contextObj)
17+func buyTicket (addresToLease) = match contextObj.payment {
18+ case p: AttachedPayment =>
19+ if (if ((p.amount >= ticketPrice))
20+ then (p.assetId == MRTid)
21+ else false)
22+ then {
23+ let ticketsBuyingAmount = (p.amount / ticketPrice)
24+ throw(toString(ticketsBuyingAmount))
25+ }
26+ else throw("Incorrect amount or assetId in payment")
27+ case _ =>
28+ throw("Payment not attached")
29+}
30+
31+
32+
33+@Callable(contextObj)
34+func addWinner (lottery) = {
35+ let lotteryAddress = addressFromStringValue(lottery)
36+ if (isDefined(getBoolean(this, lottery)))
37+ then {
38+ let winnerAddress = getStringValue(lotteryAddress, "winnerAddress")
39+ let winnerTicket = getIntegerValue(lotteryAddress, "winnerTicket")
40+ WriteSet([DataEntry(("winningTicket" + toString(winnerTicket)), winnerAddress)])
41+ }
42+ else throw("you touch incorrect lottery address")
43+ }
44+
45+

github/deemru/w8io/169f3d6 
16.85 ms