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