tx · DGn5BtdPMuxHhrXBcKtQQ8BVQUDBabbhwB6oJnbuioQJ 3NBiXxLpuHVS2dGSaLvyPfCQYMPRKCtGCVg: -0.01400000 Waves 2019.07.09 22:46 [578542] smart account 3NBiXxLpuHVS2dGSaLvyPfCQYMPRKCtGCVg > SELF 0.00000000 Waves
{ "type": 13, "id": "DGn5BtdPMuxHhrXBcKtQQ8BVQUDBabbhwB6oJnbuioQJ", "fee": 1400000, "feeAssetId": null, "timestamp": 1562701649586, "version": 1, "sender": "3NBiXxLpuHVS2dGSaLvyPfCQYMPRKCtGCVg", "senderPublicKey": "H2yzJU1BtKf9NAhJSK6nCVgmFdaRaFBs5y3zgajHTLGs", "proofs": [ "3j5CWs4Nmdy2x2mGqHSavSZ2h8wznHGCLYdUiDAAudVEv8wZRfZzpxXbjQwDpv9GP85JrdnCd4i61ncvQAZBRxhV" ], "script": "base64:AAIDAAAAAAAAAAAAAAAKAAAAAA5hZG1pblB1YmxpY0tleQEAAAAgoPq5TrIPqNMyX9LJ5ea1kHoixxLdZLkjdZ9lUlSz41QAAAAABXdjdElkAQAAACBAkwcahwxqDOVmEdNdlcYsRPoEBwsu3SMjVjLFv3jP4gAAAAAId3ZzUHJpY2UAAAAAAAX14QAAAAAACHdjdFByaWNlAAAAAAAAAABkAAAAAAhsYXN0Q2VsbAAAAAAAAAAAYwAAAAAIcm91bmRLZXkCAAAABXJvdW5kAAAAAAhjZWxsc0tleQIAAAAFY2VsbHMAAAAACmxhc3RXaW5LZXkCAAAAB2xhc3RXaW4AAAAADWxhc3RXaW5XY3RLZXkCAAAAC2xhc3RXaW5fd2N0AAAAAA1sYXN0V2luV3ZzS2V5AgAAAAtsYXN0V2luX3d2cwAAAAEAAAABaQEAAAADYnV5AAAAAQAAAARjZWxsBAAAAAVyb3VuZAkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABHRoaXMFAAAACHJvdW5kS2V5BAAAAAVjZWxscwkBAAAAB2V4dHJhY3QAAAABCQAEGg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BZGRyZXNzBQAAAA13Y3RBZG1pblNoYXJlBQAAAAV3Y3RJZAUAAAADbmlsCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABpAAAAAEFAAAABGNlbGwJAAEsAAAAAgkAASwAAAACCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgIAAAABXwkAAaQAAAABBQAAAAVyb3VuZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIY2VsbHNLZXkJAABkAAAAAgUAAAAFY2VsbHMAAAAAAAAAAAEFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleTFEEw0=", "chainId": 84, "height": 578542, "spentComplexity": 0 } View: original | compacted Prev: 67ujRgftPDhNHFEp1W6b7v4gzCp3AwTZDe46zEHAGyt2 Next: 2wEC6v8EayocEeQyKWa4LKHVHjxfdvv7zquh7BSR1cwi Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | ||
12 | 12 | let e = 99 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = "round" | |
15 | 15 | ||
16 | - | let g = " | |
16 | + | let g = "cells" | |
17 | 17 | ||
18 | - | let h = " | |
18 | + | let h = "lastWin" | |
19 | 19 | ||
20 | - | let i = "lastWin" | |
20 | + | let i = "lastWin_wct" | |
21 | 21 | ||
22 | - | @Callable(j) | |
23 | - | func test () = { | |
24 | - | let k = (toInt(lastBlock.generationSignature) % 10) | |
25 | - | throw(((((toBase58String(lastBlock.generationSignature) + ", ") + toBase64String(lastBlock.generationSignature)) + ", ") + toString(k))) | |
26 | - | } | |
22 | + | let j = "lastWin_wvs" | |
27 | 23 | ||
28 | - | ||
29 | - | ||
30 | - | @Callable(j) | |
24 | + | @Callable(k) | |
31 | 25 | func buy (l) = { | |
32 | - | let m = extract(getInteger(this, | |
33 | - | let n = extract(getInteger(this, | |
26 | + | let m = extract(getInteger(this, f)) | |
27 | + | let n = extract(getInteger(this, g)) | |
34 | 28 | if (if ((0 > l)) | |
35 | 29 | then true | |
36 | 30 | else (l > e)) | |
37 | - | then throw(" | |
31 | + | then throw("Invalid number") | |
38 | 32 | else { | |
39 | - | let o = valueOrErrorMessage( | |
33 | + | let o = valueOrErrorMessage(k.payment, "Where is payment?") | |
40 | 34 | let p = !(isDefined(o.assetId)) | |
41 | 35 | let q = (o.assetId == b) | |
42 | 36 | if (if (if (if (!(q)) | |
50 | 44 | else if (p) | |
51 | 45 | then (o.amount != c) | |
52 | 46 | else false) | |
53 | - | then throw(" | |
47 | + | then throw("Price is 1 WCT or 1 WAVES") | |
54 | 48 | else { | |
55 | 49 | let r = getString(this, toString(l)) | |
56 | 50 | let s = if (isDefined(r)) | |
62 | 56 | } | |
63 | 57 | else false | |
64 | 58 | if (s) | |
65 | - | then throw(" | |
59 | + | then throw("Already bought") | |
66 | 60 | else { | |
67 | 61 | let u = (n == e) | |
68 | 62 | if (u) | |
80 | 74 | let B = (x / 10) | |
81 | 75 | let C = (x - B) | |
82 | 76 | let D = addressFromPublicKey(a) | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | then | |
87 | - | else extract(addressFromString(split( | |
88 | - | ScriptResult(WriteSet([DataEntry(toString(l), ((toString( | |
77 | + | let E = (toInt(lastBlock.generationSignature) % (e + 1)) | |
78 | + | let F = extract(getString(this, toString(E))) | |
79 | + | let G = if ((E == l)) | |
80 | + | then k.caller | |
81 | + | else extract(addressFromString(split(F, "_")[0])) | |
82 | + | ScriptResult(WriteSet([DataEntry(toString(l), ((toString(k.caller) + "_") + toString(m))), DataEntry(g, 0), DataEntry(f, (m + 1)), DataEntry(h, ((toString(E) + "_") + toString(G))), DataEntry(j, y), DataEntry(i, x)]), TransferSet([ScriptTransfer(G, A, unit), ScriptTransfer(D, z, unit), ScriptTransfer(G, C, b), ScriptTransfer(D, B, b)])) | |
89 | 83 | } | |
90 | - | else WriteSet([DataEntry(toString(l), ((toString( | |
84 | + | else WriteSet([DataEntry(toString(l), ((toString(k.caller) + "_") + toString(m))), DataEntry(g, (n + 1))]) | |
91 | 85 | } | |
92 | 86 | } | |
93 | 87 | } | |
94 | 88 | } | |
95 | 89 | ||
96 | 90 | ||
97 | - | @Verifier( | |
98 | - | func | |
99 | - | let | |
100 | - | sigVerify( | |
91 | + | @Verifier(H) | |
92 | + | func I () = { | |
93 | + | let J = H | |
94 | + | sigVerify(H.bodyBytes, H.proofs[0], H.senderPublicKey) | |
101 | 95 | } | |
102 | 96 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'BqPySUvbKdRTRZ33nGTtrQRdus5qwhnQkqZ7G9iNcDto' | |
5 | 5 | ||
6 | 6 | let b = base58'5M58Edq3qciFLWMFS9kLLKfFQoENxokdi2hdE3ju4hrq' | |
7 | 7 | ||
8 | 8 | let c = 100000000 | |
9 | 9 | ||
10 | 10 | let d = 100 | |
11 | 11 | ||
12 | 12 | let e = 99 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = "round" | |
15 | 15 | ||
16 | - | let g = " | |
16 | + | let g = "cells" | |
17 | 17 | ||
18 | - | let h = " | |
18 | + | let h = "lastWin" | |
19 | 19 | ||
20 | - | let i = "lastWin" | |
20 | + | let i = "lastWin_wct" | |
21 | 21 | ||
22 | - | @Callable(j) | |
23 | - | func test () = { | |
24 | - | let k = (toInt(lastBlock.generationSignature) % 10) | |
25 | - | throw(((((toBase58String(lastBlock.generationSignature) + ", ") + toBase64String(lastBlock.generationSignature)) + ", ") + toString(k))) | |
26 | - | } | |
22 | + | let j = "lastWin_wvs" | |
27 | 23 | ||
28 | - | ||
29 | - | ||
30 | - | @Callable(j) | |
24 | + | @Callable(k) | |
31 | 25 | func buy (l) = { | |
32 | - | let m = extract(getInteger(this, | |
33 | - | let n = extract(getInteger(this, | |
26 | + | let m = extract(getInteger(this, f)) | |
27 | + | let n = extract(getInteger(this, g)) | |
34 | 28 | if (if ((0 > l)) | |
35 | 29 | then true | |
36 | 30 | else (l > e)) | |
37 | - | then throw(" | |
31 | + | then throw("Invalid number") | |
38 | 32 | else { | |
39 | - | let o = valueOrErrorMessage( | |
33 | + | let o = valueOrErrorMessage(k.payment, "Where is payment?") | |
40 | 34 | let p = !(isDefined(o.assetId)) | |
41 | 35 | let q = (o.assetId == b) | |
42 | 36 | if (if (if (if (!(q)) | |
43 | 37 | then !(p) | |
44 | 38 | else false) | |
45 | 39 | then true | |
46 | 40 | else if (q) | |
47 | 41 | then (o.amount != d) | |
48 | 42 | else false) | |
49 | 43 | then true | |
50 | 44 | else if (p) | |
51 | 45 | then (o.amount != c) | |
52 | 46 | else false) | |
53 | - | then throw(" | |
47 | + | then throw("Price is 1 WCT or 1 WAVES") | |
54 | 48 | else { | |
55 | 49 | let r = getString(this, toString(l)) | |
56 | 50 | let s = if (isDefined(r)) | |
57 | 51 | then { | |
58 | 52 | let t = split(extract(r), "_")[1] | |
59 | 53 | if ((t == toString(m))) | |
60 | 54 | then true | |
61 | 55 | else false | |
62 | 56 | } | |
63 | 57 | else false | |
64 | 58 | if (s) | |
65 | - | then throw(" | |
59 | + | then throw("Already bought") | |
66 | 60 | else { | |
67 | 61 | let u = (n == e) | |
68 | 62 | if (u) | |
69 | 63 | then { | |
70 | 64 | let v = if (q) | |
71 | 65 | then 1 | |
72 | 66 | else 0 | |
73 | 67 | let w = if (p) | |
74 | 68 | then 1 | |
75 | 69 | else 0 | |
76 | 70 | let x = (assetBalance(this, b) + (o.amount * v)) | |
77 | 71 | let y = (wavesBalance(this) + (o.amount * w)) | |
78 | 72 | let z = (y / 10) | |
79 | 73 | let A = (y - z) | |
80 | 74 | let B = (x / 10) | |
81 | 75 | let C = (x - B) | |
82 | 76 | let D = addressFromPublicKey(a) | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | then | |
87 | - | else extract(addressFromString(split( | |
88 | - | ScriptResult(WriteSet([DataEntry(toString(l), ((toString( | |
77 | + | let E = (toInt(lastBlock.generationSignature) % (e + 1)) | |
78 | + | let F = extract(getString(this, toString(E))) | |
79 | + | let G = if ((E == l)) | |
80 | + | then k.caller | |
81 | + | else extract(addressFromString(split(F, "_")[0])) | |
82 | + | ScriptResult(WriteSet([DataEntry(toString(l), ((toString(k.caller) + "_") + toString(m))), DataEntry(g, 0), DataEntry(f, (m + 1)), DataEntry(h, ((toString(E) + "_") + toString(G))), DataEntry(j, y), DataEntry(i, x)]), TransferSet([ScriptTransfer(G, A, unit), ScriptTransfer(D, z, unit), ScriptTransfer(G, C, b), ScriptTransfer(D, B, b)])) | |
89 | 83 | } | |
90 | - | else WriteSet([DataEntry(toString(l), ((toString( | |
84 | + | else WriteSet([DataEntry(toString(l), ((toString(k.caller) + "_") + toString(m))), DataEntry(g, (n + 1))]) | |
91 | 85 | } | |
92 | 86 | } | |
93 | 87 | } | |
94 | 88 | } | |
95 | 89 | ||
96 | 90 | ||
97 | - | @Verifier( | |
98 | - | func | |
99 | - | let | |
100 | - | sigVerify( | |
91 | + | @Verifier(H) | |
92 | + | func I () = { | |
93 | + | let J = H | |
94 | + | sigVerify(H.bodyBytes, H.proofs[0], H.senderPublicKey) | |
101 | 95 | } | |
102 | 96 |
github/deemru/w8io/169f3d6 58.14 ms ◑