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//////////8FAAAAAW4AAAACAAAAAWkBAAAAC2JldFRvTnVtYmVyAAAAAgAAAAZudW1iZXIAAAADcmVmAwMJAABmAAAAAgAAAAAAAAGGoAgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAGYW1vdW50BgkAAGYAAAACCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAA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QIAAAAGX2Jsb2NrBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAQbGFzdF90eF9jb2luZmxpcAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAFX2JldF8JAAGkAAAAAQkAAGQAAAACBQAAAAF4AAAAAAAAAAABAgAAAA9faGVhZHNfb3JfdGFpbHMFAAAACHJlc3VsdF93CQAETAAAAAIFAAAABXJlZnR4CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAFX2JldF8JAAGkAAAAAQkAAGQAAAACBQAAAAF4AAAAAAAAAAABAgAAAAdfcmVzdWx0BQAAAAZyZXN1bHQJAARMAAAAAgUAAAAFdHhQYXkFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5w9TqsA==", "height": 2566824, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BitvkqbbQRgzr88RdzzueqqtV7HERcbqE8iPA8keQta5 Next: v2rRzVQvcqdQFa2Ui4aTQ93gsWdjiSuzhc7Qyh9aa1P Diff:
OldNewDifferences
4040 then "win"
4141 else "loss"
4242 let transfr = if ((result == "win"))
43- then (9900000000 / (99 - number))
43+ then (990000000 / (99 - number))
4444 else 0
4545 let transfer = ((i.payments[0].amount * transfr) / 100000000)
4646 let txPay = if ((transfer == 0))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let bigIntHashDivisorCoinFLip = pow(10, 0, 16, 0, 0, HALFUP)
55
66 let bigIntHashDivisorCoinBet = pow(10, 0, 16, 0, 0, HALFUP)
77
88 func isNegative (n) = if ((0 > n))
99 then (n * -1)
1010 else n
1111
1212
1313 @Callable(i)
1414 func betToNumber (number,ref) = if (if ((100000 > i.payments[0].amount))
1515 then true
1616 else (i.payments[0].amount > 1000000000))
1717 then throw("Invalid Waves amount. Min value: 0.1 Waves. Max Value: 10 Waves")
1818 else if ((i.payments[0].assetId != unit))
1919 then throw("Invalid assetId")
2020 else if (if ((0 >= number))
2121 then true
2222 else (number >= 99))
2323 then throw("Error: Invalid Number")
2424 else {
2525 let x = if (isDefined(getInteger((toBase58String(i.caller.bytes) + "_bets"))))
2626 then getIntegerValue((toBase58String(i.caller.bytes) + "_bets"))
2727 else 0
2828 let ref1 = if ((ref == ""))
2929 then toBase58String(this.bytes)
3030 else ref
3131 let toRef = ((i.payments[0].amount * 1) / 100)
3232 let lastTx = if (isDefined(getString("last_tx_bet")))
3333 then (isNegative(toInt(sha256(fromBase58String(getStringValue("last_tx_bet"))))) / bigIntHashDivisorCoinBet)
3434 else (isNegative(toInt(sha256(sha256(i.transactionId)))) / bigIntHashDivisorCoinBet)
3535 let txxz = (isNegative(toInt(sha256(i.transactionId))) / bigIntHashDivisorCoinBet)
3636 let f = if ((txxz > lastTx))
3737 then (txxz - lastTx)
3838 else (lastTx - txxz)
3939 let result = if ((f > number))
4040 then "win"
4141 else "loss"
4242 let transfr = if ((result == "win"))
43- then (9900000000 / (99 - number))
43+ then (990000000 / (99 - number))
4444 else 0
4545 let transfer = ((i.payments[0].amount * transfr) / 100000000)
4646 let txPay = if ((transfer == 0))
4747 then IntegerEntry(((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)), i.payments[0].amount)
4848 else ScriptTransfer(Address(i.caller.bytes), (i.payments[0].amount * 2), unit)
4949 let reftx = if ((ref1 == toBase58String(this.bytes)))
5050 then IntegerEntry((((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)) + "_ref"), toRef)
5151 else ScriptTransfer(Address(fromBase58String(ref1)), toRef, unit)
5252 [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]
5353 }
5454
5555
5656
5757 @Callable(i)
5858 func betCoinFlip (isHeads,ref) = if (if ((100000 > i.payments[0].amount))
5959 then true
6060 else (i.payments[0].amount > 1000000000))
6161 then throw("Invalid Waves amount. Min value: 0.1 Waves. Max Value: 10 Waves")
6262 else if ((i.payments[0].assetId != unit))
6363 then throw("Invalid assetId")
6464 else {
6565 let x = if (isDefined(getInteger((toBase58String(i.caller.bytes) + "_bets"))))
6666 then getIntegerValue((toBase58String(i.caller.bytes) + "_bets"))
6767 else 0
6868 let ref1 = if ((ref == ""))
6969 then toBase58String(this.bytes)
7070 else ref
7171 let toRef = ((i.payments[0].amount * 1) / 100)
7272 let lastTx = if (isDefined(getString("last_tx_bet")))
7373 then (isNegative(toInt(sha256(fromBase58String(getStringValue("last_tx_bet"))))) / bigIntHashDivisorCoinFLip)
7474 else (isNegative(toInt(sha256(sha256(i.transactionId)))) / bigIntHashDivisorCoinFLip)
7575 let txxz = (isNegative(toInt(sha256(i.transactionId))) / bigIntHashDivisorCoinFLip)
7676 let f = if ((txxz > lastTx))
7777 then (txxz - lastTx)
7878 else (lastTx - txxz)
7979 let result_w = if (if (if (if (if ((f == 0))
8080 then true
8181 else (f == 2))
8282 then true
8383 else (f == 4))
8484 then true
8585 else (f == 6))
8686 then true
8787 else (f == 8))
8888 then "heads"
8989 else "tails"
9090 let result = if (if (if (isHeads)
9191 then if (if (if (if ((f == 0))
9292 then true
9393 else (f == 2))
9494 then true
9595 else (f == 4))
9696 then true
9797 else (f == 6))
9898 then true
9999 else (f == 8)
100100 else false)
101101 then true
102102 else if (!(isHeads))
103103 then if (if (if (if ((f == 1))
104104 then true
105105 else (f == 3))
106106 then true
107107 else (f == 5))
108108 then true
109109 else (f == 7))
110110 then true
111111 else (f == 9)
112112 else false)
113113 then "win"
114114 else "loss"
115115 let transfer = if ((result == "win"))
116116 then (i.payments[0].amount * 2)
117117 else 0
118118 let txPay = if ((transfer == 0))
119119 then IntegerEntry(((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)), i.payments[0].amount)
120120 else ScriptTransfer(Address(i.caller.bytes), (i.payments[0].amount * 2), unit)
121121 let reftx = if ((ref1 == toBase58String(this.bytes)))
122122 then IntegerEntry((((toBase58String(this.bytes) + "_") + toBase58String(i.caller.bytes)) + "_ref"), toRef)
123123 else ScriptTransfer(Address(fromBase58String(ref1)), toRef, unit)
124124 [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]
125125 }
126126
127127
128128 @Verifier(tx)
129129 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
130130

github/deemru/w8io/169f3d6 
40.29 ms