tx · ATsU1m5FkF1XgRi25BpbYtVX5ExNu2Wz23Mgyja5zCwH

3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H:  -0.00200000 Waves

2022.09.14 22:36 [2229204] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves

{ "type": 13, "id": "ATsU1m5FkF1XgRi25BpbYtVX5ExNu2Wz23Mgyja5zCwH", "fee": 200000, "feeAssetId": null, "timestamp": 1663184207164, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "3DKXWagK4EBZcWD5Sd6XY6KQpTc4e3t8YXgRP8WoLXERUkp2Y1XvRh2ABbeMDuDFX22Gc5xqHnZepKyF8dUQnVQD" ], "script": "base64:BgIKCAISBAoCAggSAAQADGtVc2VyUGF5bWVudAIHUGF5bWVudAAEa1dvbgIDV29uAAlzZXBhcmF0b3ICAS8BCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCxCQEFBGhhc2gJAGoCBQVpbmRleAUFcmFuZ2UCAWkBCGNvdW50aW5nAgVieXRlcwZjYWxsZXIDCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAgpPbmx5IG93bmVyBAVjb3VudAkBCXJhbmRvbWl6ZQIJAMkBAgUFYnl0ZXMJAGkCCQDIAQEFBWJ5dGVzAAIACgMJAGcCBQVjb3VudAADCQDMCAIJAQxCb29sZWFuRW50cnkCCQCsAgIJAKwCAgUEa1dvbgUJc2VwYXJhdG9yBQZjYWxsZXIHBQNuaWwJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAKwCAgkArAICBQRrV29uBQlzZXBhcmF0b3IFBmNhbGxlcgYFA25pbAFpAQlzdGFydEdhbWUABAZhbW91bnQJAQV2YWx1ZQEICQCRAwIIBQFp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B2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgBlsIUU", "height": 2229204, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GsizKh7j4ggip5T1gJgTWa6ZCXBZiJ7cAAwJrQvE8Qx8 Next: EGCRjyGUx2mvfrnXukWTtVknps6FmqeqpzdpXkaRdVLa Diff:
OldNewDifferences
3131 let amount = value(i.payments[0].amount)
3232 if ((i.payments[0].assetId != unit))
3333 then throw("Pay in waves")
34- else if ((amount > 10))
34+ else if ((amount > 1000000000))
3535 then throw("Maximum bet 10 waves")
3636 else {
3737 let nullInitStore = invoke(this, "counting", [i.transactionId, toString(i.caller)], nil)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kUserPayment = "Payment"
55
66 let kWon = "Won"
77
88 let separator = "/"
99
1010 func randomize (bytes,range) = {
1111 let hash = sha256(bytes)
1212 let index = toInt(hash)
1313 (index % range)
1414 }
1515
1616
1717 @Callable(i)
1818 func counting (bytes,caller) = if ((i.caller != this))
1919 then throw("Only owner")
2020 else {
2121 let count = randomize(take(bytes, (size(bytes) / 2)), 10)
2222 if ((count >= 3))
2323 then [BooleanEntry(((kWon + separator) + caller), false)]
2424 else [BooleanEntry(((kWon + separator) + caller), true)]
2525 }
2626
2727
2828
2929 @Callable(i)
3030 func startGame () = {
3131 let amount = value(i.payments[0].amount)
3232 if ((i.payments[0].assetId != unit))
3333 then throw("Pay in waves")
34- else if ((amount > 10))
34+ else if ((amount > 1000000000))
3535 then throw("Maximum bet 10 waves")
3636 else {
3737 let nullInitStore = invoke(this, "counting", [i.transactionId, toString(i.caller)], nil)
3838 if ((nullInitStore == nullInitStore))
3939 then {
4040 let won = valueOrErrorMessage(getBoolean(this, ((kWon + separator) + toString(i.caller))), "Storage read error")
4141 if (won)
4242 then [ScriptTransfer(i.caller, (amount * 2), unit), DeleteEntry(((kWon + separator) + toString(i.caller))), BooleanEntry(((((kWon + separator) + toString(i.caller)) + separator) + toString(randomize(i.transactionId, 1000))), true)]
4343 else [DeleteEntry(((kWon + separator) + toString(i.caller))), BooleanEntry(((((kWon + separator) + toString(i.caller)) + separator) + toString(randomize(i.transactionId, 1000))), false)]
4444 }
4545 else throw("Strict value is not equal to itself.")
4646 }
4747 }
4848
4949

github/deemru/w8io/169f3d6 
54.39 ms