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