tx · Boa9G9QRNyvkj2WqMT1sgLHrN1RM4u6WnJYS4Xm576fD 3N4Kzbxu521DHPxcgrmZ4XUqN2kF6TqLTzs: -0.01000000 Waves 2023.08.14 15:35 [2710239] smart account 3N4Kzbxu521DHPxcgrmZ4XUqN2kF6TqLTzs > SELF 0.00000000 Waves
{ "type": 13, "id": "Boa9G9QRNyvkj2WqMT1sgLHrN1RM4u6WnJYS4Xm576fD", "fee": 1000000, "feeAssetId": null, "timestamp": 1692016566628, "version": 2, "chainId": 84, "sender": "3N4Kzbxu521DHPxcgrmZ4XUqN2kF6TqLTzs", "senderPublicKey": "8yQuxvQ2qLzXJrgbKZHbsfnNNjuU5wfHheyVujdALGsF", "proofs": [ "3KDtvpJeqsGqfmC2krRftyBd7VaegVriq8WwR6Vm6WnLBJG3kB8FLHZWLfHjikQ4eVTkF2jNR24FHuXLGYn2NEoN" ], "script": "base64:BgIMCAISABIECgIIARIABQAObG90dGVyeUFzc2V0SUQJANkEAQIsM0x6MjNtU1V2VDFFc3djQm4yc1VSWUpHMmF0OHJHNWFGdVVyVEF3YVBNNlEACnRpY2tldFNpemUAgMLXLwECbWsBAXgJALkJAgUBeAIBXwECZ3MBA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFBHRoaXMFA2tleQkAuQkCCQDMCAICAScJAMwIAgUDa2V5CQDMCAICDycga2V5IG5vdCBmb3VuZAUDbmlsAgABAmdpAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQR0aGlzBQNrZXkJALkJAgkAzAgCAgEnCQDMCAIFA2tleQkAzAgCAg8nIGtleSBub3QgZm91bmQFA25pbAIAAwFpAQVzdGFrZQADCQECIT0CCQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMCEGxvdHRlcnlJc1N0YXJ0ZWQHBgkAAgECG0xvdHRlcnkgaGFzIG5vdCBzdGFydGVkIHlldAQLbG90dGVyeU5hbWUJAQJncwECEmN1cnJlbnRMb3R0Z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EY2FsbAAEBWFzc2V0CQDDCAcCBUFzc2V0AgAAAQAABgUEdW5pdAAABAdhc3NldElkCQC4CAEFBWFzc2V0CQDMCAIJAQtCaW5hcnlFbnRyeQICA2JpbgEACQDMCAIJAQxCb29sZWFuRW50cnkCAgRib29sBgkAzAgCCQEMSW50ZWdlckVudHJ5AgIDaW50AAEJAMwIAgkBC1N0cmluZ0VudHJ5AgIDc3RyAgAJAMwIAgkBC0RlbGV0ZUVudHJ5AQIDc3RyCQDMCAIFBWFzc2V0CQDMCAIJAQdSZWlzc3VlAwUHYXNzZXRJZAABBwkAzAgCCQEEQnVybgIFB2Fzc2V0SWQAAQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQUHYXNzZXRJZAUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlecCYRFI=", "height": 2710239, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3LqjGX6MqULSyNeuek8CE5ZfV33HgyyskZA8ZZzqL9vg Next: G148PL3j2GbrSs6go1b4RZfbopEtcDCx9D7KoBVppm65 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func a (b) = makeString(b, "_") | |
4 | + | let a = fromBase58String("3Lz23mSUvT1EswcBn2sURYJG2at8rG5aFuUrTAwaPM6Q") | |
5 | + | ||
6 | + | let b = 100000000 | |
7 | + | ||
8 | + | func c (d) = makeString(d, "_") | |
5 | 9 | ||
6 | 10 | ||
7 | - | func | |
11 | + | func e (f) = valueOrErrorMessage(getString(this, f), makeString(["'", f, "' key not found"], "")) | |
8 | 12 | ||
9 | 13 | ||
10 | - | func | |
14 | + | func g (f) = valueOrErrorMessage(getInteger(this, f), makeString(["'", f, "' key not found"], "")) | |
11 | 15 | ||
12 | 16 | ||
13 | - | @Callable( | |
17 | + | @Callable(h) | |
14 | 18 | func stake () = if ((valueOrElse(getBoolean(this, "lotteryIsStarted"), false) != true)) | |
15 | - | then throw(" | |
19 | + | then throw("Lottery has not started yet") | |
16 | 20 | else { | |
17 | - | let g = c("currentLotteryName") | |
18 | - | let h = e(a([g, "lotteryFinalHeight"])) | |
19 | - | if (((height - 1) >= h)) | |
20 | - | then throw("lottery has not started yet") | |
21 | - | else [BooleanEntry("tmp", true)] | |
21 | + | let i = e("currentLotteryName") | |
22 | + | let j = g(c([i, "lotteryFinalHeight"])) | |
23 | + | if (((height - 1) >= j)) | |
24 | + | then throw("Lottery has not started yet") | |
25 | + | else if ((size(h.payments) == 0)) | |
26 | + | then throw("No payment added") | |
27 | + | else if ((size(h.payments) != 1)) | |
28 | + | then throw("Too many payments added") | |
29 | + | else if ((h.payments[0].assetId != a)) | |
30 | + | then throw("Wrong payment assetId") | |
31 | + | else { | |
32 | + | let k = h.payments[0].amount | |
33 | + | let l = (k / b) | |
34 | + | [ScriptTransfer(h.caller, (k - (l * b)), a)] | |
35 | + | } | |
22 | 36 | } | |
23 | 37 | ||
24 | 38 | ||
25 | 39 | ||
26 | - | @Callable( | |
27 | - | func initLottery ( | |
40 | + | @Callable(h) | |
41 | + | func initLottery (i,j) = if ((h.caller != this)) | |
28 | 42 | then throw("admin only") | |
29 | - | else [BooleanEntry("lotteryIsStarted", true), StringEntry("currentLotteryName", | |
43 | + | else [BooleanEntry("lotteryIsStarted", true), StringEntry("currentLotteryName", i), IntegerEntry(makeString([i, "lotteryFinalHeight"], "_"), j)] | |
30 | 44 | ||
31 | 45 | ||
32 | 46 | ||
33 | - | @Callable( | |
47 | + | @Callable(h) | |
34 | 48 | func call () = { | |
35 | - | let | |
36 | - | let | |
37 | - | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), | |
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)] | |
38 | 52 | } | |
39 | 53 | ||
40 | 54 | ||
41 | - | @Verifier( | |
42 | - | func | |
55 | + | @Verifier(o) | |
56 | + | func p () = sigVerify(o.bodyBytes, o.proofs[0], o.senderPublicKey) | |
43 | 57 |
github/deemru/w8io/169f3d6 28.82 ms ◑