tx · 6rpwmyD7my3b2qnNqmrZ2EGGnSJgvMru3qMiQzb2XVMh 3N3zK9Xg7d3QD2sYmufkH8RwfqJBS6UNtv4: -0.05000000 Waves 2023.05.07 05:22 [2566824] smart account 3N3zK9Xg7d3QD2sYmufkH8RwfqJBS6UNtv4 > SELF 0.00000000 Waves
{ "type": 13, "id": "6rpwmyD7my3b2qnNqmrZ2EGGnSJgvMru3qMiQzb2XVMh", "fee": 5000000, "feeAssetId": null, "timestamp": 1683426190306, "version": 2, "chainId": 84, "sender": "3N3zK9Xg7d3QD2sYmufkH8RwfqJBS6UNtv4", "senderPublicKey": "56zinHFJSYYBPx7s5gFUziCFxLNevABDB67aLXj8E3do", "proofs": [ "4kZ5xnyJ9Zsd9B1bn8YBAu8gZgUBfQZU473gDxvtHDdCp7rbeaLy13Fqnq7SM9cX1HsH1pZuh2VdNxbFr3C51zQm" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIBCBIECgIECAAAAAMAAAAAGWJpZ0ludEhhc2hEaXZpc29yQ29pbkZMaXAJAABsAAAABgAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAGSEFMRlVQAAAAABhiaWdJbnRIYXNoRGl2aXNvckNvaW5CZXQJAABsAAAABgAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAGSEFMRlVQAQAAAAppc05lZ2F0aXZlAAAAAQAAAAFuAwkAAGYAAAACAAAAAAAAAAAABQAAAAFuCQAAaAAAAAIFAAAAAW4A//////////8FAAAAAW4AAAACAAAAAWkBAAAAC2JldFRvTnVtYmVyAAAAAgAAAAZudW1iZXIAAAADcmVmAwMJAABmAAAAAgAAAAAAAAGGoAgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50BgkAAGYAAAACCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAA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IAAAAGX2Jsb2NrBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAQbGFzdF90eF9jb2luZmxpcAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAFX2JldF8JAAGkAAAAAQkAAGQAAAACBQAAAAF4AAAAAAAAAAABAgAAAA9faGVhZHNfb3JfdGFpbHMFAAAACHJlc3VsdF93CQAETAAAAAIFAAAABXJlZnR4CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAFX2JldF8JAAGkAAAAAQkAAGQAAAACBQAAAAF4AAAAAAAAAAABAgAAAAdfcmVzdWx0BQAAAAZyZXN1bHQJAARMAAAAAgUAAAAFdHhQYXkFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5w9TqsA==", "height": 2566824, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BitvkqbbQRgzr88RdzzueqqtV7HERcbqE8iPA8keQta5 Next: v2rRzVQvcqdQFa2Ui4aTQ93gsWdjiSuzhc7Qyh9aa1P Diff:
Old | New | Differences | |
---|---|---|---|
40 | 40 | then "win" | |
41 | 41 | else "loss" | |
42 | 42 | let transfr = if ((result == "win")) | |
43 | - | then ( | |
43 | + | then (990000000 / (99 - number)) | |
44 | 44 | else 0 | |
45 | 45 | let transfer = ((i.payments[0].amount * transfr) / 100000000) | |
46 | 46 | let txPay = if ((transfer == 0)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let bigIntHashDivisorCoinFLip = pow(10, 0, 16, 0, 0, HALFUP) | |
5 | 5 | ||
6 | 6 | let bigIntHashDivisorCoinBet = pow(10, 0, 16, 0, 0, HALFUP) | |
7 | 7 | ||
8 | 8 | func isNegative (n) = if ((0 > n)) | |
9 | 9 | then (n * -1) | |
10 | 10 | else n | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | @Callable(i) | |
14 | 14 | func betToNumber (number,ref) = if (if ((100000 > i.payments[0].amount)) | |
15 | 15 | then true | |
16 | 16 | else (i.payments[0].amount > 1000000000)) | |
17 | 17 | then throw("Invalid Waves amount. Min value: 0.1 Waves. Max Value: 10 Waves") | |
18 | 18 | else if ((i.payments[0].assetId != unit)) | |
19 | 19 | then throw("Invalid assetId") | |
20 | 20 | else if (if ((0 >= number)) | |
21 | 21 | then true | |
22 | 22 | else (number >= 99)) | |
23 | 23 | then throw("Error: Invalid Number") | |
24 | 24 | else { | |
25 | 25 | let x = if (isDefined(getInteger((toBase58String(i.caller.bytes) + "_bets")))) | |
26 | 26 | then getIntegerValue((toBase58String(i.caller.bytes) + "_bets")) | |
27 | 27 | else 0 | |
28 | 28 | let ref1 = if ((ref == "")) | |
29 | 29 | then toBase58String(this.bytes) | |
30 | 30 | else ref | |
31 | 31 | let toRef = ((i.payments[0].amount * 1) / 100) | |
32 | 32 | let lastTx = if (isDefined(getString("last_tx_bet"))) | |
33 | 33 | then (isNegative(toInt(sha256(fromBase58String(getStringValue("last_tx_bet"))))) / bigIntHashDivisorCoinBet) | |
34 | 34 | else (isNegative(toInt(sha256(sha256(i.transactionId)))) / bigIntHashDivisorCoinBet) | |
35 | 35 | let txxz = (isNegative(toInt(sha256(i.transactionId))) / bigIntHashDivisorCoinBet) | |
36 | 36 | let f = if ((txxz > lastTx)) | |
37 | 37 | then (txxz - lastTx) | |
38 | 38 | else (lastTx - txxz) | |
39 | 39 | let result = if ((f > number)) | |
40 | 40 | then "win" | |
41 | 41 | else "loss" | |
42 | 42 | let transfr = if ((result == "win")) | |
43 | - | then ( | |
43 | + | then (990000000 / (99 - number)) | |
44 | 44 | else 0 | |
45 | 45 | let transfer = ((i.payments[0].amount * transfr) / 100000000) | |
46 | 46 | let txPay = if ((transfer == 0)) | |
47 | 47 | then IntegerEntry(((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)), i.payments[0].amount) | |
48 | 48 | else ScriptTransfer(Address(i.caller.bytes), (i.payments[0].amount * 2), unit) | |
49 | 49 | let reftx = if ((ref1 == toBase58String(this.bytes))) | |
50 | 50 | then IntegerEntry((((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)) + "_ref"), toRef) | |
51 | 51 | else ScriptTransfer(Address(fromBase58String(ref1)), toRef, unit) | |
52 | 52 | [IntegerEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_mult"), transfr), IntegerEntry((toBase58String(i.caller.bytes) + "_bets"), (x + 1)), IntegerEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_value"), number), IntegerEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_result_number"), f), StringEntry(((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))), toBase58String(i.transactionId)), StringEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_ref"), ref1), IntegerEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_block"), height), IntegerEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_transfer_final"), transfer), StringEntry("last_tx_coinflip", toBase58String(i.transactionId)), reftx, StringEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_result"), result), txPay] | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(i) | |
58 | 58 | func betCoinFlip (isHeads,ref) = if (if ((100000 > i.payments[0].amount)) | |
59 | 59 | then true | |
60 | 60 | else (i.payments[0].amount > 1000000000)) | |
61 | 61 | then throw("Invalid Waves amount. Min value: 0.1 Waves. Max Value: 10 Waves") | |
62 | 62 | else if ((i.payments[0].assetId != unit)) | |
63 | 63 | then throw("Invalid assetId") | |
64 | 64 | else { | |
65 | 65 | let x = if (isDefined(getInteger((toBase58String(i.caller.bytes) + "_bets")))) | |
66 | 66 | then getIntegerValue((toBase58String(i.caller.bytes) + "_bets")) | |
67 | 67 | else 0 | |
68 | 68 | let ref1 = if ((ref == "")) | |
69 | 69 | then toBase58String(this.bytes) | |
70 | 70 | else ref | |
71 | 71 | let toRef = ((i.payments[0].amount * 1) / 100) | |
72 | 72 | let lastTx = if (isDefined(getString("last_tx_bet"))) | |
73 | 73 | then (isNegative(toInt(sha256(fromBase58String(getStringValue("last_tx_bet"))))) / bigIntHashDivisorCoinFLip) | |
74 | 74 | else (isNegative(toInt(sha256(sha256(i.transactionId)))) / bigIntHashDivisorCoinFLip) | |
75 | 75 | let txxz = (isNegative(toInt(sha256(i.transactionId))) / bigIntHashDivisorCoinFLip) | |
76 | 76 | let f = if ((txxz > lastTx)) | |
77 | 77 | then (txxz - lastTx) | |
78 | 78 | else (lastTx - txxz) | |
79 | 79 | let result_w = if (if (if (if (if ((f == 0)) | |
80 | 80 | then true | |
81 | 81 | else (f == 2)) | |
82 | 82 | then true | |
83 | 83 | else (f == 4)) | |
84 | 84 | then true | |
85 | 85 | else (f == 6)) | |
86 | 86 | then true | |
87 | 87 | else (f == 8)) | |
88 | 88 | then "heads" | |
89 | 89 | else "tails" | |
90 | 90 | let result = if (if (if (isHeads) | |
91 | 91 | then if (if (if (if ((f == 0)) | |
92 | 92 | then true | |
93 | 93 | else (f == 2)) | |
94 | 94 | then true | |
95 | 95 | else (f == 4)) | |
96 | 96 | then true | |
97 | 97 | else (f == 6)) | |
98 | 98 | then true | |
99 | 99 | else (f == 8) | |
100 | 100 | else false) | |
101 | 101 | then true | |
102 | 102 | else if (!(isHeads)) | |
103 | 103 | then if (if (if (if ((f == 1)) | |
104 | 104 | then true | |
105 | 105 | else (f == 3)) | |
106 | 106 | then true | |
107 | 107 | else (f == 5)) | |
108 | 108 | then true | |
109 | 109 | else (f == 7)) | |
110 | 110 | then true | |
111 | 111 | else (f == 9) | |
112 | 112 | else false) | |
113 | 113 | then "win" | |
114 | 114 | else "loss" | |
115 | 115 | let transfer = if ((result == "win")) | |
116 | 116 | then (i.payments[0].amount * 2) | |
117 | 117 | else 0 | |
118 | 118 | let txPay = if ((transfer == 0)) | |
119 | 119 | then IntegerEntry(((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)), i.payments[0].amount) | |
120 | 120 | else ScriptTransfer(Address(i.caller.bytes), (i.payments[0].amount * 2), unit) | |
121 | 121 | let reftx = if ((ref1 == toBase58String(this.bytes))) | |
122 | 122 | then IntegerEntry((((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)) + "_ref"), toRef) | |
123 | 123 | else ScriptTransfer(Address(fromBase58String(ref1)), toRef, unit) | |
124 | 124 | [IntegerEntry((toBase58String(i.caller.bytes) + "_bets"), (x + 1)), BooleanEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_value"), isHeads), StringEntry(((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))), toBase58String(i.transactionId)), StringEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_ref"), ref1), IntegerEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_block"), height), StringEntry("last_tx_coinflip", toBase58String(i.transactionId)), StringEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_heads_or_tails"), result_w), reftx, StringEntry((((toBase58String(i.caller.bytes) + "_bet_") + toString((x + 1))) + "_result"), result), txPay] | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Verifier(tx) | |
129 | 129 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
130 | 130 |
github/deemru/w8io/169f3d6 40.29 ms ◑