tx · 3vwLZBXeXpbhppwPw7YWyWxpcZujg1Ssb4VhDAX628e2

3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H:  -0.00100000 Waves

2022.08.21 16:06 [2194260] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves

{ "type": 13, "id": "3vwLZBXeXpbhppwPw7YWyWxpcZujg1Ssb4VhDAX628e2", "fee": 100000, "feeAssetId": null, "timestamp": 1661087241231, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "3QhRkf4i4QRv3qZ3tLgqRZ8UnoGtcRCZZc5dweZgKatn4r8U8gaZMM2gxN4qntso1Zyyb96g4t3aSrYMYboJPAa5" ], "script": "base64:BgIGCAISABIABAAMa1VzZXJQYXltZW50AgdQYXltZW50AARrV29uAgNXb24BCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCxCQEFBGhhc2gJAGoCBQVpbmRleAUFcmFuZ2UBCGNvdW50aW5nAQVieXRlcwQFY291bnQJAQlyYW5kb21pemUCBQVieXRlcwAKAwkAZwIFBWNvdW50AAQJAQxCb29sZWFuRW50cnkCBQRrV29uBwkBDEJvb2xlYW5FbnRyeQIFBGtXb24GAgFpAQtwYXJzZVN0cnVjdAADCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAgpPbmx5IG93bmVyBAx3aW5uZXJTdHJ1Y3QJAQhjb3VudGluZwEIBQFpDXRyYW5zYWN0aW9uSWQJAMwIAgUMd2lubmVyU3RydWN0BQNuaWwBaQEJc3RhcnRHYW1lAAQGYW1vdW50CQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAMJAQIhPQIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUEdW5pdAkAAgECDFBheSBpbiB3YXZlcwMJAGYCBQZhbW91bnQAFAkAAgECG1lvdSBjYW5ub3QgYmV0IG1vcmUgdGhhbiAyMAQNbnVsbEluaXRTdG9yZQkA/AcEBQR0aGlzAgtwYXJzZVN0cnVjdAUDbmlsBQNuaWwDCQAAAgUNbnVsbEluaXRTdG9yZQUNbnVsbEluaXRTdG9yZQQDd29uCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJsIAgUEdGhpcwUEa1dvbgISU3RvcmFnZSByZWFkIGVycm9yAwUDd29uCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkAaAIFBmFtb3VudAACBQR1bml0BQNuaWwFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgDDISRQ", "height": 2194260, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: He1ntbKUnrKrALKpgj6xSt5nPfnjJX5ra5dKz9NEMZrL Next: 6cVfMR5CzMZpHZJNrqFrMuh6t53wzkP7ho4pJCEs53QL Diff:
OldNewDifferences
55
66 let b = "Won"
77
8-let c = "/"
9-
10-let d = "|"
11-
12-func e (f,g) = {
13- let h = sha256(f)
14- let i = toInt(h)
15- (i % g)
8+func c (d,e) = {
9+ let f = sha256(d)
10+ let g = toInt(f)
11+ (g % e)
1612 }
1713
1814
19-func j (f,k) = {
20- let l = e(f, 10)
21- if ((l >= 4))
22- then StringEntry(b, ((((toString(k) + c) + "false") + d) + getStringValue(this, b)))
23- else StringEntry(b, ((((toString(k) + c) + "true") + d) + getStringValue(this, b)))
15+func h (d) = {
16+ let i = c(d, 10)
17+ if ((i >= 4))
18+ then BooleanEntry(b, false)
19+ else BooleanEntry(b, true)
2420 }
2521
2622
27-@Callable(m)
28-func initStore () = [StringEntry(b, "0")]
23+@Callable(j)
24+func parseStruct () = if ((j.caller != this))
25+ then throw("Only owner")
26+ else {
27+ let k = h(j.transactionId)
28+[k]
29+ }
2930
3031
3132
32-@Callable(m)
33-func parseStruct () = {
34- let n = reentrantInvoke(this, "initStore", nil, nil)
35- if ((n == n))
36- then if ((m.caller != this))
37- then throw("Only owner")
38- else {
39- let o = j(m.transactionId, m.caller)
40-[o]
41- }
42- else throw("Strict value is not equal to itself.")
43- }
44-
45-
46-
47-@Callable(m)
33+@Callable(j)
4834 func startGame () = {
49- let p = value(m.payments[0].amount)
50- if ((m.payments[0].assetId != unit))
35+ let l = value(j.payments[0].amount)
36+ if ((j.payments[0].assetId != unit))
5137 then throw("Pay in waves")
52- else if ((p > 20))
38+ else if ((l > 20))
5339 then throw("You cannot bet more than 20")
5440 else {
55- let q = valueOrErrorMessage(getBoolean(this, b), "Storage read error")
56- if (q)
57- then [ScriptTransfer(m.caller, (p * 2), unit)]
58- else nil
41+ let m = invoke(this, "parseStruct", nil, nil)
42+ if ((m == m))
43+ then {
44+ let n = valueOrErrorMessage(getBoolean(this, b), "Storage read error")
45+ if (n)
46+ then [ScriptTransfer(j.caller, (l * 2), unit)]
47+ else nil
48+ }
49+ else throw("Strict value is not equal to itself.")
5950 }
6051 }
6152
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "Payment"
55
66 let b = "Won"
77
8-let c = "/"
9-
10-let d = "|"
11-
12-func e (f,g) = {
13- let h = sha256(f)
14- let i = toInt(h)
15- (i % g)
8+func c (d,e) = {
9+ let f = sha256(d)
10+ let g = toInt(f)
11+ (g % e)
1612 }
1713
1814
19-func j (f,k) = {
20- let l = e(f, 10)
21- if ((l >= 4))
22- then StringEntry(b, ((((toString(k) + c) + "false") + d) + getStringValue(this, b)))
23- else StringEntry(b, ((((toString(k) + c) + "true") + d) + getStringValue(this, b)))
15+func h (d) = {
16+ let i = c(d, 10)
17+ if ((i >= 4))
18+ then BooleanEntry(b, false)
19+ else BooleanEntry(b, true)
2420 }
2521
2622
27-@Callable(m)
28-func initStore () = [StringEntry(b, "0")]
23+@Callable(j)
24+func parseStruct () = if ((j.caller != this))
25+ then throw("Only owner")
26+ else {
27+ let k = h(j.transactionId)
28+[k]
29+ }
2930
3031
3132
32-@Callable(m)
33-func parseStruct () = {
34- let n = reentrantInvoke(this, "initStore", nil, nil)
35- if ((n == n))
36- then if ((m.caller != this))
37- then throw("Only owner")
38- else {
39- let o = j(m.transactionId, m.caller)
40-[o]
41- }
42- else throw("Strict value is not equal to itself.")
43- }
44-
45-
46-
47-@Callable(m)
33+@Callable(j)
4834 func startGame () = {
49- let p = value(m.payments[0].amount)
50- if ((m.payments[0].assetId != unit))
35+ let l = value(j.payments[0].amount)
36+ if ((j.payments[0].assetId != unit))
5137 then throw("Pay in waves")
52- else if ((p > 20))
38+ else if ((l > 20))
5339 then throw("You cannot bet more than 20")
5440 else {
55- let q = valueOrErrorMessage(getBoolean(this, b), "Storage read error")
56- if (q)
57- then [ScriptTransfer(m.caller, (p * 2), unit)]
58- else nil
41+ let m = invoke(this, "parseStruct", nil, nil)
42+ if ((m == m))
43+ then {
44+ let n = valueOrErrorMessage(getBoolean(this, b), "Storage read error")
45+ if (n)
46+ then [ScriptTransfer(j.caller, (l * 2), unit)]
47+ else nil
48+ }
49+ else throw("Strict value is not equal to itself.")
5950 }
6051 }
6152
6253

github/deemru/w8io/169f3d6 
27.88 ms