tx · HGeGwf4KKJD62KcxhwN9ds7rbfPFMR4H1t1fwuCo6LCS

3MtGPuEE7F7KiERmknemXpaJNoFeYXAW2zG:  -0.01000000 Waves

2019.11.25 16:33 [780856] smart account 3MtGPuEE7F7KiERmknemXpaJNoFeYXAW2zG > SELF 0.00000000 Waves

{ "type": 13, "id": "HGeGwf4KKJD62KcxhwN9ds7rbfPFMR4H1t1fwuCo6LCS", "fee": 1000000, "feeAssetId": null, "timestamp": 1574688903585, "version": 1, "sender": "3MtGPuEE7F7KiERmknemXpaJNoFeYXAW2zG", "senderPublicKey": "BLnUXeFXWnk7s4iMSorxJGVS5Gd51uYehehe9zoTkTrF", "proofs": [ "4QzbNqDMkj8aKwdXWefRhzpqasAXudMghkP6H1WRo9iCpJQVybGdSBHKnmL9qaxgTgs8DrTrSEnq4stNJ2aPHaPm" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAADAAAAAAt0aWNrZXRQcmljZQAAAAAAAAAAAwAAAAAFTVJUaWQBAAAAIHChkBw36JTYWgsazkDpCyVgxVwrjSJEZ1FQeglRlz1iAQAAAA9nZXRUaWNrZXRBbW91bnQAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAAEXRpY2tldEFtb3VudFRvdGFsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAAAAACAAAACmNvbnRleHRPYmoBAAAACWJ1eVRpY2tldAAAAAEAAAANYWRkcmVzVG9MZWFzZQQAAAAHJG1hdGNoMAgFAAAACmNvbnRleHRPYmoAAAAHcGF5bWVudAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQXR0YWNoZWRQYXltZW50BAAAAAFwBQAAAAckbWF0Y2gwAwMJAABnAAAAAggFAAAAAXAAAAAGYW1vdW50BQAAAAt0aWNrZXRQcmljZQkAAAAAAAACCAUAAAABcAAAAAdhc3NldElkBQAAAA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B2xvdHRlcnkEAAAADXdpbm5lckFkZHJlc3MJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAADmxvdHRlcnlBZGRyZXNzAgAAAA13aW5uZXJBZGRyZXNzBAAAAAx3aW5uZXJUaWNrZXQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAADmxvdHRlcnlBZGRyZXNzAgAAAAx3aW5uZXJUaWNrZXQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAANd2lubmluZ1RpY2tldAkAAaQAAAABBQAAAAx3aW5uZXJUaWNrZXQFAAAADXdpbm5lckFkZHJlc3MFAAAAA25pbAkAAAIAAAABAgAAACN5b3UgdG91Y2ggaW5jb3JyZWN0IGxvdHRlcnkgYWRkcmVzcwAAAACWWeyZ", "chainId": 84, "height": 780856, "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, "ticketAmountTotal") {
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+ let ticketAmountTotalCurrent = getTicketAmount()
25+ let ticketAmountTotalNew = (ticketAmountTotalCurrent + ticketsBuyingAmount)
26+ let ticketsFrom = toString((ticketAmountTotalCurrent + 1))
27+ let ticketsTo = toString((ticketAmountTotalCurrent + ticketsBuyingAmount))
28+ WriteSet([DataEntry(((("ticketsFrom" + ticketsFrom) + "To") + ticketsTo), addresToLease), DataEntry("ticketAmountTotal", ticketAmountTotalNew)])
29+ }
30+ else throw("Incorrect amount or assetId in payment")
31+ case _ =>
32+ throw("Payment not attached")
33+}
34+
35+
36+
37+@Callable(contextObj)
38+func addWinner (lottery) = {
39+ let lotteryAddress = addressFromStringValue(lottery)
40+ if (isDefined(getBoolean(this, lottery)))
41+ then {
42+ let winnerAddress = getStringValue(lotteryAddress, "winnerAddress")
43+ let winnerTicket = getIntegerValue(lotteryAddress, "winnerTicket")
44+ WriteSet([DataEntry(("winningTicket" + toString(winnerTicket)), winnerAddress)])
45+ }
46+ else throw("you touch incorrect lottery address")
47+ }
48+
49+

github/deemru/w8io/169f3d6 
34.23 ms