tx · F4kaSrEMsqAehw56mSzyLpgPFbdLnki5pGRWoaWjxib6 3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc: -0.05000000 Waves 2019.12.17 16:53 [812996] smart account 3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc > SELF 0.00000000 Waves
{ "type": 13, "id": "F4kaSrEMsqAehw56mSzyLpgPFbdLnki5pGRWoaWjxib6", "fee": 5000000, "feeAssetId": null, "timestamp": 1576590870800, "version": 1, "sender": "3MrdV3AP4zfU77ifesNStoDZmL1Cfx13eDc", "senderPublicKey": "5M79Anear5ntQk2bbDdFA2goiPXkv7Xy2UpV4n5RKRv", "proofs": [ "3jRjYYna9RkzyztTpWn5GVbhezAq3GjwwyLNh6JA3uixdUJ35gkWmJgMkSLftxSuuBPcJGrsyKnFPb4JDURMEg13" ], "script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAgEIAAAACAAAAAASV0JFVFJFU0VSVkFUSU9OS0VZAgAAABUkV0JFVF9SRVNFUlZFRF9BTU9VTlQAAAAAE1JPWUFMUkVTRVJWQVRJT05LRVkCAAAAFiRST1lBTF9SRVNFUlZFRF9BTU9VTlQAAAAABFdCRVQBAAAAIIa0Nqh40w7M2PAXrUsuLAQfB5+6yrkWqUrXbyWtm9B2AAAAAAVST1lBTAEAAAAgQ+mKgsIl2XSclXwgUknGo5qQsraVX2JiXso4iYkMaRwBAAAAFkV4dHJhY3RXQkVUUmVzZXJ2ZWRBbXQAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAEldCRVRSRVNFUlZBVElPTktFWQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAABdFeHRyYWN0Uk9ZQUxSZXNlcnZlZEFtdAAAAAAEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAATUk9ZQUxSRVNFUlZBVElPTktFWQMJAAABAAAAAgU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BsYXllckJhbGFuY2UAAAACBQAAABNuZXdQbGF5ZXJXQkVUQW1vdW50BQAAAAtyb3lhbEFtb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABBQAAAANuaWwDCQAAAAAAAAIFAAAABWFzc2V0AgAAAAVST1lBTAMJAABmAAAAAgUAAAAGYW1vdW50BQAAAAtyb3lhbEFtb3VudAkAAAIAAAABAgAAAD5Zb3UgZG9udCBoYXZlIGVub3VnaCBiYWxhbmNlIHRvIHdpdGhkcmF3IHRoZSBhbW91bnQgcmVxdWVzdGVkLgQAAAAVbmV3V0JFVFJlc2VydmVkQW1vdW50CQAAZQAAAAIJAQAAABZFeHRyYWN0V0JFVFJlc2VydmVkQW10AAAAAAUAAAAGYW1vdW50BAAAABNuZXdQbGF5ZXJXQkVUQW1vdW50CQAAZQAAAAIFAAAACndiZXRBbW91bnQFAAAABmFtb3VudAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEldCRVRSRVNFUlZBVElPTktFWQUAAAAVbmV3V0JFVFJlc2VydmVkQW1vdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAZ3YWxsZXQJAQAAABNGb3JtYXRQbGF5ZXJCYWxhbmNlAAAAAgUAAAATbmV3UGxheWVyV0JFVEFtb3VudAUAAAALcm95YWxBbW91bnQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQUAAAADbmlsCQAAAgAAAAECAAAADWludmFsaXQgYXNzZXQAAAAApVSk3A==", "chainId": 84, "height": 812996, "spentComplexity": 0 } View: original | compacted Prev: 7pXoo3jJYSPViuvNza3dnFPmnkDAbYEnGa23tPWxaS1e Next: HbUVALNH7EwidabbKb8jRpQYdfgR6rP4qmgeBYpauaXP Diff:
Old | New | Differences | |
---|---|---|---|
78 | 78 | @Callable(o) | |
79 | 79 | func unlock (x,y) = { | |
80 | 80 | let j = toString(o.caller) | |
81 | - | let p = extract(o.payment) | |
82 | 81 | let q = split(i(j), "_") | |
83 | 82 | let r = parseIntValue(q[0]) | |
84 | 83 | let s = parseIntValue(q[1]) | |
86 | 85 | then if ((x > r)) | |
87 | 86 | then throw("You dont have enough balance to withdraw the amount requested.") | |
88 | 87 | else { | |
89 | - | let t = (e() - | |
90 | - | let u = (r - | |
88 | + | let t = (e() - x) | |
89 | + | let u = (r - x) | |
91 | 90 | ScriptResult(WriteSet([DataEntry(a, t), DataEntry(j, l(u, s))]), TransferSet(nil)) | |
92 | 91 | } | |
93 | 92 | else if ((y == "ROYAL")) | |
94 | 93 | then if ((x > s)) | |
95 | 94 | then throw("You dont have enough balance to withdraw the amount requested.") | |
96 | 95 | else { | |
97 | - | let t = (e() - | |
98 | - | let u = (r - | |
96 | + | let t = (e() - x) | |
97 | + | let u = (r - x) | |
99 | 98 | ScriptResult(WriteSet([DataEntry(a, t), DataEntry(j, l(u, s))]), TransferSet(nil)) | |
100 | 99 | } | |
101 | 100 | else throw("invalit asset") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "$WBET_RESERVED_AMOUNT" | |
5 | 5 | ||
6 | 6 | let b = "$ROYAL_RESERVED_AMOUNT" | |
7 | 7 | ||
8 | 8 | let c = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw' | |
9 | 9 | ||
10 | 10 | let d = base58'5a6rvDEiVwvhTvTH6ce2qFwqdCt3VKaHKXEpwLXXVvyy' | |
11 | 11 | ||
12 | 12 | func e () = { | |
13 | 13 | let f = getInteger(this, a) | |
14 | 14 | if ($isInstanceOf(f, "Int")) | |
15 | 15 | then { | |
16 | 16 | let g = f | |
17 | 17 | g | |
18 | 18 | } | |
19 | 19 | else 0 | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func h () = { | |
24 | 24 | let f = getInteger(this, b) | |
25 | 25 | if ($isInstanceOf(f, "Int")) | |
26 | 26 | then { | |
27 | 27 | let g = f | |
28 | 28 | g | |
29 | 29 | } | |
30 | 30 | else 0 | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func i (j) = { | |
35 | 35 | let f = getString(this, j) | |
36 | 36 | if ($isInstanceOf(f, "String")) | |
37 | 37 | then { | |
38 | 38 | let k = f | |
39 | 39 | k | |
40 | 40 | } | |
41 | 41 | else "0_0" | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func l (m,n) = ((toString(m) + "_") + toString(n)) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | @Callable(o) | |
49 | 49 | func lock () = { | |
50 | 50 | let p = extract(o.payment) | |
51 | 51 | if (if ((p.assetId != c)) | |
52 | 52 | then (p.assetId != d) | |
53 | 53 | else false) | |
54 | 54 | then throw("Token should be WBET or ROYAL.") | |
55 | 55 | else { | |
56 | 56 | let j = toString(o.caller) | |
57 | 57 | let q = split(i(j), "_") | |
58 | 58 | let r = parseIntValue(q[0]) | |
59 | 59 | let s = parseIntValue(q[1]) | |
60 | 60 | if ((p.assetId == c)) | |
61 | 61 | then { | |
62 | 62 | let t = (e() + p.amount) | |
63 | 63 | let u = (r + p.amount) | |
64 | 64 | ScriptResult(WriteSet([DataEntry(a, t), DataEntry(j, l(u, s))]), TransferSet(nil)) | |
65 | 65 | } | |
66 | 66 | else if ((p.assetId == d)) | |
67 | 67 | then { | |
68 | 68 | let v = (h() + p.amount) | |
69 | 69 | let w = (s + p.amount) | |
70 | 70 | ScriptResult(WriteSet([DataEntry(b, v), DataEntry(j, l(r, w))]), TransferSet(nil)) | |
71 | 71 | } | |
72 | 72 | else throw("error") | |
73 | 73 | } | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | ||
78 | 78 | @Callable(o) | |
79 | 79 | func unlock (x,y) = { | |
80 | 80 | let j = toString(o.caller) | |
81 | - | let p = extract(o.payment) | |
82 | 81 | let q = split(i(j), "_") | |
83 | 82 | let r = parseIntValue(q[0]) | |
84 | 83 | let s = parseIntValue(q[1]) | |
85 | 84 | if ((y == "WBET")) | |
86 | 85 | then if ((x > r)) | |
87 | 86 | then throw("You dont have enough balance to withdraw the amount requested.") | |
88 | 87 | else { | |
89 | - | let t = (e() - | |
90 | - | let u = (r - | |
88 | + | let t = (e() - x) | |
89 | + | let u = (r - x) | |
91 | 90 | ScriptResult(WriteSet([DataEntry(a, t), DataEntry(j, l(u, s))]), TransferSet(nil)) | |
92 | 91 | } | |
93 | 92 | else if ((y == "ROYAL")) | |
94 | 93 | then if ((x > s)) | |
95 | 94 | then throw("You dont have enough balance to withdraw the amount requested.") | |
96 | 95 | else { | |
97 | - | let t = (e() - | |
98 | - | let u = (r - | |
96 | + | let t = (e() - x) | |
97 | + | let u = (r - x) | |
99 | 98 | ScriptResult(WriteSet([DataEntry(a, t), DataEntry(j, l(u, s))]), TransferSet(nil)) | |
100 | 99 | } | |
101 | 100 | else throw("invalit asset") | |
102 | 101 | } | |
103 | 102 | ||
104 | 103 |
github/deemru/w8io/026f985 34.62 ms ◑