tx · J4prm4G1Ysk7tiGYAQkjhSy3eW1jjybQWtdAtU5F1NJU
3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx: -0.01000000 Waves
2023.05.20 16:05 [2586328] smart account 3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx > SELF 0.00000000 Waves
{
"type": 13,
"id": "J4prm4G1Ysk7tiGYAQkjhSy3eW1jjybQWtdAtU5F1NJU",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1684587931564,
"version": 2,
"chainId": 84,
"sender": "3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx",
"senderPublicKey": "2NK7BrUZMvnHzAoHnJfz3FuDBP5zYUNoxshB49AH2kbc",
"proofs": [
"5LrerkWpZi2HvbfZz3egYPufTHfDXsAZ4JAqfDv6tWHKLvHYajPguWRdq5kthVLM6kj6CJ9SvYqAVxiAcc36G1XU"
],
"script": "base64:BgIECAISAAABAWkBCHJvdWxldHRlAAQDYmV0CAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAQHYXNzZXRJRAgJAJEDAggFAWkIcGF5bWVudHMAAAdhc3NldElkBAFjAgRSaWRlBAdjVG9CeXRlCQCgAwEJAJ4DAQkA2QQBBQFjBAlyYW5kb21OdW0JAGoCBQdjVG9CeXRlAGQEDndpblByb2JhYmlsaXR5AJADBAt3aW5UcmFuc2ZlcgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAGgCBQNiZXQAAgUHYXNzZXRJRAUDbmlsBA13cml0ZUxhc3RQbGF5CQDMCAIJAQxJbnRlZ2VyRW50cnkCAghsYXN0UGxheQUJcmFuZG9tTnVtBQNuaWwDAwkAZwIFDndpblByb2JhYmlsaXR5BQlyYW5kb21OdW0GCQBnAgUJcmFuZG9tTnVtBQ53aW5Qcm9iYWJpbGl0eQkAlAoCBQt3aW5UcmFuc2ZlcgUNd3JpdGVMYXN0UGxheQkAlAoCCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgAABQdhc3NldElEBQNuaWwFDXdyaXRlTGFzdFBsYXkBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5b/ASSg==",
"height": 2586328,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 2FpunriByB1GDBLnzRiLhV14dAcwxKRrvyAgXYnJdWtF
Next: 7gipKTnrot2dPzh2USh4gEKqqjZwfNwY95k1SxtQshw7
Diff:
Old | New | | Differences |
---|
10 | 10 | | let c = "Ride" |
---|
11 | 11 | | let cToByte = toInt(toBigInt(fromBase58String(c))) |
---|
12 | 12 | | let randomNum = (cToByte % 100) |
---|
13 | | - | let winProbability = 40 |
---|
| 13 | + | let winProbability = 400 |
---|
14 | 14 | | let winTransfer = [ScriptTransfer(i.caller, (bet * 2), assetID)] |
---|
15 | 15 | | let writeLastPlay = [IntegerEntry("lastPlay", randomNum)] |
---|
16 | | - | if ((winProbability > randomNum)) |
---|
| 16 | + | if (if ((winProbability >= randomNum)) |
---|
| 17 | + | then true |
---|
| 18 | + | else (randomNum >= winProbability)) |
---|
17 | 19 | | then $Tuple2(winTransfer, writeLastPlay) |
---|
18 | 20 | | else $Tuple2([ScriptTransfer(i.caller, 0, assetID)], writeLastPlay) |
---|
19 | 21 | | } |
---|
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 | 10 | | let c = "Ride" |
---|
11 | 11 | | let cToByte = toInt(toBigInt(fromBase58String(c))) |
---|
12 | 12 | | let randomNum = (cToByte % 100) |
---|
13 | | - | let winProbability = 40 |
---|
| 13 | + | let winProbability = 400 |
---|
14 | 14 | | let winTransfer = [ScriptTransfer(i.caller, (bet * 2), assetID)] |
---|
15 | 15 | | let writeLastPlay = [IntegerEntry("lastPlay", randomNum)] |
---|
16 | | - | if ((winProbability > randomNum)) |
---|
| 16 | + | if (if ((winProbability >= randomNum)) |
---|
| 17 | + | then true |
---|
| 18 | + | else (randomNum >= winProbability)) |
---|
17 | 19 | | then $Tuple2(winTransfer, writeLastPlay) |
---|
18 | 20 | | else $Tuple2([ScriptTransfer(i.caller, 0, assetID)], writeLastPlay) |
---|
19 | 21 | | } |
---|
20 | 22 | | |
---|
21 | 23 | | |
---|
22 | 24 | | @Verifier(tx) |
---|
23 | 25 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
24 | 26 | | |
---|