tx · 3Ma4w2PLKYBRP2Ne1aoAMVJvb2SGhfRUcnTGTavVpYRM 3MzGHDJgHnpSnBYScnzg93pWoS27M7cBuVT: -0.01400000 Waves 2020.12.07 14:44 [1298188] smart account 3MzGHDJgHnpSnBYScnzg93pWoS27M7cBuVT > SELF 0.00000000 Waves
{ "type": 13, "id": "3Ma4w2PLKYBRP2Ne1aoAMVJvb2SGhfRUcnTGTavVpYRM", "fee": 1400000, "feeAssetId": null, "timestamp": 1607341449273, "version": 2, "chainId": 84, "sender": "3MzGHDJgHnpSnBYScnzg93pWoS27M7cBuVT", "senderPublicKey": "EEG3yJvW1pyCtw138vRpByPpVgrN9VUW9X7G3b9qnwAU", "proofs": [ "2JjvdWD7cUKwYFu8gw6MBaMiSqCcJg83pmjU6bAyC5uRseiWHH8aTk8T18btirQUCVQ2Dtqk8z89bXbhR4FWjj4H" ], "script": "base64:AAIDAAAAAAAAABUIARIAEgASBAoCCAESABIDCgEBEgAAAAAAAAAABgAAAAFpAQAAAAxSZWFkUG9vbERhdGEAAAAABAAAAA5Hb3Zlcm5Ub2tlbktleQIAAAAVR292ZXJuVG9rZW5NYXhEZXBvc2l0BAAAABpNYXhHb3Zlcm5Ub2tlbkRlcG9zaXRlcktleQIAAAAaTWF4R292ZXJuVG9rZW5EZXBvc2l0ZXJLZXkEAAAAC1N0YWtlZFRva2VuAQAAACCOrPKFX9iyxI4BbdwwZEALQLKrVFO/ELkmmh2Y+mC8aAQAAAALR292ZXJuVG9rZW4BAAAAIMtrm7pE5/6PvpYJJCZ4VYOnbodph6rsi95jG/KBisX4BAAAABJVc2VyU3Rha2VkVG9rZW5LZXkJAAEsAAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAAAV8JAAJYAAAAAQUAAAALU3Rha2VkVG9rZW4EAAAAElVzZXJHb3Zlcm5Ub2tlbktleQkAASwAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbG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JAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAZAUAAAALR292ZXJuVG9rZW4FAAAAA25pbAkAAAIAAAABCQABLAAAAAICAAAAR1lvdSBoYXZlIHRvIGRlcG9zaXQgMTAwIEdvdmVyblRva2VuIHRvIGNsYWltIFJld2FyZCAKIFlvdXIgQmFsYW5jZSBpczogCQABpAAAAAEFAAAAFVVzZXJHb3Zlcm5Ub2tlbkFtb3VudAAAAABjbKw5", "height": 1298188, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DbGBbr6t9q3B4f1ca8TzNjRLr9KXgV3jgLiZeqL2Kg4n Next: 2jFfoT5r3dSiuGXYt4fKSsE7kV5KMC4CqdBtZABJqT9G Diff:
Old | New | Differences | |
---|---|---|---|
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(a) | |
64 | - | func Stake () = { | |
64 | + | func Stake (q,r) = { | |
65 | 65 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
66 | 66 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
67 | - | let q = extract(a.payment) | |
68 | - | if (if (isDefined(q.assetId)) | |
69 | - | then (extract(q.assetId) == d) | |
67 | + | if (if ((r > 0)) | |
68 | + | then (q == toBase58String(d)) | |
70 | 69 | else false) | |
71 | - | then { | |
72 | - | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
73 | - | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
74 | - | let p = (toBase58String(a.caller.bytes) + "_StakedTransactions") | |
75 | - | let r = toBase58String(a.caller.bytes) | |
76 | - | let s = { | |
77 | - | let j = getInteger(this, p) | |
78 | - | if ($isInstanceOf(j, "Int")) | |
79 | - | then { | |
80 | - | let k = j | |
81 | - | k | |
82 | - | } | |
83 | - | else 0 | |
84 | - | } | |
85 | - | let t = (s + 1) | |
86 | - | let u = { | |
87 | - | let j = getInteger(this, f) | |
88 | - | if ($isInstanceOf(j, "Int")) | |
89 | - | then { | |
90 | - | let k = j | |
91 | - | k | |
92 | - | } | |
93 | - | else 0 | |
94 | - | } | |
95 | - | let v = (u + q.amount) | |
96 | - | let w = { | |
97 | - | let j = getInteger(this, f) | |
98 | - | if ($isInstanceOf(j, "Int")) | |
99 | - | then { | |
100 | - | let k = j | |
101 | - | k | |
102 | - | } | |
103 | - | else 0 | |
104 | - | } | |
105 | - | let x = (w + 10) | |
106 | - | let y = assetBalance(this, e) | |
107 | - | let z = assetBalance(this, d) | |
108 | - | if ((1 > y)) | |
109 | - | then throw("No enough GovernToken In Contract, Please deposit GovernTokens") | |
110 | - | else if ((z == 0)) | |
111 | - | then ScriptResult(WriteSet([DataEntry(r, x), DataEntry(r, v), DataEntry(p, t)]), TransferSet([ScriptTransfer(a.caller, 10, e)])) | |
112 | - | else if ((t > 50)) | |
113 | - | then { | |
114 | - | let A = (w + ((10 * t) * (v / z))) | |
115 | - | ScriptResult(WriteSet([DataEntry(r, A), DataEntry(r, v), DataEntry(p, t)]), TransferSet([ScriptTransfer(a.caller, A, e)])) | |
116 | - | } | |
117 | - | else { | |
118 | - | let A = (w + (10 * (v / z))) | |
119 | - | ScriptResult(WriteSet([DataEntry(r, A), DataEntry(r, v), DataEntry(p, t)]), TransferSet([ScriptTransfer(a.caller, A, e)])) | |
120 | - | } | |
121 | - | } | |
70 | + | then throw("cHECKED ok") | |
122 | 71 | else throw("Can deposit only StakeToken") | |
123 | 72 | } | |
124 | 73 | ||
127 | 76 | @Callable(a) | |
128 | 77 | func DepositGovernToken () = { | |
129 | 78 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
130 | - | let | |
131 | - | let | |
132 | - | if (if (isDefined( | |
133 | - | then (extract( | |
79 | + | let s = toBase58String(e) | |
80 | + | let t = extract(a.payment) | |
81 | + | if (if (isDefined(t.assetId)) | |
82 | + | then (extract(t.assetId) == e) | |
134 | 83 | else false) | |
135 | 84 | then { | |
136 | - | let | |
137 | - | let | |
138 | - | let j = getInteger(this, | |
85 | + | let u = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
86 | + | let v = { | |
87 | + | let j = getInteger(this, u) | |
139 | 88 | if ($isInstanceOf(j, "Int")) | |
140 | 89 | then { | |
141 | 90 | let k = j | |
143 | 92 | } | |
144 | 93 | else 0 | |
145 | 94 | } | |
146 | - | let | |
95 | + | let w = (v + t.amount) | |
147 | 96 | let b = "GovernTokenMaxDeposit" | |
148 | 97 | let c = "MaxGovernTokenDepositerKey" | |
149 | 98 | let i = { | |
155 | 104 | } | |
156 | 105 | else 0 | |
157 | 106 | } | |
158 | - | if (( | |
159 | - | then WriteSet([DataEntry( | |
160 | - | else WriteSet([DataEntry( | |
107 | + | if ((w > i)) | |
108 | + | then WriteSet([DataEntry(u, w), DataEntry(b, w), DataEntry(c, u)]) | |
109 | + | else WriteSet([DataEntry(u, w)]) | |
161 | 110 | } | |
162 | 111 | else throw("Can deposit only Govern Token") | |
163 | 112 | } | |
165 | 114 | ||
166 | 115 | ||
167 | 116 | @Callable(a) | |
168 | - | func WithdrawStakedFunds ( | |
117 | + | func WithdrawStakedFunds (r) = { | |
169 | 118 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
170 | 119 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
171 | 120 | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
172 | 121 | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
173 | - | let | |
174 | - | let | |
122 | + | let u = toBase58String(a.caller.bytes) | |
123 | + | let v = { | |
175 | 124 | let j = getInteger(this, f) | |
176 | 125 | if ($isInstanceOf(j, "Int")) | |
177 | 126 | then { | |
180 | 129 | } | |
181 | 130 | else 0 | |
182 | 131 | } | |
183 | - | let | |
184 | - | if ((0 > | |
132 | + | let x = (v - r) | |
133 | + | if ((0 > r)) | |
185 | 134 | then throw("Can't withdraw negative amount") | |
186 | - | else if ((0 > | |
187 | - | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString( | |
135 | + | else if ((0 > x)) | |
136 | + | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString(v))) | |
188 | 137 | else { | |
189 | - | let | |
190 | - | if ((1 > | |
138 | + | let y = assetBalance(this, e) | |
139 | + | if ((1 > y)) | |
191 | 140 | then throw("No enough GovernToken In Contract") | |
192 | - | else ScriptResult(WriteSet([DataEntry(g, 1), DataEntry(f, | |
141 | + | else ScriptResult(WriteSet([DataEntry(g, 1), DataEntry(f, x)]), TransferSet([ScriptTransfer(a.caller, 1, e), ScriptTransfer(a.caller, r, d)])) | |
193 | 142 | } | |
194 | 143 | } | |
195 | 144 | ||
199 | 148 | func ClaimPrize () = { | |
200 | 149 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
201 | 150 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
202 | - | let | |
151 | + | let z = base58'3MsH5Hr1qQYUnwq4HTpiaGpXQi6cGPUsa5n' | |
203 | 152 | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
204 | 153 | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
205 | - | let | |
206 | - | let | |
154 | + | let A = ((toBase58String(z) + "_") + toBase58String(d)) | |
155 | + | let B = { | |
207 | 156 | let j = getInteger(this, g) | |
208 | 157 | if ($isInstanceOf(j, "Int")) | |
209 | 158 | then { | |
212 | 161 | } | |
213 | 162 | else 0 | |
214 | 163 | } | |
215 | - | let | |
164 | + | let C = { | |
216 | 165 | let j = getInteger(this, f) | |
217 | 166 | if ($isInstanceOf(j, "Int")) | |
218 | 167 | then { | |
221 | 170 | } | |
222 | 171 | else 0 | |
223 | 172 | } | |
224 | - | let | |
225 | - | let j = getInteger(this, | |
173 | + | let D = { | |
174 | + | let j = getInteger(this, A) | |
226 | 175 | if ($isInstanceOf(j, "Int")) | |
227 | 176 | then { | |
228 | 177 | let k = j | |
232 | 181 | } | |
233 | 182 | let b = "GovernTokenMaxDeposit" | |
234 | 183 | let c = "MaxGovernTokenDepositerKey" | |
235 | - | let | |
236 | - | if (( | |
184 | + | let E = getStringValue(this, c) | |
185 | + | if ((D == 0)) | |
237 | 186 | then throw("No prize to Claim") | |
238 | - | else if ((g != | |
187 | + | else if ((g != E)) | |
239 | 188 | then throw("You are not the winner hence cannot claim the reward ") | |
240 | - | else if ((1 > | |
189 | + | else if ((1 > C)) | |
241 | 190 | then throw(("You have to Stake StakedToken to claim reward | |
242 | - | Your Balance of Staked Tokens is: " + toString( | |
243 | - | else if (( | |
244 | - | then ScriptResult(WriteSet([DataEntry( | |
191 | + | Your Balance of Staked Tokens is: " + toString(C))) | |
192 | + | else if ((B > 100)) | |
193 | + | then ScriptResult(WriteSet([DataEntry(E, D), DataEntry(A, 0), DataEntry(b, 0), DataEntry(g, 0), DataEntry(c, "")]), TransferSet([ScriptTransfer(a.caller, D, d), ScriptTransfer(a.caller, 100, e)])) | |
245 | 194 | else throw(("You have to deposit 100 GovernToken to claim Reward | |
246 | - | Your Balance is: " + toString( | |
195 | + | Your Balance is: " + toString(B))) | |
247 | 196 | } | |
248 | 197 | ||
249 | 198 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | 7 | func ReadPoolData () = { | |
8 | 8 | let b = "GovernTokenMaxDeposit" | |
9 | 9 | let c = "MaxGovernTokenDepositerKey" | |
10 | 10 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
11 | 11 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
12 | 12 | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
13 | 13 | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
14 | 14 | let h = getStringValue(this, c) | |
15 | 15 | let i = { | |
16 | 16 | let j = getInteger(this, b) | |
17 | 17 | if ($isInstanceOf(j, "Int")) | |
18 | 18 | then { | |
19 | 19 | let k = j | |
20 | 20 | k | |
21 | 21 | } | |
22 | 22 | else 0 | |
23 | 23 | } | |
24 | 24 | let l = getStringValue(this, g) | |
25 | 25 | let m = { | |
26 | 26 | let j = getInteger(this, g) | |
27 | 27 | if ($isInstanceOf(j, "Int")) | |
28 | 28 | then { | |
29 | 29 | let k = j | |
30 | 30 | k | |
31 | 31 | } | |
32 | 32 | else 0 | |
33 | 33 | } | |
34 | 34 | let n = getStringValue(this, f) | |
35 | 35 | let o = { | |
36 | 36 | let j = getInteger(this, f) | |
37 | 37 | if ($isInstanceOf(j, "Int")) | |
38 | 38 | then { | |
39 | 39 | let k = j | |
40 | 40 | k | |
41 | 41 | } | |
42 | 42 | else 0 | |
43 | 43 | } | |
44 | 44 | throw(((((((("Winner is.....: " + h) + " Balance is: ") + toString(i)) + " | |
45 | 45 | Staked Token in your Balance is.....: ") + toString(o)) + " | |
46 | 46 | Govern Token in your Balance is.....: ") + toString(m))) | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(a) | |
52 | 52 | func ResetAccount () = { | |
53 | 53 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
54 | 54 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
55 | 55 | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
56 | 56 | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
57 | 57 | let p = (toBase58String(a.caller.bytes) + "_StakedTransactions") | |
58 | 58 | WriteSet([DataEntry(g, 0), DataEntry(f, 0), DataEntry(p, 0)]) | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(a) | |
64 | - | func Stake () = { | |
64 | + | func Stake (q,r) = { | |
65 | 65 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
66 | 66 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
67 | - | let q = extract(a.payment) | |
68 | - | if (if (isDefined(q.assetId)) | |
69 | - | then (extract(q.assetId) == d) | |
67 | + | if (if ((r > 0)) | |
68 | + | then (q == toBase58String(d)) | |
70 | 69 | else false) | |
71 | - | then { | |
72 | - | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
73 | - | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
74 | - | let p = (toBase58String(a.caller.bytes) + "_StakedTransactions") | |
75 | - | let r = toBase58String(a.caller.bytes) | |
76 | - | let s = { | |
77 | - | let j = getInteger(this, p) | |
78 | - | if ($isInstanceOf(j, "Int")) | |
79 | - | then { | |
80 | - | let k = j | |
81 | - | k | |
82 | - | } | |
83 | - | else 0 | |
84 | - | } | |
85 | - | let t = (s + 1) | |
86 | - | let u = { | |
87 | - | let j = getInteger(this, f) | |
88 | - | if ($isInstanceOf(j, "Int")) | |
89 | - | then { | |
90 | - | let k = j | |
91 | - | k | |
92 | - | } | |
93 | - | else 0 | |
94 | - | } | |
95 | - | let v = (u + q.amount) | |
96 | - | let w = { | |
97 | - | let j = getInteger(this, f) | |
98 | - | if ($isInstanceOf(j, "Int")) | |
99 | - | then { | |
100 | - | let k = j | |
101 | - | k | |
102 | - | } | |
103 | - | else 0 | |
104 | - | } | |
105 | - | let x = (w + 10) | |
106 | - | let y = assetBalance(this, e) | |
107 | - | let z = assetBalance(this, d) | |
108 | - | if ((1 > y)) | |
109 | - | then throw("No enough GovernToken In Contract, Please deposit GovernTokens") | |
110 | - | else if ((z == 0)) | |
111 | - | then ScriptResult(WriteSet([DataEntry(r, x), DataEntry(r, v), DataEntry(p, t)]), TransferSet([ScriptTransfer(a.caller, 10, e)])) | |
112 | - | else if ((t > 50)) | |
113 | - | then { | |
114 | - | let A = (w + ((10 * t) * (v / z))) | |
115 | - | ScriptResult(WriteSet([DataEntry(r, A), DataEntry(r, v), DataEntry(p, t)]), TransferSet([ScriptTransfer(a.caller, A, e)])) | |
116 | - | } | |
117 | - | else { | |
118 | - | let A = (w + (10 * (v / z))) | |
119 | - | ScriptResult(WriteSet([DataEntry(r, A), DataEntry(r, v), DataEntry(p, t)]), TransferSet([ScriptTransfer(a.caller, A, e)])) | |
120 | - | } | |
121 | - | } | |
70 | + | then throw("cHECKED ok") | |
122 | 71 | else throw("Can deposit only StakeToken") | |
123 | 72 | } | |
124 | 73 | ||
125 | 74 | ||
126 | 75 | ||
127 | 76 | @Callable(a) | |
128 | 77 | func DepositGovernToken () = { | |
129 | 78 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
130 | - | let | |
131 | - | let | |
132 | - | if (if (isDefined( | |
133 | - | then (extract( | |
79 | + | let s = toBase58String(e) | |
80 | + | let t = extract(a.payment) | |
81 | + | if (if (isDefined(t.assetId)) | |
82 | + | then (extract(t.assetId) == e) | |
134 | 83 | else false) | |
135 | 84 | then { | |
136 | - | let | |
137 | - | let | |
138 | - | let j = getInteger(this, | |
85 | + | let u = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
86 | + | let v = { | |
87 | + | let j = getInteger(this, u) | |
139 | 88 | if ($isInstanceOf(j, "Int")) | |
140 | 89 | then { | |
141 | 90 | let k = j | |
142 | 91 | k | |
143 | 92 | } | |
144 | 93 | else 0 | |
145 | 94 | } | |
146 | - | let | |
95 | + | let w = (v + t.amount) | |
147 | 96 | let b = "GovernTokenMaxDeposit" | |
148 | 97 | let c = "MaxGovernTokenDepositerKey" | |
149 | 98 | let i = { | |
150 | 99 | let j = getInteger(this, b) | |
151 | 100 | if ($isInstanceOf(j, "Int")) | |
152 | 101 | then { | |
153 | 102 | let k = j | |
154 | 103 | k | |
155 | 104 | } | |
156 | 105 | else 0 | |
157 | 106 | } | |
158 | - | if (( | |
159 | - | then WriteSet([DataEntry( | |
160 | - | else WriteSet([DataEntry( | |
107 | + | if ((w > i)) | |
108 | + | then WriteSet([DataEntry(u, w), DataEntry(b, w), DataEntry(c, u)]) | |
109 | + | else WriteSet([DataEntry(u, w)]) | |
161 | 110 | } | |
162 | 111 | else throw("Can deposit only Govern Token") | |
163 | 112 | } | |
164 | 113 | ||
165 | 114 | ||
166 | 115 | ||
167 | 116 | @Callable(a) | |
168 | - | func WithdrawStakedFunds ( | |
117 | + | func WithdrawStakedFunds (r) = { | |
169 | 118 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
170 | 119 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
171 | 120 | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
172 | 121 | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
173 | - | let | |
174 | - | let | |
122 | + | let u = toBase58String(a.caller.bytes) | |
123 | + | let v = { | |
175 | 124 | let j = getInteger(this, f) | |
176 | 125 | if ($isInstanceOf(j, "Int")) | |
177 | 126 | then { | |
178 | 127 | let k = j | |
179 | 128 | k | |
180 | 129 | } | |
181 | 130 | else 0 | |
182 | 131 | } | |
183 | - | let | |
184 | - | if ((0 > | |
132 | + | let x = (v - r) | |
133 | + | if ((0 > r)) | |
185 | 134 | then throw("Can't withdraw negative amount") | |
186 | - | else if ((0 > | |
187 | - | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString( | |
135 | + | else if ((0 > x)) | |
136 | + | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString(v))) | |
188 | 137 | else { | |
189 | - | let | |
190 | - | if ((1 > | |
138 | + | let y = assetBalance(this, e) | |
139 | + | if ((1 > y)) | |
191 | 140 | then throw("No enough GovernToken In Contract") | |
192 | - | else ScriptResult(WriteSet([DataEntry(g, 1), DataEntry(f, | |
141 | + | else ScriptResult(WriteSet([DataEntry(g, 1), DataEntry(f, x)]), TransferSet([ScriptTransfer(a.caller, 1, e), ScriptTransfer(a.caller, r, d)])) | |
193 | 142 | } | |
194 | 143 | } | |
195 | 144 | ||
196 | 145 | ||
197 | 146 | ||
198 | 147 | @Callable(a) | |
199 | 148 | func ClaimPrize () = { | |
200 | 149 | let d = base58'AbwrDfhBTCFySqCzhwcC6CaXTNKC7tFq5nx1cVUxqT2w' | |
201 | 150 | let e = base58'Eh4w4BjT7Qn51eXFV9tLzymsepCo8oPLxBRBg5aog98j' | |
202 | - | let | |
151 | + | let z = base58'3MsH5Hr1qQYUnwq4HTpiaGpXQi6cGPUsa5n' | |
203 | 152 | let f = ((toBase58String(a.caller.bytes) + "_") + toBase58String(d)) | |
204 | 153 | let g = ((toBase58String(a.caller.bytes) + "_") + toBase58String(e)) | |
205 | - | let | |
206 | - | let | |
154 | + | let A = ((toBase58String(z) + "_") + toBase58String(d)) | |
155 | + | let B = { | |
207 | 156 | let j = getInteger(this, g) | |
208 | 157 | if ($isInstanceOf(j, "Int")) | |
209 | 158 | then { | |
210 | 159 | let k = j | |
211 | 160 | k | |
212 | 161 | } | |
213 | 162 | else 0 | |
214 | 163 | } | |
215 | - | let | |
164 | + | let C = { | |
216 | 165 | let j = getInteger(this, f) | |
217 | 166 | if ($isInstanceOf(j, "Int")) | |
218 | 167 | then { | |
219 | 168 | let k = j | |
220 | 169 | k | |
221 | 170 | } | |
222 | 171 | else 0 | |
223 | 172 | } | |
224 | - | let | |
225 | - | let j = getInteger(this, | |
173 | + | let D = { | |
174 | + | let j = getInteger(this, A) | |
226 | 175 | if ($isInstanceOf(j, "Int")) | |
227 | 176 | then { | |
228 | 177 | let k = j | |
229 | 178 | k | |
230 | 179 | } | |
231 | 180 | else 0 | |
232 | 181 | } | |
233 | 182 | let b = "GovernTokenMaxDeposit" | |
234 | 183 | let c = "MaxGovernTokenDepositerKey" | |
235 | - | let | |
236 | - | if (( | |
184 | + | let E = getStringValue(this, c) | |
185 | + | if ((D == 0)) | |
237 | 186 | then throw("No prize to Claim") | |
238 | - | else if ((g != | |
187 | + | else if ((g != E)) | |
239 | 188 | then throw("You are not the winner hence cannot claim the reward ") | |
240 | - | else if ((1 > | |
189 | + | else if ((1 > C)) | |
241 | 190 | then throw(("You have to Stake StakedToken to claim reward | |
242 | - | Your Balance of Staked Tokens is: " + toString( | |
243 | - | else if (( | |
244 | - | then ScriptResult(WriteSet([DataEntry( | |
191 | + | Your Balance of Staked Tokens is: " + toString(C))) | |
192 | + | else if ((B > 100)) | |
193 | + | then ScriptResult(WriteSet([DataEntry(E, D), DataEntry(A, 0), DataEntry(b, 0), DataEntry(g, 0), DataEntry(c, "")]), TransferSet([ScriptTransfer(a.caller, D, d), ScriptTransfer(a.caller, 100, e)])) | |
245 | 194 | else throw(("You have to deposit 100 GovernToken to claim Reward | |
246 | - | Your Balance is: " + toString( | |
195 | + | Your Balance is: " + toString(B))) | |
247 | 196 | } | |
248 | 197 | ||
249 | 198 |
github/deemru/w8io/169f3d6 58.18 ms ◑