tx · FnwxsSvoiCPq72r5QcjKBqLBMQv7VK8BZdWwdBKiLQVX
3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx: -0.01000000 Waves
2023.05.20 20:04 [2586565] smart account 3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx > SELF 0.00000000 Waves
{
"type": 13,
"id": "FnwxsSvoiCPq72r5QcjKBqLBMQv7VK8BZdWwdBKiLQVX",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1684602293497,
"version": 2,
"chainId": 84,
"sender": "3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx",
"senderPublicKey": "2NK7BrUZMvnHzAoHnJfz3FuDBP5zYUNoxshB49AH2kbc",
"proofs": [
"3PnxjmG9yHyM3j8emLsBjBhGVpcnwW8tFkJDy1R1TbBF6V8t9Rx9pqQHehaTbqrWwNqhTJic6X734qTPJ6pPMeF1"
],
"script": "base64:BgIECAISAAABAWkBCHJvdWxldHRlAAQDYmV0CAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAQHYXNzZXRJRAgJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBAFjAgRSaWRlBAdjVG9CeXRlCQCgAwEJAJ4DAQkA2QQBBQFjBAlyYW5kb21OdW0JAGoCCQBkAgkAZAIJAGQCCQBkAgkAZAIJAGQCBQdjVG9CeXRlCQCxCQEIBQFpD2NhbGxlclB1YmxpY0tleQgFCWxhc3RCbG9jawZoZWlnaHQIBQlsYXN0QmxvY2sJdGltZXN0YW1wCAUJbGFzdEJsb2NrCmJhc2VUYXJnZXQFA2JldAgFAWkDZmVlAGQEDndpblByb2JhYmlsaXR5ACgEC3dpblRyYW5zZmVyCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkAaAIFA2JldAACBQdhc3NldElEBQNuaWwEDXdyaXRlTGFzdFBsYXkJAMwIAgkBDEludGVnZXJFbnRyeQICCGxhc3RQbGF5BQlyYW5kb21OdW0FA25pbAMJAQEhAQkBCWlzRGVmaW5lZAEIBQFpCHBheW1lbnRzCQACAQIfU2hvdWxkIGJlIHdpdGggUGF5bWVudCBpbiBXYXZlcwMJAGYCBQ53aW5Qcm9iYWJpbGl0eQUJcmFuZG9tTnVtCQCUCgIFC3dpblRyYW5zZmVyBQ13cml0ZUxhc3RQbGF5CQCUCgIJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyAAAFB2Fzc2V0SUQFA25pbAUNd3JpdGVMYXN0UGxheQECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkRhoOH",
"height": 2586565,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: EdZUs4d844EMbecgwXifRgw1KxBW244Ti8iKpqm5whSB
Next: CgvD1Xr11vKjBV3QBvdg53vDeyTWtRUYq2kJXr2k3wri
Diff:
Old | New | | Differences |
---|
7 | 7 | | func roulette () = { |
---|
8 | 8 | | let bet = i.payments[0].amount |
---|
9 | 9 | | let assetID = i.payments[0].assetId |
---|
10 | | - | let c = "Ridee" |
---|
| 10 | + | let c = "Ride" |
---|
11 | 11 | | let cToByte = toInt(toBigInt(fromBase58String(c))) |
---|
12 | | - | let randomNum = ((((cToByte + toInt(i.callerPublicKey)) + lastBlock.height) + lastBlock.timestamp) % 100) |
---|
| 12 | + | let randomNum = (((((((cToByte + toInt(i.callerPublicKey)) + lastBlock.height) + lastBlock.timestamp) + lastBlock.baseTarget) + bet) + i.fee) % 100) |
---|
13 | 13 | | let winProbability = 40 |
---|
14 | | - | let getNum = getInteger(this, "Random Number") |
---|
15 | | - | [IntegerEntry("Random Number: ", randomNum)] |
---|
| 14 | + | let winTransfer = [ScriptTransfer(i.caller, (bet * 2), assetID)] |
---|
| 15 | + | let writeLastPlay = [IntegerEntry("lastPlay", randomNum)] |
---|
| 16 | + | if (!(isDefined(i.payments))) |
---|
| 17 | + | then throw("Should be with Payment in Waves") |
---|
| 18 | + | else if ((winProbability > randomNum)) |
---|
| 19 | + | then $Tuple2(winTransfer, writeLastPlay) |
---|
| 20 | + | else $Tuple2([ScriptTransfer(i.caller, 0, assetID)], writeLastPlay) |
---|
16 | 21 | | } |
---|
17 | 22 | | |
---|
18 | 23 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func roulette () = { |
---|
8 | 8 | | let bet = i.payments[0].amount |
---|
9 | 9 | | let assetID = i.payments[0].assetId |
---|
10 | | - | let c = "Ridee" |
---|
| 10 | + | let c = "Ride" |
---|
11 | 11 | | let cToByte = toInt(toBigInt(fromBase58String(c))) |
---|
12 | | - | let randomNum = ((((cToByte + toInt(i.callerPublicKey)) + lastBlock.height) + lastBlock.timestamp) % 100) |
---|
| 12 | + | let randomNum = (((((((cToByte + toInt(i.callerPublicKey)) + lastBlock.height) + lastBlock.timestamp) + lastBlock.baseTarget) + bet) + i.fee) % 100) |
---|
13 | 13 | | let winProbability = 40 |
---|
14 | | - | let getNum = getInteger(this, "Random Number") |
---|
15 | | - | [IntegerEntry("Random Number: ", randomNum)] |
---|
| 14 | + | let winTransfer = [ScriptTransfer(i.caller, (bet * 2), assetID)] |
---|
| 15 | + | let writeLastPlay = [IntegerEntry("lastPlay", randomNum)] |
---|
| 16 | + | if (!(isDefined(i.payments))) |
---|
| 17 | + | then throw("Should be with Payment in Waves") |
---|
| 18 | + | else if ((winProbability > randomNum)) |
---|
| 19 | + | then $Tuple2(winTransfer, writeLastPlay) |
---|
| 20 | + | else $Tuple2([ScriptTransfer(i.caller, 0, assetID)], writeLastPlay) |
---|
16 | 21 | | } |
---|
17 | 22 | | |
---|
18 | 23 | | |
---|
19 | 24 | | @Verifier(tx) |
---|
20 | 25 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
21 | 26 | | |
---|