tx · AHZpKCsqBKjjo7nnyDgbnL2h5fuqe55uecwnohsiXi9k 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u: -0.01440000 Waves 2020.12.26 23:15 [1326146] smart account 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u > SELF 0.00000000 Waves
{ "type": 13, "id": "AHZpKCsqBKjjo7nnyDgbnL2h5fuqe55uecwnohsiXi9k", "fee": 1440000, "feeAssetId": null, "timestamp": 1609013738938, "version": 2, "chainId": 84, "sender": "3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u", "senderPublicKey": "FFDorDp8bC9dyUK2w8hYPWPVEcbbk9zYkpHn3gcq9svn", "proofs": [ "16UvprVMZV5duK4qry6Z2ri3pfkAPfaq19i57HLb4Pw84y6iXo5MUS45wSvwq8LZM5WCJfcXzBzNxgLCqr6gQrr" ], "script": "base64:AAIDAAAAAAAAABYIARIAEgASABIAEgMKAQESAwoBARIAAAAAAAAAAAcAAAABaQEAAAAMUmVhZFBvb2xEYXRhAAAAAAQAAAAOR292ZXJuVG9rZW5LZXkCAAAAFUdvdmVyblRva2VuTWF4RGVwb3NpdAQAAAAaTWF4R292ZXJuVG9rZW5EZXBvc2l0ZXJLZXkCAAAAGk1heEdvdmVyblRva2VuRGVwb3NpdGVyS2V5BAAAAAtTdGFrZWRUb2tlbgEAAAAg4kCrtAPNiHBMRPYvMCXeThBq6KlRf6cxe4yUvVS2aoUEAAAAC0dvdmVyblRva2VuAQAAACASiWf4V0Rs4Spwpaqhn2bfVjnt1mPO6pt7R8ZSZ6gxXgQAAAASVXNlclN0YWtlZFRva2VuS2V5CQABLAAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAFfCQACWAAAAAEFAAAAC1N0YWtlZFRva2VuBAAAABJVc2VyR292ZXJuVG9rZW5LZXkJAAEsAAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZX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CQABLAAAAAICAAAAR1lvdSBoYXZlIHRvIGRlcG9zaXQgMTAwIEdvdmVyblRva2VuIHRvIGNsYWltIFJld2FyZCAKIFlvdXIgQmFsYW5jZSBpczogCQABpAAAAAEFAAAAFVVzZXJHb3Zlcm5Ub2tlbkFtb3VudAIAAAATCiBEZXBvc2l0IGRvbmUgYXQ6IAkAAaQAAAABBQAAAAtQcml6ZUhlaWdodAIAAAALICBBbmQgd2FpdDoJAAGkAAAAAQkAAGkAAAACBQAAAAZoZWlnaHQAAAAAAAAAADwAAAAAhXInbA==", "height": 1326146, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 41qCn2pHGNSFKoDTcVjcY3Zz2KEfbuWA5UXGd4QmDuru Next: 4FWeCDxUUU5St8Uq3rgfTAiuK6mqvugtW5dKnAHGsrC2 Diff:
Old | New | Differences | |
---|---|---|---|
249 | 249 | then throw(("You have to Stake StakedToken to claim reward | |
250 | 250 | Your Balance of Staked Tokens is: " + toString(UserStakedTokenAmount))) | |
251 | 251 | else if (if ((UserGovernTokenAmount >= 100)) | |
252 | - | then (height >= (PrizeHeight + (( | |
252 | + | then (height >= (PrizeHeight + ((15 * height) / 60))) | |
253 | 253 | else false) | |
254 | 254 | then if ((UserGovernTokenAmount >= MaxGovernTokenDeposit)) | |
255 | 255 | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry(FundBoxStakedToken, 0), DataEntry(GovernTokenKey, 0), DataEntry(UserGovernTokenKey, 0), DataEntry(MaxGovernTokenDepositerKey, "")]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 100, GovernToken)])) |
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 FundBoxAddress58 = "3MsH5Hr1qQYUnwq4HTpiaGpXQi6cGPUsa5n" | |
57 | 57 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
58 | 58 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
59 | 59 | let GovernTokenSmartContractBalance = assetBalance(this, GovernToken) | |
60 | 60 | let StakedTokenSmartContractBalance = assetBalance(this, StakedToken) | |
61 | 61 | let pmt = extract(i.payment) | |
62 | 62 | if (if ((pmt.amount > 0)) | |
63 | 63 | then (pmt.assetId == StakedToken) | |
64 | 64 | else false) | |
65 | 65 | then { | |
66 | 66 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
67 | 67 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
68 | 68 | let UserStakeTransactionsKey = (toBase58String(i.caller.bytes) + "_StakedTransactions") | |
69 | 69 | let AddressHeight = (toBase58String(i.caller.bytes) + "_PrizeHeight") | |
70 | 70 | let UserStakeTransactions = match getInteger(this, UserStakeTransactionsKey) { | |
71 | 71 | case a: Int => | |
72 | 72 | a | |
73 | 73 | case _ => | |
74 | 74 | 0 | |
75 | 75 | } | |
76 | 76 | let NewUserStakeTransactions = (UserStakeTransactions + 1) | |
77 | 77 | let currentAmountStakedToken = match getInteger(this, UserStakedTokenKey) { | |
78 | 78 | case a: Int => | |
79 | 79 | a | |
80 | 80 | case _ => | |
81 | 81 | 0 | |
82 | 82 | } | |
83 | 83 | let newAmountStakedToken = (currentAmountStakedToken + pmt.amount) | |
84 | 84 | let currentAmountGovernToken = match getInteger(this, UserGovernTokenKey) { | |
85 | 85 | case a: Int => | |
86 | 86 | a | |
87 | 87 | case _ => | |
88 | 88 | 0 | |
89 | 89 | } | |
90 | 90 | if ((1 > GovernTokenSmartContractBalance)) | |
91 | 91 | then throw("No enough GovernToken In Contract, Please deposit GovernTokens") | |
92 | 92 | else if ((StakedTokenSmartContractBalance == 0)) | |
93 | 93 | then { | |
94 | 94 | let newAmountGovernToken = (currentAmountGovernToken + 10) | |
95 | 95 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry(AddressHeight, height)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)])) | |
96 | 96 | } | |
97 | 97 | else if ((NewUserStakeTransactions > 50)) | |
98 | 98 | then { | |
99 | 99 | let Reward = ((10 * NewUserStakeTransactions) * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
100 | 100 | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
101 | 101 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, Reward), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry(AddressHeight, height)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
102 | 102 | } | |
103 | 103 | else { | |
104 | 104 | let Reward = (10 * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
105 | 105 | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
106 | 106 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, Reward), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry(AddressHeight, height)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
107 | 107 | } | |
108 | 108 | } | |
109 | 109 | else throw("Can deposit only StakeToken") | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | 114 | @Callable(i) | |
115 | 115 | func DepositGovernToken () = { | |
116 | 116 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
117 | 117 | let GovernTokenMaxDeposit = toBase58String(GovernToken) | |
118 | 118 | let pmt = extract(i.payment) | |
119 | 119 | if (if (isDefined(pmt.assetId)) | |
120 | 120 | then (extract(pmt.assetId) == GovernToken) | |
121 | 121 | else false) | |
122 | 122 | then { | |
123 | 123 | let currentKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
124 | 124 | let currentAmount = match getInteger(this, currentKey) { | |
125 | 125 | case a: Int => | |
126 | 126 | a | |
127 | 127 | case _ => | |
128 | 128 | 0 | |
129 | 129 | } | |
130 | 130 | let CurrrentGovernTokenDeposit = (currentAmount + pmt.amount) | |
131 | 131 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
132 | 132 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
133 | 133 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
134 | 134 | case a: Int => | |
135 | 135 | a | |
136 | 136 | case _ => | |
137 | 137 | 0 | |
138 | 138 | } | |
139 | 139 | if ((CurrrentGovernTokenDeposit > MaxGovernTokenDeposit)) | |
140 | 140 | then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit), DataEntry(MaxGovernTokenDepositerKey, currentKey)]) | |
141 | 141 | else WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit)]) | |
142 | 142 | } | |
143 | 143 | else throw("Can deposit only Govern Token") | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | ||
148 | 148 | @Callable(i) | |
149 | 149 | func WithdrawStakedFunds (amount) = { | |
150 | 150 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
151 | 151 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
152 | 152 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
153 | 153 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
154 | 154 | let currentKey = toBase58String(i.caller.bytes) | |
155 | 155 | let currentAmount = match getInteger(this, UserStakedTokenKey) { | |
156 | 156 | case a: Int => | |
157 | 157 | a | |
158 | 158 | case _ => | |
159 | 159 | 0 | |
160 | 160 | } | |
161 | 161 | let newAmount = (currentAmount - amount) | |
162 | 162 | if ((0 > amount)) | |
163 | 163 | then throw("Can't withdraw negative amount") | |
164 | 164 | else if ((0 > newAmount)) | |
165 | 165 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString(currentAmount))) | |
166 | 166 | else { | |
167 | 167 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
168 | 168 | if ((1 > GovernTokenAmount)) | |
169 | 169 | then throw("No enough GovernToken In Contract") | |
170 | 170 | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 1), DataEntry(UserStakedTokenKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken), ScriptTransfer(i.caller, amount, StakedToken)])) | |
171 | 171 | } | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func HarvestGovernToiken (amount) = { | |
178 | 178 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
179 | 179 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
180 | 180 | let currentKey = toBase58String(i.caller.bytes) | |
181 | 181 | let currentAmount = match getInteger(this, UserGovernTokenKey) { | |
182 | 182 | case a: Int => | |
183 | 183 | a | |
184 | 184 | case _ => | |
185 | 185 | 0 | |
186 | 186 | } | |
187 | 187 | let newAmount = (currentAmount - 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 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, GovernToken)])) | |
195 | 195 | } | |
196 | 196 | } | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | ||
200 | 200 | @Callable(i) | |
201 | 201 | func ClaimPrize () = { | |
202 | 202 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
203 | 203 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
204 | 204 | let FundBoxAddress58 = base58'3MsH5Hr1qQYUnwq4HTpiaGpXQi6cGPUsa5n' | |
205 | 205 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
206 | 206 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
207 | 207 | let FundBoxStakedToken = ((toBase58String(FundBoxAddress58) + "_") + toBase58String(StakedToken)) | |
208 | 208 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
209 | 209 | let UserGovernTokenAmount = match getInteger(this, UserGovernTokenKey) { | |
210 | 210 | case a: Int => | |
211 | 211 | a | |
212 | 212 | case _ => | |
213 | 213 | 0 | |
214 | 214 | } | |
215 | 215 | let UserStakedTokenAmount = match getInteger(this, UserStakedTokenKey) { | |
216 | 216 | case a: Int => | |
217 | 217 | a | |
218 | 218 | case _ => | |
219 | 219 | 0 | |
220 | 220 | } | |
221 | 221 | let PrizeAmount = match getInteger(this, FundBoxStakedToken) { | |
222 | 222 | case a: Int => | |
223 | 223 | a | |
224 | 224 | case _ => | |
225 | 225 | 0 | |
226 | 226 | } | |
227 | 227 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
228 | 228 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
229 | 229 | let PrizeWinner = getStringValue(this, MaxGovernTokenDepositerKey) | |
230 | 230 | let PrizeHeight = match getInteger(this, GovernTokenKey) { | |
231 | 231 | case a: Int => | |
232 | 232 | a | |
233 | 233 | case _ => | |
234 | 234 | height | |
235 | 235 | } | |
236 | 236 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
237 | 237 | case a: Int => | |
238 | 238 | a | |
239 | 239 | case _ => | |
240 | 240 | 0 | |
241 | 241 | } | |
242 | 242 | if (if ((PrizeAmount == 0)) | |
243 | 243 | then true | |
244 | 244 | else (100 > GovernTokenAmount)) | |
245 | 245 | then throw("No prize to Claim or No enough Govern Token en Contract") | |
246 | 246 | else if ((UserGovernTokenKey != PrizeWinner)) | |
247 | 247 | then throw("You are not the winner hence cannot claim the reward ") | |
248 | 248 | else if ((1 > UserStakedTokenAmount)) | |
249 | 249 | then throw(("You have to Stake StakedToken to claim reward | |
250 | 250 | Your Balance of Staked Tokens is: " + toString(UserStakedTokenAmount))) | |
251 | 251 | else if (if ((UserGovernTokenAmount >= 100)) | |
252 | - | then (height >= (PrizeHeight + (( | |
252 | + | then (height >= (PrizeHeight + ((15 * height) / 60))) | |
253 | 253 | else false) | |
254 | 254 | then if ((UserGovernTokenAmount >= MaxGovernTokenDeposit)) | |
255 | 255 | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry(FundBoxStakedToken, 0), DataEntry(GovernTokenKey, 0), DataEntry(UserGovernTokenKey, 0), DataEntry(MaxGovernTokenDepositerKey, "")]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 100, GovernToken)])) | |
256 | 256 | else throw((("You should deposit at least " + toString(MaxGovernTokenDeposit)) + " to be able to claim reward")) | |
257 | 257 | else throw(((((("You have to deposit 100 GovernToken to claim Reward | |
258 | 258 | Your Balance is: " + toString(UserGovernTokenAmount)) + " | |
259 | 259 | Deposit done at: ") + toString(PrizeHeight)) + " And wait:") + toString((height / 60)))) | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 |
github/deemru/w8io/169f3d6 43.91 ms ◑