tx · 4wzA2pgMgLEnTW3524qw8GoWkEA6U3YDGKqZzSSg5TNG

3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H:  -0.01000000 Waves

2022.11.03 15:30 [2300940] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves

{ "type": 13, "id": "4wzA2pgMgLEnTW3524qw8GoWkEA6U3YDGKqZzSSg5TNG", "fee": 1000000, "feeAssetId": null, "timestamp": 1667478671097, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "LWX44RsRhxAMrBDj1zFBKeVCetbE2gD7YSBDqMDbAREh15Zd4uzTBUZq7NxfLhDyy18Ftj16nEgXTF1KFtBdyxK" ], "script": "base64:BgIGCAISABIABAAMa1VzZXJQYXltZW50AgdQYXltZW50AARrV29uAgNXb24BCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCxCQEFBGhhc2gJAGoCBQVpbmRleAUFcmFuZ2UBCGNvdW50aW5nAQVieXRlcwQFY291bnQJAQlyYW5kb21pemUCBQVieXRlcwAKAwkAZwIFBWNvdW50AAQJAQxCb29sZWFuRW50cnkCBQRrV29uBwkBDEJvb2xlYW5FbnRyeQIFBGtXb24GAgFpAQtwYXJzZVN0cnVjdAADCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAgpPbmx5IG93bmVyBAx3aW5uZXJTdHJ1Y3QJAQhjb3VudGluZwEIBQFpDXRyYW5zYWN0aW9uSWQJAMwIAgUMd2lubmVyU3RydWN0BQNuaWwBaQEJc3RhcnRHYW1lAAQGYW1vdW50CQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAMJAQIhPQIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUEdW5pdAkAAgECDFBheSBpbiB3YXZlcwQNbnVsbEluaXRTdG9yZQkA/AcEBQR0aGlzAgtwYXJzZVN0cnVjdAUDbmlsBQNuaWwDCQAAAgUNbnVsbEluaXRTdG9yZQUNbnVsbEluaXRTdG9yZQQDd29uCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJsIAgUEdGhpcwUEa1dvbgISU3RvcmFnZSByZWFkIGVycm9yAwUDd29uCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkAaAIFBmFtb3VudAACBQR1bml0BQNuaWwFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAZzlM7", "height": 2300940, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4M25nG2EekvaEe7Lpg19MC8vmMT9HGJVtWgTHUofyTfx Next: G2jpkvs23rvUiNtwGXFhXnAka56MmC7u5spY7akq24Uv 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 func randomize (bytes,range) = {
99 let hash = sha256(bytes)
1010 let index = toInt(hash)
1111 (index % range)
1212 }
1313
1414
1515 func counting (bytes) = {
1616 let count = randomize(bytes, 10)
1717 if ((count >= 4))
1818 then BooleanEntry(kWon, false)
1919 else BooleanEntry(kWon, true)
2020 }
2121
2222
2323 @Callable(i)
2424 func parseStruct () = if ((i.caller != this))
2525 then throw("Only owner")
2626 else {
2727 let winnerStruct = counting(i.transactionId)
2828 [winnerStruct]
2929 }
3030
3131
3232
3333 @Callable(i)
3434 func startGame () = {
3535 let amount = value(i.payments[0].amount)
3636 if ((i.payments[0].assetId != unit))
3737 then throw("Pay in waves")
3838 else {
3939 let nullInitStore = invoke(this, "parseStruct", nil, nil)
4040 if ((nullInitStore == nullInitStore))
4141 then {
4242 let won = valueOrErrorMessage(getBoolean(this, kWon), "Storage read error")
4343 if (won)
4444 then [ScriptTransfer(i.caller, (amount * 2), unit)]
4545 else nil
4646 }
4747 else throw("Strict value is not equal to itself.")
4848 }
4949 }
5050
5151

github/deemru/w8io/026f985 
32.40 ms