tx · DwGmwi2g5Xk3LCzP7qdttFw13iqfCeybT1dcU1YUMJtY 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u: -0.01440000 Waves 2020.12.28 20:37 [1328838] smart account 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u > SELF 0.00000000 Waves
{ "type": 13, "id": "DwGmwi2g5Xk3LCzP7qdttFw13iqfCeybT1dcU1YUMJtY", "fee": 1440000, "feeAssetId": null, "timestamp": 1609177057414, "version": 2, "chainId": 84, "sender": "3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u", "senderPublicKey": "FFDorDp8bC9dyUK2w8hYPWPVEcbbk9zYkpHn3gcq9svn", "proofs": [ "AjRE38jUj8juVWfk47TcN7qGinjT44EfX3hNdQ94yjXM8xjpPNzpJZRmVBrquqkvLgQMVKe6WgGhHWdabfSS943" ], "script": "base64:AAIDAAAAAAAAABYIARIAEgASABIAEgMKAQESAwoBARIAAAAAAAAAAAcAAAABaQEAAAAMUmVhZFBvb2xEYXRhAAAAAAQAAAAOR292ZXJuVG9rZW5LZXkCAAAAFUdvdmVyblRva2VuTWF4RGVwb3NpdAQAAAAaTWF4R292ZXJuVG9rZW5EZXBvc2l0ZXJLZXkCAAAAGk1heEdvdmVyblRva2VuRGVwb3NpdGVyS2V5BAAAAAtTdGFrZWRUb2tlbgEAAAAg4kCrtAPNiHBMRPYvMCXeThBq6KlRf6cxe4yUvVS2aoUEAAAAC0dvdmVyblRva2VuAQAAACASiWf4V0Rs4Spwpaqhn2bfVjnt1mPO6pt7R8ZSZ6gxXgQAAAASVXNlclN0YWtlZFRva2VuS2V5CQABLAAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAFfCQACWAAAAAEFAAAAC1N0YWtlZFRva2VuBAAAABJVc2VyR292ZXJuVG9rZW5LZXkJAAEsAAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXI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ADkFuZCBIZWlnaHQgaXM6CQABpAAAAAEFAAAABmhlaWdodAAAAABKfM73", "height": 1328838, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9wDDtbcZ7fPoUZT1wdiuUomktNohjHCVarJoQbjYCsNR Next: 8E1q165G6qDHWwqekbn7ubVv1kHByzvEnschU773AJoD Diff:
Old | New | Differences | |
---|---|---|---|
232 | 232 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
233 | 233 | let FundBoxStakedToken = ((toBase58String(FundBoxAddress58) + "_") + toBase58String(StakedToken)) | |
234 | 234 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
235 | - | let FundBoxHeight = (toBase58String(FundBoxAddress58) + "_PrizeHeight") | |
236 | 235 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
237 | 236 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
238 | 237 | case a: Int => | |
256 | 255 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
257 | 256 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
258 | 257 | let PrizeWinner = getStringValue(this, MaxGovernTokenDepositerKey) | |
259 | - | let PrizeHeight = match getInteger(this, | |
258 | + | let PrizeHeight = match getInteger(this, "PrizeHeight") { | |
260 | 259 | case a: Int => | |
261 | 260 | a | |
262 | 261 | case _ => |
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(i) | |
7 | 7 | func ReadPoolData () = { | |
8 | 8 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
9 | 9 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
10 | 10 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
11 | 11 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
12 | 12 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
13 | 13 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
14 | 14 | let Winner = getStringValue(this, MaxGovernTokenDepositerKey) | |
15 | 15 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
16 | 16 | case a: Int => | |
17 | 17 | a | |
18 | 18 | case _ => | |
19 | 19 | 0 | |
20 | 20 | } | |
21 | 21 | let ReadUserGovernTokenKey = getStringValue(this, UserGovernTokenKey) | |
22 | 22 | let UserGovernTokenBalance = match getInteger(this, UserGovernTokenKey) { | |
23 | 23 | case a: Int => | |
24 | 24 | a | |
25 | 25 | case _ => | |
26 | 26 | 0 | |
27 | 27 | } | |
28 | 28 | let ReadUserStakedTokenKey = getStringValue(this, UserStakedTokenKey) | |
29 | 29 | let UserStakedTokenBalance = match getInteger(this, UserStakedTokenKey) { | |
30 | 30 | case a: Int => | |
31 | 31 | a | |
32 | 32 | case _ => | |
33 | 33 | 0 | |
34 | 34 | } | |
35 | 35 | throw(((((((("Winner is.....: " + Winner) + " Balance is: ") + toString(MaxGovernTokenDeposit)) + " | |
36 | 36 | Staked Token in your Balance is.....: ") + toString(UserStakedTokenBalance)) + " | |
37 | 37 | Govern Token in your Balance is.....: ") + toString(UserGovernTokenBalance))) | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | ||
42 | 42 | @Callable(i) | |
43 | 43 | func ResetAccount () = { | |
44 | 44 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
45 | 45 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
46 | 46 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
47 | 47 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
48 | 48 | let UserStakeTransactionsKey = (toBase58String(i.caller.bytes) + "_StakedTransactions") | |
49 | 49 | WriteSet([DataEntry(UserGovernTokenKey, 0), DataEntry(UserStakedTokenKey, 0), DataEntry(UserStakeTransactionsKey, 0)]) | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(i) | |
55 | 55 | func Stake () = { | |
56 | 56 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
57 | 57 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
58 | 58 | let GovernTokenSmartContractBalance = assetBalance(this, GovernToken) | |
59 | 59 | let StakedTokenSmartContractBalance = assetBalance(this, StakedToken) | |
60 | 60 | let pmt = extract(i.payment) | |
61 | 61 | if (if ((pmt.amount > 0)) | |
62 | 62 | then (pmt.assetId == StakedToken) | |
63 | 63 | else false) | |
64 | 64 | then { | |
65 | 65 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
66 | 66 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
67 | 67 | let UserStakeTransactionsKey = (toBase58String(i.caller.bytes) + "_StakedTransactions") | |
68 | 68 | let AddressHeight = (toBase58String(i.caller.bytes) + "_PrizeHeight") | |
69 | 69 | let UserStakeTransactions = match getInteger(this, UserStakeTransactionsKey) { | |
70 | 70 | case a: Int => | |
71 | 71 | a | |
72 | 72 | case _ => | |
73 | 73 | 0 | |
74 | 74 | } | |
75 | 75 | let NewUserStakeTransactions = (UserStakeTransactions + 1) | |
76 | 76 | let currentAmountStakedToken = match getInteger(this, UserStakedTokenKey) { | |
77 | 77 | case a: Int => | |
78 | 78 | a | |
79 | 79 | case _ => | |
80 | 80 | 0 | |
81 | 81 | } | |
82 | 82 | let newAmountStakedToken = (currentAmountStakedToken + pmt.amount) | |
83 | 83 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
84 | 84 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
85 | 85 | case a: Int => | |
86 | 86 | a | |
87 | 87 | case _ => | |
88 | 88 | 0 | |
89 | 89 | } | |
90 | 90 | let StakeBalanceAmount = (StakeBalance + pmt.amount) | |
91 | 91 | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
92 | 92 | let currentAmountGovernToken = match getInteger(this, UserGovernTokenKey) { | |
93 | 93 | case a: Int => | |
94 | 94 | a | |
95 | 95 | case _ => | |
96 | 96 | 0 | |
97 | 97 | } | |
98 | 98 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
99 | 99 | case a: Int => | |
100 | 100 | a | |
101 | 101 | case _ => | |
102 | 102 | 0 | |
103 | 103 | } | |
104 | 104 | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
105 | 105 | then (PrizeAmount != 0) | |
106 | 106 | else false) | |
107 | 107 | then height | |
108 | 108 | else 0 | |
109 | 109 | if ((1 > GovernTokenSmartContractBalance)) | |
110 | 110 | then throw("No enough GovernToken In Contract, Please deposit GovernTokens") | |
111 | 111 | else if ((StakedTokenSmartContractBalance == 0)) | |
112 | 112 | then { | |
113 | 113 | let newAmountGovernToken = (currentAmountGovernToken + 10) | |
114 | 114 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("FundBox", PrizeAmount), DataEntry("PrizeHeight", PrizeHeightValue)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)])) | |
115 | 115 | } | |
116 | 116 | else if ((NewUserStakeTransactions > 50)) | |
117 | 117 | then { | |
118 | 118 | let Reward = ((10 * NewUserStakeTransactions) * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
119 | 119 | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
120 | 120 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, Reward), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("FundBox", PrizeAmount), DataEntry("PrizeHeight", PrizeHeightValue)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
121 | 121 | } | |
122 | 122 | else { | |
123 | 123 | let Reward = (10 * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
124 | 124 | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
125 | 125 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, Reward), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("FundBox", PrizeAmount), DataEntry("PrizeHeight", PrizeHeightValue)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
126 | 126 | } | |
127 | 127 | } | |
128 | 128 | else throw("Can deposit only StakeToken") | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | ||
133 | 133 | @Callable(i) | |
134 | 134 | func DepositGovernToken () = { | |
135 | 135 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
136 | 136 | let GovernTokenMaxDeposit = toBase58String(GovernToken) | |
137 | 137 | let pmt = extract(i.payment) | |
138 | 138 | if (if (isDefined(pmt.assetId)) | |
139 | 139 | then (extract(pmt.assetId) == GovernToken) | |
140 | 140 | else false) | |
141 | 141 | then { | |
142 | 142 | let currentKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
143 | 143 | let currentAmount = match getInteger(this, currentKey) { | |
144 | 144 | case a: Int => | |
145 | 145 | a | |
146 | 146 | case _ => | |
147 | 147 | 0 | |
148 | 148 | } | |
149 | 149 | let CurrrentGovernTokenDeposit = (currentAmount + pmt.amount) | |
150 | 150 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
151 | 151 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
152 | 152 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
153 | 153 | case a: Int => | |
154 | 154 | a | |
155 | 155 | case _ => | |
156 | 156 | 0 | |
157 | 157 | } | |
158 | 158 | if ((CurrrentGovernTokenDeposit > MaxGovernTokenDeposit)) | |
159 | 159 | then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit), DataEntry(MaxGovernTokenDepositerKey, currentKey)]) | |
160 | 160 | else WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit)]) | |
161 | 161 | } | |
162 | 162 | else throw("Can deposit only Govern Token") | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | ||
167 | 167 | @Callable(i) | |
168 | 168 | func WithdrawStakedFunds (amount) = { | |
169 | 169 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
170 | 170 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
171 | 171 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
172 | 172 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
173 | 173 | let currentKey = toBase58String(i.caller.bytes) | |
174 | 174 | let currentAmount = match getInteger(this, UserStakedTokenKey) { | |
175 | 175 | case a: Int => | |
176 | 176 | a | |
177 | 177 | case _ => | |
178 | 178 | 0 | |
179 | 179 | } | |
180 | 180 | let newAmount = (currentAmount - amount) | |
181 | 181 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
182 | 182 | case a: Int => | |
183 | 183 | a | |
184 | 184 | case _ => | |
185 | 185 | 0 | |
186 | 186 | } | |
187 | 187 | let StakeBalanceAmount = (StakeBalance - amount) | |
188 | 188 | if ((0 > amount)) | |
189 | 189 | then throw("Can't withdraw negative amount") | |
190 | 190 | else if ((0 > newAmount)) | |
191 | 191 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString(currentAmount))) | |
192 | 192 | else { | |
193 | 193 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
194 | 194 | if ((1 > GovernTokenAmount)) | |
195 | 195 | then throw("No enough GovernToken In Contract") | |
196 | 196 | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 1), DataEntry(UserStakedTokenKey, newAmount), DataEntry("StakeBalance", StakeBalanceAmount)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken), ScriptTransfer(i.caller, amount, StakedToken)])) | |
197 | 197 | } | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | ||
202 | 202 | @Callable(i) | |
203 | 203 | func HarvestGovernToiken (amount) = { | |
204 | 204 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
205 | 205 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
206 | 206 | let currentKey = toBase58String(i.caller.bytes) | |
207 | 207 | let currentAmount = match getInteger(this, UserGovernTokenKey) { | |
208 | 208 | case a: Int => | |
209 | 209 | a | |
210 | 210 | case _ => | |
211 | 211 | 0 | |
212 | 212 | } | |
213 | 213 | let newAmount = (currentAmount - amount) | |
214 | 214 | if ((0 > amount)) | |
215 | 215 | then throw("Can't withdraw negative amount") | |
216 | 216 | else if ((0 > newAmount)) | |
217 | 217 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString(currentAmount))) | |
218 | 218 | else { | |
219 | 219 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
220 | 220 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, GovernToken)])) | |
221 | 221 | } | |
222 | 222 | } | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | ||
226 | 226 | @Callable(i) | |
227 | 227 | func ClaimPrize () = { | |
228 | 228 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
229 | 229 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
230 | 230 | let FundBoxAddress58 = base58'3MsH5Hr1qQYUnwq4HTpiaGpXQi6cGPUsa5n' | |
231 | 231 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
232 | 232 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
233 | 233 | let FundBoxStakedToken = ((toBase58String(FundBoxAddress58) + "_") + toBase58String(StakedToken)) | |
234 | 234 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
235 | - | let FundBoxHeight = (toBase58String(FundBoxAddress58) + "_PrizeHeight") | |
236 | 235 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
237 | 236 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
238 | 237 | case a: Int => | |
239 | 238 | a | |
240 | 239 | case _ => | |
241 | 240 | 0 | |
242 | 241 | } | |
243 | 242 | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
244 | 243 | let UserGovernTokenAmount = match getInteger(this, UserGovernTokenKey) { | |
245 | 244 | case a: Int => | |
246 | 245 | a | |
247 | 246 | case _ => | |
248 | 247 | 0 | |
249 | 248 | } | |
250 | 249 | let UserStakedTokenAmount = match getInteger(this, UserStakedTokenKey) { | |
251 | 250 | case a: Int => | |
252 | 251 | a | |
253 | 252 | case _ => | |
254 | 253 | 0 | |
255 | 254 | } | |
256 | 255 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
257 | 256 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
258 | 257 | let PrizeWinner = getStringValue(this, MaxGovernTokenDepositerKey) | |
259 | - | let PrizeHeight = match getInteger(this, | |
258 | + | let PrizeHeight = match getInteger(this, "PrizeHeight") { | |
260 | 259 | case a: Int => | |
261 | 260 | a | |
262 | 261 | case _ => | |
263 | 262 | 0 | |
264 | 263 | } | |
265 | 264 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
266 | 265 | case a: Int => | |
267 | 266 | a | |
268 | 267 | case _ => | |
269 | 268 | 0 | |
270 | 269 | } | |
271 | 270 | if (if ((PrizeAmount == 0)) | |
272 | 271 | then true | |
273 | 272 | else (100 > GovernTokenAmount)) | |
274 | 273 | then throw("No prize to Claim or No enough Govern Token en Contract") | |
275 | 274 | else if ((UserGovernTokenKey != PrizeWinner)) | |
276 | 275 | then throw("You are not the winner hence cannot claim the reward ") | |
277 | 276 | else if ((1 > UserStakedTokenAmount)) | |
278 | 277 | then throw(("You have to Stake StakedToken to claim reward | |
279 | 278 | Your Balance of Staked Tokens is: " + toString(UserStakedTokenAmount))) | |
280 | 279 | else if (if (if ((UserGovernTokenAmount >= 100)) | |
281 | 280 | then (height >= (PrizeHeight + 10)) | |
282 | 281 | else false) | |
283 | 282 | then (height > 0) | |
284 | 283 | else false) | |
285 | 284 | then if ((UserGovernTokenAmount >= MaxGovernTokenDeposit)) | |
286 | 285 | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry("FundBox", 0), DataEntry(GovernTokenKey, 0), DataEntry(UserGovernTokenKey, 0), DataEntry(MaxGovernTokenDepositerKey, ""), DataEntry("PrizeHeight", 0)]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 100, GovernToken)])) | |
287 | 286 | else throw((("You should deposit at least " + toString(MaxGovernTokenDeposit)) + " to be able to claim reward")) | |
288 | 287 | else throw(((((((("You have to deposit 100 GovernToken to claim Reward | |
289 | 288 | Your Balance is: " + toString(UserGovernTokenAmount)) + " | |
290 | 289 | Deposit done at: ") + toString(PrizeHeight)) + " And wait:") + toString((PrizeHeight + 10))) + "And Height is:") + toString(height))) | |
291 | 290 | } | |
292 | 291 | ||
293 | 292 |
github/deemru/w8io/026f985 73.63 ms ◑