tx · 62oTz3PbFunapYmg4fQ17uJEqh5MyUHUJcHefuKqSSYA

3MvcThc2oaRXWLgYxiGhr1jnd4gK5CXBGhE:  -0.01400000 Waves

2019.08.04 00:11 [615217] smart account 3MvcThc2oaRXWLgYxiGhr1jnd4gK5CXBGhE > SELF 0.00000000 Waves

{ "type": 13, "id": "62oTz3PbFunapYmg4fQ17uJEqh5MyUHUJcHefuKqSSYA", "fee": 1400000, "feeAssetId": null, "timestamp": 1564866711977, "version": 1, "sender": "3MvcThc2oaRXWLgYxiGhr1jnd4gK5CXBGhE", "senderPublicKey": "Czmo9kTsBGhSfVm9DSRTG8uoiyrcMQB63vabDwPobjqx", "proofs": [ "5wTVsHF4Snb51dswQNFf8RxozcXVsMtQ3yxpqcXNouU8wSK3EZp14EsVvp1Gf9cn4f4vJV5ihdLJALA7bW4GCvUt" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAAAhsYXN0Q2VsbAAAAAAAAAAABAAAAAAIY2VsbHNLZXkCAAAABWNlbGxzAAAAAgAAAAFpAQAAAAZjcmVhdGUAAAAEAAAABG5hbWUAAAAEZGVzYwAAAAt0aWNrZXRQcmljZQAAAAt0aWNrZXRBc3NldAQAAAAHYXNzZXRJZAMJAQAAAAIhPQAAAAIFAAAAC3RpY2tldEFzc2V0AgAAAAVXQVZFUwQAAAAFYUluZm8JAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkAA+wAAAABCQACWQAAAAEFAAAAC3RpY2tldEFzc2V0AgAAACNUaGVyZSBpcyBubyBhc3NldCB3aXRoIHNwZWNpZmllZCBpZAUAAAALdGlja2V0QXNzZXQCAAAABVdBVkVTBAAAAANwbXQJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAggFAAAAAWkAAAAHcGF5bWVudAIAAAAPV2hlcmUgaXMgcHJpemU/BAAAAApwcml6ZUFzc2V0AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAlg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84, "height": 615217, "spentComplexity": 0 } View: original | compacted Prev: 63H7L4iXweuvjMu3KtBMGZpdwfvFUsQeapKeq5VYTknB Next: AFpQLnwLh9qt7Kg9pKu8Hvu7qcWJcaxyLK7epwMb4dUm Diff:
OldNewDifferences
5656 then throw("Already bought")
5757 else {
5858 let q = (o == a)
59+ let r = valueOrErrorMessage(getInteger(this, (m + "_balance")), "Balance error")
5960 if (q)
6061 then {
61- let r = addressFromStringValue(valueOrErrorMessage(getString(this, (m + "_creator")), "Creator error"))
62- let s = valueOrErrorMessage(getInteger(this, (m + "_balance")), "Balance error")
62+ let s = addressFromStringValue(valueOrErrorMessage(getString(this, (m + "_creator")), "Creator error"))
6363 let t = valueOrErrorMessage(getInteger(this, (m + "_prize_amount")), "Prize amount error")
6464 let k = valueOrErrorMessage(getString(this, (m + "_prize_asset")), "Prize asset error")
6565 let u = (toInt(lastBlock.generationSignature) % (a + 1))
7272 ScriptResult(WriteSet([DataEntry((m + "_status"), false), DataEntry((m + "_balance"), 0), DataEntry((m + "_cells"), (o + 1)), DataEntry(((m + "_cell:") + toString(n)), toString(c.caller)), DataEntry((m + "_winner:"), toBase58String(v.bytes))]), TransferSet([if ((k == "WAVES"))
7373 then ScriptTransfer(v, t, unit)
7474 else ScriptTransfer(v, t, fromBase58String(k)), if ((g == "WAVES"))
75- then ScriptTransfer(r, s, unit)
76- else ScriptTransfer(r, s, fromBase58String(g))]))
75+ then ScriptTransfer(s, r, unit)
76+ else ScriptTransfer(s, r, fromBase58String(g))]))
7777 }
78- else WriteSet([DataEntry(((m + "_cell:") + toString(n)), toString(c.caller)), DataEntry((m + "_cells"), (o + 1))])
78+ else WriteSet([DataEntry(((m + "_cell:") + toString(n)), toString(c.caller)), DataEntry((m + "_cells"), (o + 1)), DataEntry((m + "_balance"), (r + j.amount))])
7979 }
8080 }
8181 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 4
55
66 let b = "cells"
77
88 @Callable(c)
99 func create (d,e,f,g) = {
1010 let h = if ((g != "WAVES"))
1111 then {
1212 let i = valueOrErrorMessage(assetInfo(fromBase58String(g)), "There is no asset with specified id")
1313 g
1414 }
1515 else "WAVES"
1616 let j = valueOrErrorMessage(c.payment, "Where is prize?")
1717 let k = if (isDefined(j.assetId))
1818 then toBase58String(value(j.assetId))
1919 else "WAVES"
2020 if (if (if ((d == ""))
2121 then true
2222 else (e == ""))
2323 then true
2424 else (0 > f))
2525 then throw("Invalid name, description or ticket price")
2626 else {
2727 let l = toBase58String(c.transactionId)
2828 WriteSet([DataEntry((l + "_name"), d), DataEntry((l + "_desc"), e), DataEntry((l + "_ticket_price"), f), DataEntry((l + "_ticket_asset"), h), DataEntry((l + "_prize_amount"), j.amount), DataEntry((l + "_prize_asset"), k), DataEntry((l + "_creator"), toBase58String(c.caller.bytes)), DataEntry((l + "_cells"), 0), DataEntry((l + "_status"), true), DataEntry((l + "_balance"), 0)])
2929 }
3030 }
3131
3232
3333
3434 @Callable(c)
3535 func buy (m,n) = {
3636 let o = valueOrErrorMessage(getInteger(this, (m + "_cells")), "No lottery with specified id")
3737 let p = getBooleanValue(this, (m + "_status"))
3838 if (!(p))
3939 then throw("Specified lottery is over")
4040 else if (if ((0 > n))
4141 then true
4242 else (n > a))
4343 then throw("Invalid number")
4444 else {
4545 let f = valueOrErrorMessage(getInteger(this, (m + "_ticket_price")), "Ticket price error")
4646 let g = valueOrErrorMessage(getString(this, (m + "_ticket_asset")), "Ticket asset error")
4747 let j = valueOrErrorMessage(c.payment, "Where is payment?")
4848 let h = if (isDefined(j.assetId))
4949 then toBase58String(value(j.assetId))
5050 else "WAVES"
5151 if (if ((h != g))
5252 then true
5353 else (j.amount != f))
5454 then throw("Invalid payment")
5555 else if (isDefined(getString(this, toString(n))))
5656 then throw("Already bought")
5757 else {
5858 let q = (o == a)
59+ let r = valueOrErrorMessage(getInteger(this, (m + "_balance")), "Balance error")
5960 if (q)
6061 then {
61- let r = addressFromStringValue(valueOrErrorMessage(getString(this, (m + "_creator")), "Creator error"))
62- let s = valueOrErrorMessage(getInteger(this, (m + "_balance")), "Balance error")
62+ let s = addressFromStringValue(valueOrErrorMessage(getString(this, (m + "_creator")), "Creator error"))
6363 let t = valueOrErrorMessage(getInteger(this, (m + "_prize_amount")), "Prize amount error")
6464 let k = valueOrErrorMessage(getString(this, (m + "_prize_asset")), "Prize asset error")
6565 let u = (toInt(lastBlock.generationSignature) % (a + 1))
6666 let v = if ((u == n))
6767 then c.caller
6868 else {
6969 let w = valueOrErrorMessage(getString(this, ((m + "_cell:") + toString(u))), "Win data error")
7070 value(addressFromString(w))
7171 }
7272 ScriptResult(WriteSet([DataEntry((m + "_status"), false), DataEntry((m + "_balance"), 0), DataEntry((m + "_cells"), (o + 1)), DataEntry(((m + "_cell:") + toString(n)), toString(c.caller)), DataEntry((m + "_winner:"), toBase58String(v.bytes))]), TransferSet([if ((k == "WAVES"))
7373 then ScriptTransfer(v, t, unit)
7474 else ScriptTransfer(v, t, fromBase58String(k)), if ((g == "WAVES"))
75- then ScriptTransfer(r, s, unit)
76- else ScriptTransfer(r, s, fromBase58String(g))]))
75+ then ScriptTransfer(s, r, unit)
76+ else ScriptTransfer(s, r, fromBase58String(g))]))
7777 }
78- else WriteSet([DataEntry(((m + "_cell:") + toString(n)), toString(c.caller)), DataEntry((m + "_cells"), (o + 1))])
78+ else WriteSet([DataEntry(((m + "_cell:") + toString(n)), toString(c.caller)), DataEntry((m + "_cells"), (o + 1)), DataEntry((m + "_balance"), (r + j.amount))])
7979 }
8080 }
8181 }
8282
8383
8484 @Verifier(x)
8585 func y () = true
8686

github/deemru/w8io/026f985 
35.66 ms