tx · 8r6xWd68baWEGra5kwhubdcYvJLZhVMaYS5n6ZSNbZDe

3MrC1oqVCoLkfHabhJtrLJS6GxcooQwRWuP:  -0.01400000 Waves

2019.11.13 15:51 [763324] smart account 3MrC1oqVCoLkfHabhJtrLJS6GxcooQwRWuP > SELF 0.00000000 Waves

{ "type": 13, "id": "8r6xWd68baWEGra5kwhubdcYvJLZhVMaYS5n6ZSNbZDe", "fee": 1400000, "feeAssetId": null, "timestamp": 1573649518140, "version": 1, "sender": "3MrC1oqVCoLkfHabhJtrLJS6GxcooQwRWuP", "senderPublicKey": "3bmZaUZ9wp3K1YZQFqTkN1oZzumQPi7WLQ9QowMaqqEZ", "proofs": [ "53LLMoQcNCJ97fR6VMkVJ2uC7mzJ9TLfUtPpgAWTy82T5LXJCXo6dUZFi74Af4Dfx8zRC1nMVKwpEdSYs3P3oFGL" ], "script": "base64:AAIDAAAAAAAAAA0IARIDCgEIEgQKAggBAAAAAgAAAAALdGlja2V0UHJpY2UAAAAAAAAAJxAAAAAABU1SVGlkAgAAACw4YWZZcmJEQnI2VHc1SmdhV1VnbTJHbmNZN3JMODdKdkdHN2FXZXpXTUdnWgAAAAIAAAAKY29udGV4dE9iagEAAAAJYnV5VGlja2V0AAAAAQAAAA1hZGRyZXNUb0xlYXNlBAAAAAdwYXltZW50BAAAAAckbWF0Y2gwCAUAAAAKY29udGV4dE9iagAAAAdwYXltZW50AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9BdHRhY2hlZFBheW1lbnQEAAAAAXAFAAAAByRtYXRjaDADAwkAAAAAAAACCAUAAAABcAAAAAZhbW91bnQFAAAAC3RpY2tldFByaWNlCQAAAAAAAAIJAAJYAAAAAQkBAAAAB2V4dHJhY3QAAAABCAUAAAABcAAAAAdhc3NldElkBQAAAAVNUlRpZAcFAAAAAXAJAAACAAAAAQIAAAAmSW5jb3JyZWN0IGFtb3VudCBvciBhc3NldElkIGluIHBheW1lbnQJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAD3RpY2tldEFtb3VudE5ldwkAAGQAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAAx0aWNrZXRBbW91bnQAAAAAAAAAAAEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAGdGlja2V0CQABpAAAAAEFAAAAD3RpY2tldEFtb3VudE5ldwUAAAANYWRkcmVzVG9MZWFzZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAMdGlja2V0QW1vdW50BQAAAA90aWNrZXRBbW91bnROZXcFAAAAA25pbAAAAApjb250ZXh0T2JqAQAAAAlhZGRXaW5uZXIAAAACAAAAB2xvdHRlcnkAAAAGdGlja2V0BAAAAA5sb3R0ZXJ5QWRkcmVzcwkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABBQAAAAdsb3R0ZXJ5AwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAEdGhpcwUAAAAHbG90dGVyeQQAAAANd2lubmVyQWRkcmVzcwkABB0AAAACBQAAAA5sb3R0ZXJ5QWRkcmVzcwIAAAAGd2lubmVyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAA13aW5uaW5nVGlja2V0BQAAAAZ0aWNrZXQFAAAAA25pbAkAAAIAAAABAgAAACN5b3UgdG91Y2ggaW5jb3JyZWN0IGxvdHRlcnkgYWRkcmVzcwAAAAAoixJG", "chainId": 84, "height": 763324, "spentComplexity": 0 } View: original | compacted Prev: A2J74JFqzsjxaUbLcf9DJS54piCshgtVvspZVc7wuMTU Next: 8f8G8pLXNC7VaYnucsGhrigfXwuYVggS2NkbhwVdiJn9 Diff:
OldNewDifferences
99 func buyTicket (addresToLease) = {
1010 let payment = match contextObj.payment {
1111 case p: AttachedPayment =>
12- if (if ((p.amount != ticketPrice))
13- then true
14- else (toBase58String(extract(p.assetId)) != MRTid))
15- then throw("Incorrect amount or assetId in payment")
16- else p
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")
1717 case _ =>
1818 throw("Payment not attached")
1919 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ticketPrice = 10000
55
66 let MRTid = "8afYrbDBr6Tw5JgaWUgm2GncY7rL87JvGG7aWezWMGgZ"
77
88 @Callable(contextObj)
99 func buyTicket (addresToLease) = {
1010 let payment = match contextObj.payment {
1111 case p: AttachedPayment =>
12- if (if ((p.amount != ticketPrice))
13- then true
14- else (toBase58String(extract(p.assetId)) != MRTid))
15- then throw("Incorrect amount or assetId in payment")
16- else p
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")
1717 case _ =>
1818 throw("Payment not attached")
1919 }
2020 let ticketAmountNew = (getIntegerValue(this, "ticketAmount") + 1)
2121 WriteSet([DataEntry(("ticket" + toString(ticketAmountNew)), addresToLease), DataEntry("ticketAmount", ticketAmountNew)])
2222 }
2323
2424
2525
2626 @Callable(contextObj)
2727 func addWinner (lottery,ticket) = {
2828 let lotteryAddress = extract(addressFromString(lottery))
2929 if (isDefined(getString(this, lottery)))
3030 then {
3131 let winnerAddress = getString(lotteryAddress, "winner")
3232 WriteSet([DataEntry("winningTicket", ticket)])
3333 }
3434 else throw("you touch incorrect lottery address")
3535 }
3636
3737

github/deemru/w8io/3ef1775 
46.15 ms