tx · FcQXqyA2kmmJVmWfmZscfU5pjMzk9LCEnkj6w47cStio

3MxnEkmoWrYFsHRZDJMw77y9wCDAgB39ftt:  -0.01000000 Waves

2023.06.21 01:15 [2631545] smart account 3MxnEkmoWrYFsHRZDJMw77y9wCDAgB39ftt > SELF 0.00000000 Waves

{ "type": 13, "id": "FcQXqyA2kmmJVmWfmZscfU5pjMzk9LCEnkj6w47cStio", "fee": 1000000, "feeAssetId": null, "timestamp": 1687299379202, "version": 2, "chainId": 84, "sender": "3MxnEkmoWrYFsHRZDJMw77y9wCDAgB39ftt", "senderPublicKey": "Dtj8LFhKm9c6b5sQXEGNawR8YdhfrXvYCcsYzRddC9dU", "proofs": [ "64MQw7rFnCQjMPnKMahmWDSZcdSzUQM3zShSpCxLfFyaPJenN7itk8cGw1nt9vdUkYXEw4pkXmA6cgByUYvjgJ3P" ], "script": "base64:BgIGCAISABIABQAMa1VzZXJQYXltZW50AgdQYXltZW50AARrV29uAgNXb24ACXNlcGFyYXRvcgIBXwEJcmFuZG9taXplAgVieXRlcwVyYW5nZQQEaGFzaAkA9wMBBQVieXRlcwQFaW5kZXgJALEJAQUEaGFzaAkAagIFBWluZGV4BQVyYW5nZQEIY291bnRpbmcBBWJ5dGVzBAVjb3VudAkBCXJhbmRvbWl6ZQIFBWJ5dGVzAAoDCQBnAgUFY291bnQAAwcGAgFpAQtwYXJzZVN0cnVjdAADCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAgpPbmx5IG93bmVyBAx3aW5uZXJTdHJ1Y3QJAQhjb3VudGluZwEIBQFpDXRyYW5zYWN0aW9uSWQJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAKwCAgkArAICCQCsAgIFBGtXb24FCXNlcGFyYXRvcgkApQgBCAUBaQZjYWxsZXIJAKQDAQkBCXJhbmRvbWl6ZQIIBQFpDXRyYW5zYWN0aW9uSWQA6AcFDHdpbm5lclN0cnVjdAkAzAgCCQEMQm9vbGVhbkVudHJ5AgUEa1dvbgUMd2lubmVyU3RydWN0BQNuaWwBaQEJc3RhcnRHYW1lAAQGYW1vdW50CQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAMJAQIhPQIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUEdW5pdAkAAgECDFBheSBpbiB3YXZlcwMJAGYCBQZhbW91bnQACgkAAgECD1RvbyBtdWNoIGFtb3VudAQNbnVsbEluaXRTdG9yZQkA/AcEBQR0aGlzAgtwYXJzZVN0cnVjdAUDbmlsBQNuaWwDCQAAAgUNbnVsbEluaXRTdG9yZQUNbnVsbEluaXRTdG9yZQQDd29uCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJsIAgUEdGhpcwUEa1dvbgISU3RvcmFnZSByZWFkIGVycm9yAwUDd29uCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkAaAIFBmFtb3VudAACBQR1bml0BQNuaWwFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgA6xAXo", "height": 2631545, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 2ABDdTt6BirjynaBq4FLw6jaovDY55J3tVMdoeRRUYM2 Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let kUserPayment = "Payment"
5+
6+let kWon = "Won"
7+
8+let separator = "_"
9+
10+func randomize (bytes,range) = {
11+ let hash = sha256(bytes)
12+ let index = toInt(hash)
13+ (index % range)
14+ }
15+
16+
17+func counting (bytes) = {
18+ let count = randomize(bytes, 10)
19+ if ((count >= 3))
20+ then false
21+ else true
22+ }
23+
24+
25+@Callable(i)
26+func parseStruct () = if ((i.caller != this))
27+ then throw("Only owner")
28+ else {
29+ let winnerStruct = counting(i.transactionId)
30+[BooleanEntry((((kWon + separator) + toString(i.caller)) + toString(randomize(i.transactionId, 1000))), winnerStruct), BooleanEntry(kWon, winnerStruct)]
31+ }
32+
33+
34+
35+@Callable(i)
36+func startGame () = {
37+ let amount = value(i.payments[0].amount)
38+ if ((i.payments[0].assetId != unit))
39+ then throw("Pay in waves")
40+ else if ((amount > 10))
41+ then throw("Too much amount")
42+ else {
43+ let nullInitStore = invoke(this, "parseStruct", nil, nil)
44+ if ((nullInitStore == nullInitStore))
45+ then {
46+ let won = valueOrErrorMessage(getBoolean(this, kWon), "Storage read error")
47+ if (won)
48+ then [ScriptTransfer(i.caller, (amount * 2), unit)]
49+ else nil
50+ }
51+ else throw("Strict value is not equal to itself.")
52+ }
53+ }
54+
55+

github/deemru/w8io/026f985 
18.59 ms