tx · G148PL3j2GbrSs6go1b4RZfbopEtcDCx9D7KoBVppm65

3N4Kzbxu521DHPxcgrmZ4XUqN2kF6TqLTzs:  -0.01000000 Waves

2023.08.14 15:48 [2710253] smart account 3N4Kzbxu521DHPxcgrmZ4XUqN2kF6TqLTzs > SELF 0.00000000 Waves

{ "type": 13, "id": "G148PL3j2GbrSs6go1b4RZfbopEtcDCx9D7KoBVppm65", "fee": 1000000, "feeAssetId": null, "timestamp": 1692017330974, "version": 2, "chainId": 84, "sender": "3N4Kzbxu521DHPxcgrmZ4XUqN2kF6TqLTzs", "senderPublicKey": "8yQuxvQ2qLzXJrgbKZHbsfnNNjuU5wfHheyVujdALGsF", "proofs": [ "3awUKPXtmw2z2xgAV5TGsCwfn6hKj2LTkfcu2NH9ihHHdW4gfwVv7jURuTxYcuNha5tw6kxouzTqNrMeSxn69vCn" ], "script": "base64:BgIMCAISABIECgIIARIABQAObG90dGVyeUFzc2V0SUQJANkEAQIsM0x6MjNtU1V2VDFFc3djQm4yc1VSWUpHMmF0OHJHNWFGdVVyVEF3YVBNNlEACnRpY2tldFNpemUAgMLXLwECbWsBAXgJALkJAgUBeAIBXwECZ3MBA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFBHRoaXMFA2tleQkAuQkCCQDMCAICAScJAMwIAgUDa2V5CQDMCAICDycga2V5IG5vdCBmb3VuZAUDbmlsAgABAmdpAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQR0aGlzBQNrZXkJALkJAgkAzAgCAgEnCQDMCAIFA2tleQkAzAgCAg8nIGtleSBub3QgZm91bmQFA25pbAIAAwFpAQVzdGFrZQADCQECIT0CCQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMCEGxvdHRlcnlJc1N0YXJ0ZWQHBgkAAgECG0xvdHRlcnkgaGFzIG5vdCBzdGFydGVkIHlldAQLbG90dGVyeU5hbWUJAQJncwECEmN1cnJlbnRMb3R0ZXJ5TmFtZQ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MSW50ZWdlckVudHJ5AgkBAm1rAQkAzAgCBQtsb3R0ZXJ5TmFtZQkAzAgCAhJsb3R0ZXJ5RmluYWxIZWlnaHQFA25pbAUSbG90dGVyeUZpbmFsSGVpZ2h0CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQECbWsBCQDMCAIFC2xvdHRlcnlOYW1lCQDMCAICB3BvaW50ZXIFA25pbAAABQNuaWwBaQEEY2FsbAAEBWFzc2V0CQDDCAcCBUFzc2V0AgAAAQAABgUEdW5pdAAABAdhc3NldElkCQC4CAEFBWFzc2V0CQDMCAIJAQtCaW5hcnlFbnRyeQICA2JpbgEACQDMCAIJAQxCb29sZWFuRW50cnkCAgRib29sBgkAzAgCCQEMSW50ZWdlckVudHJ5AgIDaW50AAEJAMwIAgkBC1N0cmluZ0VudHJ5AgIDc3RyAgAJAMwIAgkBC0RlbGV0ZUVudHJ5AQIDc3RyCQDMCAIFBWFzc2V0CQDMCAIJAQdSZWlzc3VlAwUHYXNzZXRJZAABBwkAzAgCCQEEQnVybgIFB2Fzc2V0SWQAAQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQUHYXNzZXRJZAUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleX2kaXc=", "height": 2710253, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Boa9G9QRNyvkj2WqMT1sgLHrN1RM4u6WnJYS4Xm576fD Next: C19BQ5MzffCJG4HmoE3h3waLdqBJooZeSFpj6EJfekKR Diff:
OldNewDifferences
3131 else {
3232 let k = h.payments[0].amount
3333 let l = (k / b)
34+ if ((k == 0))
35+ then throw("Not enough to buy at least one ticket")
36+ else {
37+ let m = c([i, "pointer"])
3438 [ScriptTransfer(h.caller, (k - (l * b)), a)]
39+ }
3540 }
3641 }
3742
4045 @Callable(h)
4146 func initLottery (i,j) = if ((h.caller != this))
4247 then throw("admin only")
43- else [BooleanEntry("lotteryIsStarted", true), StringEntry("currentLotteryName", i), IntegerEntry(makeString([i, "lotteryFinalHeight"], "_"), j)]
48+ else [BooleanEntry("lotteryIsStarted", true), StringEntry("currentLotteryName", i), IntegerEntry(c([i, "lotteryFinalHeight"]), j), IntegerEntry(c([i, "pointer"]), 0)]
4449
4550
4651
4752 @Callable(h)
4853 func call () = {
49- let m = Issue("Asset", "", 1, 0, true, unit, 0)
50- let n = calculateAssetId(m)
51-[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), m, Reissue(n, 1, false), Burn(n, 1), ScriptTransfer(h.caller, 1, n)]
54+ let n = Issue("Asset", "", 1, 0, true, unit, 0)
55+ let o = calculateAssetId(n)
56+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), n, Reissue(o, 1, false), Burn(o, 1), ScriptTransfer(h.caller, 1, o)]
5257 }
5358
5459
55-@Verifier(o)
56-func p () = sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey)
60+@Verifier(p)
61+func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey)
5762
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = fromBase58String("3Lz23mSUvT1EswcBn2sURYJG2at8rG5aFuUrTAwaPM6Q")
55
66 let b = 100000000
77
88 func c (d) = makeString(d, "_")
99
1010
1111 func e (f) = valueOrErrorMessage(getString(this, f), makeString(["'", f, "' key not found"], ""))
1212
1313
1414 func g (f) = valueOrErrorMessage(getInteger(this, f), makeString(["'", f, "' key not found"], ""))
1515
1616
1717 @Callable(h)
1818 func stake () = if ((valueOrElse(getBoolean(this, "lotteryIsStarted"), false) != true))
1919 then throw("Lottery has not started yet")
2020 else {
2121 let i = e("currentLotteryName")
2222 let j = g(c([i, "lotteryFinalHeight"]))
2323 if (((height - 1) >= j))
2424 then throw("Lottery has not started yet")
2525 else if ((size(h.payments) == 0))
2626 then throw("No payment added")
2727 else if ((size(h.payments) != 1))
2828 then throw("Too many payments added")
2929 else if ((h.payments[0].assetId != a))
3030 then throw("Wrong payment assetId")
3131 else {
3232 let k = h.payments[0].amount
3333 let l = (k / b)
34+ if ((k == 0))
35+ then throw("Not enough to buy at least one ticket")
36+ else {
37+ let m = c([i, "pointer"])
3438 [ScriptTransfer(h.caller, (k - (l * b)), a)]
39+ }
3540 }
3641 }
3742
3843
3944
4045 @Callable(h)
4146 func initLottery (i,j) = if ((h.caller != this))
4247 then throw("admin only")
43- else [BooleanEntry("lotteryIsStarted", true), StringEntry("currentLotteryName", i), IntegerEntry(makeString([i, "lotteryFinalHeight"], "_"), j)]
48+ else [BooleanEntry("lotteryIsStarted", true), StringEntry("currentLotteryName", i), IntegerEntry(c([i, "lotteryFinalHeight"]), j), IntegerEntry(c([i, "pointer"]), 0)]
4449
4550
4651
4752 @Callable(h)
4853 func call () = {
49- let m = Issue("Asset", "", 1, 0, true, unit, 0)
50- let n = calculateAssetId(m)
51-[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), m, Reissue(n, 1, false), Burn(n, 1), ScriptTransfer(h.caller, 1, n)]
54+ let n = Issue("Asset", "", 1, 0, true, unit, 0)
55+ let o = calculateAssetId(n)
56+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), n, Reissue(o, 1, false), Burn(o, 1), ScriptTransfer(h.caller, 1, o)]
5257 }
5358
5459
55-@Verifier(o)
56-func p () = sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey)
60+@Verifier(p)
61+func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey)
5762

github/deemru/w8io/169f3d6 
25.97 ms