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:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "Won" |
---|
7 | 7 | | |
---|
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) |
---|
16 | 12 | | } |
---|
17 | 13 | | |
---|
18 | 14 | | |
---|
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) |
---|
24 | 20 | | } |
---|
25 | 21 | | |
---|
26 | 22 | | |
---|
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 | + | } |
---|
29 | 30 | | |
---|
30 | 31 | | |
---|
31 | 32 | | |
---|
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) |
---|
48 | 34 | | 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)) |
---|
51 | 37 | | then throw("Pay in waves") |
---|
52 | | - | else if ((p > 20)) |
---|
| 38 | + | else if ((l > 20)) |
---|
53 | 39 | | then throw("You cannot bet more than 20") |
---|
54 | 40 | | 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.") |
---|
59 | 50 | | } |
---|
60 | 51 | | } |
---|
61 | 52 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "Payment" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "Won" |
---|
7 | 7 | | |
---|
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) |
---|
16 | 12 | | } |
---|
17 | 13 | | |
---|
18 | 14 | | |
---|
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) |
---|
24 | 20 | | } |
---|
25 | 21 | | |
---|
26 | 22 | | |
---|
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 | + | } |
---|
29 | 30 | | |
---|
30 | 31 | | |
---|
31 | 32 | | |
---|
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) |
---|
48 | 34 | | 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)) |
---|
51 | 37 | | then throw("Pay in waves") |
---|
52 | | - | else if ((p > 20)) |
---|
| 38 | + | else if ((l > 20)) |
---|
53 | 39 | | then throw("You cannot bet more than 20") |
---|
54 | 40 | | 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.") |
---|
59 | 50 | | } |
---|
60 | 51 | | } |
---|
61 | 52 | | |
---|
62 | 53 | | |
---|