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