tx · BFh9DTiLbscSdHaPYic4iS4eZPxRaNTwLaX5yUkqbtZz

3N4cnhtT2pA1kqePSCZcmyfAhPVWHjcy2Be:  -0.01000000 Waves

2019.11.18 15:47 [770588] smart account 3N4cnhtT2pA1kqePSCZcmyfAhPVWHjcy2Be > SELF 0.00000000 Waves

{ "type": 13, "id": "BFh9DTiLbscSdHaPYic4iS4eZPxRaNTwLaX5yUkqbtZz", "fee": 1000000, "feeAssetId": null, "timestamp": 1574081282947, "version": 1, "sender": "3N4cnhtT2pA1kqePSCZcmyfAhPVWHjcy2Be", "senderPublicKey": "7JY2UevHXzXWVMV5jsPdCGizXykCbJX1QzTZpsuRiKEb", "proofs": [ "2niekPnDRa8KEgfDVSNDpXHG3i9kE2poHhHRJ6Y5bwQhws3wHaSCvnRUjsVhbBYJjew9tJxiFzhxW8HnCUS2E2nu" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAADAAAAAAt0aWNrZXRQcmljZQAAAAAAAAAnEAAAAAAFTVJUaWQBAAAAIHChkBw36JTYWgsazkDpCyVgxVwrjSJEZ1FQeglRlz1iAQAAAA9nZXRUaWNrZXRBbW91bnQAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAADHRpY2tldEFtb3VudAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAAAAAgAAAApjb250ZXh0T2JqAQAAAAlidXlUaWNrZXQAAAABAAAADWFkZHJlc1RvTGVhc2UEAAAAByRtYXRjaDAIBQAAAApjb250ZXh0T2JqAAAAB3BheW1lbnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0F0dGFjaGVkUGF5bWVudAQAAAABcAUAAAAHJG1hdGNoMAMDCQAAAAAAAAIIBQAAAAFwAAAABmFtb3VudAUAAAALdGlja2V0UHJpY2UJAAAAAAAAAggFAAAAAXAAAAAHYXNzZXRJZAUAAAAF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mVjdCBsb3R0ZXJ5IGFkZHJlc3MAAAAA9w5Vpg==", "chainId": 84, "height": 770588, "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 = 10000
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 ticketAmountNew = (getTicketAmount() + 1)
24+ WriteSet([DataEntry(("ticket" + toString(ticketAmountNew)), addresToLease), DataEntry("ticketAmount", ticketAmountNew)])
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 = extract(addressFromString(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 
35.25 ms