tx · Dxmmapjih7X6uXGeptDJPXbQAP5KbF5nViKqnTLqRAXk 3Mu9qAjmg8fVTxxpwPZnBAH948ujt4m6Xvk: -0.01000000 Waves 2021.10.15 00:49 [1746502] smart account 3Mu9qAjmg8fVTxxpwPZnBAH948ujt4m6Xvk > SELF 0.00000000 Waves
{ "type": 13, "id": "Dxmmapjih7X6uXGeptDJPXbQAP5KbF5nViKqnTLqRAXk", "fee": 1000000, "feeAssetId": null, "timestamp": 1634248162978, "version": 2, "chainId": 84, "sender": "3Mu9qAjmg8fVTxxpwPZnBAH948ujt4m6Xvk", "senderPublicKey": "8v9pmcXqHz9DTc5k1Z8duTYyDwykFxN3EzdZ9WAn3KXJ", "proofs": [ "5eiqno5QwYseWxwvPsG3GYNXUmUuPbLB4h7xSsKDo67u5wNLNH4gBpwDw4scQV5DpdUjGQckMBS4zupNb32hzErP" ], "script": "base64:AAIDAAAAAAAAAAgIARIECgIBAQAAAAcAAAAADWdhbWVOdW1iZXJLZXkCAAAADCRHQU1FX05VTUJFUgAAAAALbGFzdFBsYXlLZXkCAAAACiRMQVNUX1BMQVkAAAAAA1dPTgAAAAAAAAAAAQAAAAAETE9TRQAAAAAAAAAAAgEAAAAKcGF5b3V0Y2FsYwAAAAEAAAAGbnVtYmVyBAAAAAVob3VzZQAAAAAAAAAABgQAAAAEYmFzZQAAAAAAAAAnEAkAAGkAAAACCQAAaAAAAAIFAAAABGJhc2UJAABpAAAAAgkAAGUAAAACAAAAAAAAAABkAAAAAAAAAAAGAAAAAAAAAABkBQAAAAZudW1iZXIBAAAACnJhbmRvbWl6ZXIAAAABAAAAAWkEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMFAAAAC2xhc3RQbGF5S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQA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EAAAAKcGF5b3V0Y2FsYwAAAAEJAABkAAAAAgkAAGUAAAACBQAAAAhndWVzc0VuZAUAAAAKZ3Vlc3NTdGFydAAAAAAAAAAAAQAAAAAAAAAAZAUAAAAEdW5pdAUAAAADbmlsBAAAAANzdHIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAAaQAAAABBQAAAANXT04CAAAABl9MT1NFXwUAAAANdHJhbnNhY3Rpb25JZAIAAAABXwUAAAAHZ2FtZUtleQIAAAABXwkAAaQAAAABBQAAAApndWVzc1N0YXJ0AgAAAAEtCQABpAAAAAEFAAAACGd1ZXNzRW5kAgAAAAFfCQABpAAAAAEFAAAABHJhbmQEAAAADXdyaXRlTGFzdFBsYXkJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAC2xhc3RQbGF5S2V5BQAAAARyYW5kCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAdnYW1lS2V5BQAAAANzdHIJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADWdhbWVOdW1iZXJLZXkJAABkAAAAAgUAAAAGZ2FtZUlkAAAAAAAAAAABBQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAA13cml0ZUxhc3RQbGF5CQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwAAAABAAAAAWkBAAAACXplcm8yaGVybwAAAAIAAAAKZ3Vlc3NTdGFydAAAAAhndWVzc0VuZAkBAAAACnN0YXJ0TG90dG8AAAADBQAAAAFpBQAAAApndWVzc1N0YXJ0BQAAAAhndWVzc0VuZAAAAABUQHCh", "height": 1746502, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E8cM5giqzw6mscXVhAKh8GjhGNrHukmGYcMWNwMN9tn7 Next: 9zyoZV4p2Zr3MGLcHxtstmu74XuMaaVpxxTzSVyzc19Q Diff:
Old | New | Differences | |
---|---|---|---|
68 | 68 | then 1 | |
69 | 69 | else throw("Match error") | |
70 | 70 | } | |
71 | + | let y = ((t + "_") + toString(w)) | |
71 | 72 | if (if (((q + 1) > n)) | |
72 | 73 | then (n > (p - 1)) | |
73 | 74 | else false) | |
74 | 75 | then { | |
75 | - | let | |
76 | - | let | |
77 | - | ScriptResult( | |
76 | + | let z = ((((((((((toString(c) + "_WON_") + u) + "_") + y) + "_") + toString(p)) + "-") + toString(q)) + "_") + toString(n)) | |
77 | + | let A = WriteSet([DataEntry(b, n), DataEntry(y, z), DataEntry(a, (w + 1))]) | |
78 | + | ScriptResult(A, TransferSet([ScriptTransfer(j.caller, ((s.amount * e(((q - p) + 1))) / 100), unit)])) | |
78 | 79 | } | |
79 | 80 | else { | |
80 | - | let | |
81 | - | let | |
82 | - | ScriptResult( | |
81 | + | let z = ((((((((((toString(c) + "_LOSE_") + u) + "_") + y) + "_") + toString(p)) + "-") + toString(q)) + "_") + toString(n)) | |
82 | + | let A = WriteSet([DataEntry(b, n), DataEntry(y, z), DataEntry(a, (w + 1))]) | |
83 | + | ScriptResult(A, TransferSet(nil)) | |
83 | 84 | } | |
84 | 85 | } | |
85 | 86 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "$GAME_NUMBER" | |
5 | 5 | ||
6 | 6 | let b = "$LAST_PLAY" | |
7 | 7 | ||
8 | 8 | let c = 1 | |
9 | 9 | ||
10 | 10 | let d = 2 | |
11 | 11 | ||
12 | 12 | func e (f) = { | |
13 | 13 | let g = 6 | |
14 | 14 | let h = 10000 | |
15 | 15 | ((h * ((100 - 6) / 100)) / f) | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func i (j) = { | |
20 | 20 | let k = { | |
21 | 21 | let l = getBinary(this, b) | |
22 | 22 | if ($isInstanceOf(l, "ByteVector")) | |
23 | 23 | then { | |
24 | 24 | let m = l | |
25 | 25 | m | |
26 | 26 | } | |
27 | 27 | else if ($isInstanceOf(l, "Unit")) | |
28 | 28 | then base58'2ee4oFDYriWJ9EMeR' | |
29 | 29 | else throw("Match error") | |
30 | 30 | } | |
31 | 31 | let n = (((((k + j.transactionId) + j.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
32 | 32 | sha256(n) | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func o (j,p,q) = { | |
37 | 37 | let r = (wavesBalance(this) / 100) | |
38 | 38 | let s = extract(j.payment) | |
39 | 39 | if (!(isDefined(j.payment))) | |
40 | 40 | then throw("Should be with Payment in Waves") | |
41 | 41 | else if (isDefined(s.assetId)) | |
42 | 42 | then throw("Payment should be in Waves") | |
43 | 43 | else if ((s.amount > r)) | |
44 | 44 | then throw(("Payment should be less than " + toString(r))) | |
45 | 45 | else if ((0 > p)) | |
46 | 46 | then throw("guessStart and guessEnd Must be in between 0-99") | |
47 | 47 | else if ((q > 99)) | |
48 | 48 | then throw("guessStart and guessEnd Must be in between 0-99") | |
49 | 49 | else if ((p > q)) | |
50 | 50 | then throw("guessStart and guessEnd Must be in between 0-99") | |
51 | 51 | else if ((5 > ((q - p) + 1))) | |
52 | 52 | then throw("guessStart and guessEnd Must be at least 5 apart") | |
53 | 53 | else if ((((q - p) + 1) > 95)) | |
54 | 54 | then throw("guessStart and guessEnd Must not be at least 95 apart") | |
55 | 55 | else { | |
56 | 56 | let t = toBase58String(j.caller.bytes) | |
57 | 57 | let u = toBase58String(j.transactionId) | |
58 | 58 | let v = i(j) | |
59 | 59 | let n = (toInt(v) % 100) | |
60 | 60 | let w = { | |
61 | 61 | let l = getInteger(this, a) | |
62 | 62 | if ($isInstanceOf(l, "Int")) | |
63 | 63 | then { | |
64 | 64 | let x = l | |
65 | 65 | x | |
66 | 66 | } | |
67 | 67 | else if ($isInstanceOf(l, "Unit")) | |
68 | 68 | then 1 | |
69 | 69 | else throw("Match error") | |
70 | 70 | } | |
71 | + | let y = ((t + "_") + toString(w)) | |
71 | 72 | if (if (((q + 1) > n)) | |
72 | 73 | then (n > (p - 1)) | |
73 | 74 | else false) | |
74 | 75 | then { | |
75 | - | let | |
76 | - | let | |
77 | - | ScriptResult( | |
76 | + | let z = ((((((((((toString(c) + "_WON_") + u) + "_") + y) + "_") + toString(p)) + "-") + toString(q)) + "_") + toString(n)) | |
77 | + | let A = WriteSet([DataEntry(b, n), DataEntry(y, z), DataEntry(a, (w + 1))]) | |
78 | + | ScriptResult(A, TransferSet([ScriptTransfer(j.caller, ((s.amount * e(((q - p) + 1))) / 100), unit)])) | |
78 | 79 | } | |
79 | 80 | else { | |
80 | - | let | |
81 | - | let | |
82 | - | ScriptResult( | |
81 | + | let z = ((((((((((toString(c) + "_LOSE_") + u) + "_") + y) + "_") + toString(p)) + "-") + toString(q)) + "_") + toString(n)) | |
82 | + | let A = WriteSet([DataEntry(b, n), DataEntry(y, z), DataEntry(a, (w + 1))]) | |
83 | + | ScriptResult(A, TransferSet(nil)) | |
83 | 84 | } | |
84 | 85 | } | |
85 | 86 | } | |
86 | 87 | ||
87 | 88 | ||
88 | 89 | @Callable(j) | |
89 | 90 | func zero2hero (p,q) = o(j, p, q) | |
90 | 91 | ||
91 | 92 |
github/deemru/w8io/169f3d6 37.50 ms ◑