tx · Ca3Dp34rhj3g6sQqibTtpQawbwg65rDJVdDrhceJn4KT 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u: -0.01440000 Waves 2020.12.29 22:42 [1330423] smart account 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u > SELF 0.00000000 Waves
{ "type": 13, "id": "Ca3Dp34rhj3g6sQqibTtpQawbwg65rDJVdDrhceJn4KT", "fee": 1440000, "feeAssetId": null, "timestamp": 1609270981941, "version": 2, "chainId": 84, "sender": "3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u", "senderPublicKey": "FFDorDp8bC9dyUK2w8hYPWPVEcbbk9zYkpHn3gcq9svn", "proofs": [ "5J1PGNX7TdXM4ZWGY83oXVrY66P86VXLFtFoJPLZE5NYH5S9AQa8Vrw5AFxwJATMC8ZQCDeKW6dS5PokSYLM7VWz" ], "script": "base64:AAIDAAAAAAAAABgIARIAEgASABIAEgMKAQESAwoBARIAEgAAAAAAAAAACAAAAAFpAQAAAAxSZWFkUG9vbERhdGEAAAAABAAAAA5Hb3Zlcm5Ub2tlbktleQIAAAAVR292ZXJuVG9rZW5NYXhEZXBvc2l0BAAAABpNYXhHb3Zlcm5Ub2tlbkRlcG9zaXRlcktleQIAAAAaTWF4R292ZXJuVG9rZW5EZXBvc2l0ZXJLZXkEAAAAC1N0YWtlZFRva2VuAQAAACDiQKu0A82IcExE9i8wJd5OEGroqVF/pzF7jJS9VLZqhQQAAAALR292ZXJuVG9rZW4BAAAAIBKJZ/hXRGzhKnClqqGfZt9WOe3WY87qm3tHxlJnqDFeBAAAABJVc2VyU3Rha2VkVG9rZW5LZXkJAAEsAAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAAAV8JAAJYAAAAAQUAAAALU3Rha2VkVG9rZW4EAAAAElVzZXJHb3Zlcm5Ub2tlbktleQkAASwAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAAB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AGaGVpZ2h0AAAAAL9jtpw=", "height": 1330423, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: aSUfR8pZp4ttHdbAyLqQfZgouXHQj1PqqUzrp8Njhm7 Next: 9DJGnpqoMJQ8LkhzKi1cswsGLD7AQdLjsHM2MsqfeL4b Diff:
Old | New | Differences | |
---|---|---|---|
62 | 62 | then (pmt.assetId == StakedToken) | |
63 | 63 | else false) | |
64 | 64 | then { | |
65 | - | let UserStakedTokenKey = ( | |
66 | - | let UserGovernTokenKey = ( | |
65 | + | let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking") | |
66 | + | let UserGovernTokenKey = (toBase58String(i.caller.bytes) + "_Earnings") | |
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) { | |
108 | 108 | else 0 | |
109 | 109 | if ((1 > GovernTokenSmartContractBalance)) | |
110 | 110 | then throw("No enough GovernToken In Contract, Please deposit GovernTokens") | |
111 | - | else if ((StakedTokenSmartContractBalance == 0)) | |
112 | - | then { | |
113 | - | let newAmountGovernToken = (currentAmountGovernToken + 10) | |
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 | - | } | |
116 | - | else if ((NewUserStakeTransactions > 50)) | |
117 | - | then { | |
118 | - | let Reward = ((10 * NewUserStakeTransactions) * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
119 | - | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
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 | - | } | |
122 | - | else { | |
123 | - | let Reward = (10 * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
124 | - | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
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 | - | } | |
111 | + | else { | |
112 | + | let Reward = if ((StakedTokenSmartContractBalance == 0)) | |
113 | + | then 10 | |
114 | + | else if ((NewUserStakeTransactions > 50)) | |
115 | + | then ((10 * NewUserStakeTransactions) * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
116 | + | else (10 * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
117 | + | let newAmountGovernToken = (currentAmountGovernToken + 10) | |
118 | + | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("FundBox", PrizeAmount), DataEntry("PrizeHeight", PrizeHeightValue)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
119 | + | } | |
127 | 120 | } | |
128 | 121 | else throw("Can deposit only StakeToken") | |
129 | 122 | } |
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 | - | let UserStakedTokenKey = ( | |
66 | - | let UserGovernTokenKey = ( | |
65 | + | let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking") | |
66 | + | let UserGovernTokenKey = (toBase58String(i.caller.bytes) + "_Earnings") | |
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 | - | else if ((StakedTokenSmartContractBalance == 0)) | |
112 | - | then { | |
113 | - | let newAmountGovernToken = (currentAmountGovernToken + 10) | |
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 | - | } | |
116 | - | else if ((NewUserStakeTransactions > 50)) | |
117 | - | then { | |
118 | - | let Reward = ((10 * NewUserStakeTransactions) * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
119 | - | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
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 | - | } | |
122 | - | else { | |
123 | - | let Reward = (10 * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
124 | - | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
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 | - | } | |
111 | + | else { | |
112 | + | let Reward = if ((StakedTokenSmartContractBalance == 0)) | |
113 | + | then 10 | |
114 | + | else if ((NewUserStakeTransactions > 50)) | |
115 | + | then ((10 * NewUserStakeTransactions) * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
116 | + | else (10 * (newAmountStakedToken / StakedTokenSmartContractBalance)) | |
117 | + | let newAmountGovernToken = (currentAmountGovernToken + 10) | |
118 | + | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("FundBox", PrizeAmount), DataEntry("PrizeHeight", PrizeHeightValue)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
119 | + | } | |
127 | 120 | } | |
128 | 121 | else throw("Can deposit only StakeToken") | |
129 | 122 | } | |
130 | 123 | ||
131 | 124 | ||
132 | 125 | ||
133 | 126 | @Callable(i) | |
134 | 127 | func DepositGovernToken () = { | |
135 | 128 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
136 | 129 | let GovernTokenMaxDeposit = toBase58String(GovernToken) | |
137 | 130 | let pmt = extract(i.payment) | |
138 | 131 | if (if (isDefined(pmt.assetId)) | |
139 | 132 | then (extract(pmt.assetId) == GovernToken) | |
140 | 133 | else false) | |
141 | 134 | then { | |
142 | 135 | let currentKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
143 | 136 | let currentAmount = match getInteger(this, currentKey) { | |
144 | 137 | case a: Int => | |
145 | 138 | a | |
146 | 139 | case _ => | |
147 | 140 | 0 | |
148 | 141 | } | |
149 | 142 | let CurrrentGovernTokenDeposit = (currentAmount + pmt.amount) | |
150 | 143 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
151 | 144 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
152 | 145 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
153 | 146 | case a: Int => | |
154 | 147 | a | |
155 | 148 | case _ => | |
156 | 149 | 0 | |
157 | 150 | } | |
158 | 151 | if ((CurrrentGovernTokenDeposit > MaxGovernTokenDeposit)) | |
159 | 152 | then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit), DataEntry(MaxGovernTokenDepositerKey, currentKey)]) | |
160 | 153 | else WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit)]) | |
161 | 154 | } | |
162 | 155 | else throw("Can deposit only Govern Token") | |
163 | 156 | } | |
164 | 157 | ||
165 | 158 | ||
166 | 159 | ||
167 | 160 | @Callable(i) | |
168 | 161 | func WithdrawStakedFunds (amount) = { | |
169 | 162 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
170 | 163 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
171 | 164 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
172 | 165 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
173 | 166 | let currentKey = toBase58String(i.caller.bytes) | |
174 | 167 | let currentAmount = match getInteger(this, UserStakedTokenKey) { | |
175 | 168 | case a: Int => | |
176 | 169 | a | |
177 | 170 | case _ => | |
178 | 171 | 0 | |
179 | 172 | } | |
180 | 173 | let newAmount = (currentAmount - amount) | |
181 | 174 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
182 | 175 | case a: Int => | |
183 | 176 | a | |
184 | 177 | case _ => | |
185 | 178 | 0 | |
186 | 179 | } | |
187 | 180 | let StakeBalanceAmount = (StakeBalance - amount) | |
188 | 181 | if ((0 > amount)) | |
189 | 182 | then throw("Can't withdraw negative amount") | |
190 | 183 | else if ((0 > newAmount)) | |
191 | 184 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString(currentAmount))) | |
192 | 185 | else { | |
193 | 186 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
194 | 187 | if ((1 > GovernTokenAmount)) | |
195 | 188 | then throw("No enough GovernToken In Contract") | |
196 | 189 | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 1), DataEntry(UserStakedTokenKey, newAmount), DataEntry("StakeBalance", StakeBalanceAmount)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken), ScriptTransfer(i.caller, amount, StakedToken)])) | |
197 | 190 | } | |
198 | 191 | } | |
199 | 192 | ||
200 | 193 | ||
201 | 194 | ||
202 | 195 | @Callable(i) | |
203 | 196 | func HarvestGovernToiken (amount) = { | |
204 | 197 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
205 | 198 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_Farm_") + toBase58String(GovernToken)) | |
206 | 199 | let currentKey = toBase58String(i.caller.bytes) | |
207 | 200 | let currentAmount = match getInteger(this, UserGovernTokenKey) { | |
208 | 201 | case a: Int => | |
209 | 202 | a | |
210 | 203 | case _ => | |
211 | 204 | 0 | |
212 | 205 | } | |
213 | 206 | let newAmount = (currentAmount - amount) | |
214 | 207 | if ((0 > amount)) | |
215 | 208 | then throw("Can't withdraw negative amount") | |
216 | 209 | else if ((0 > newAmount)) | |
217 | 210 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString(currentAmount))) | |
218 | 211 | else { | |
219 | 212 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
220 | 213 | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, GovernToken)])) | |
221 | 214 | } | |
222 | 215 | } | |
223 | 216 | ||
224 | 217 | ||
225 | 218 | ||
226 | 219 | @Callable(i) | |
227 | 220 | func delayprize () = { | |
228 | 221 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
229 | 222 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
230 | 223 | let UserWalletSGovernBalance = assetBalance(Address(i.caller.bytes), GovernToken) | |
231 | 224 | let ActualDelay = match getInteger(this, "Delay") { | |
232 | 225 | case a: Int => | |
233 | 226 | a | |
234 | 227 | case _ => | |
235 | 228 | 0 | |
236 | 229 | } | |
237 | 230 | let ActualDelayCost = match getInteger(this, "DelayCost") { | |
238 | 231 | case a: Int => | |
239 | 232 | a | |
240 | 233 | case _ => | |
241 | 234 | 10 | |
242 | 235 | } | |
243 | 236 | let pmt = extract(i.payment) | |
244 | 237 | if (if (isDefined(pmt.assetId)) | |
245 | 238 | then (extract(pmt.assetId) == GovernToken) | |
246 | 239 | else false) | |
247 | 240 | then { | |
248 | 241 | let UserGovernTokenAmount = pmt.amount | |
249 | 242 | let NewDelayCost = if ((ActualDelayCost == 0)) | |
250 | 243 | then 10 | |
251 | 244 | else (2 * ActualDelayCost) | |
252 | 245 | if ((UserGovernTokenAmount >= NewDelayCost)) | |
253 | 246 | then { | |
254 | 247 | let NewDelay = (ActualDelay + 10) | |
255 | 248 | WriteSet([DataEntry("Delay", NewDelay), DataEntry("DelayCost", NewDelayCost)]) | |
256 | 249 | } | |
257 | 250 | else throw((("To delay the release of the reward ONE DAY later than expected, you need " + toString(NewDelayCost)) + "TROIKAs")) | |
258 | 251 | } | |
259 | 252 | else throw("Can Use only Govern Token to Delay Reward") | |
260 | 253 | } | |
261 | 254 | ||
262 | 255 | ||
263 | 256 | ||
264 | 257 | @Callable(i) | |
265 | 258 | func ClaimPrize () = { | |
266 | 259 | let StakedToken = base58'GECLRH2fx2Xxix5gmrGV92AMt1A9LPohRpqwqRE16mwr' | |
267 | 260 | let GovernToken = base58'2FMrxDLdQhauSY7d1uDUyKP1MpxkM7BeWA2UMnk3cG3P' | |
268 | 261 | let UserStakedTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken)) | |
269 | 262 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
270 | 263 | let GovernTokenAmount = assetBalance(this, GovernToken) | |
271 | 264 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
272 | 265 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
273 | 266 | case a: Int => | |
274 | 267 | a | |
275 | 268 | case _ => | |
276 | 269 | 0 | |
277 | 270 | } | |
278 | 271 | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
279 | 272 | let UserGovernTokenAmount = match getInteger(this, UserGovernTokenKey) { | |
280 | 273 | case a: Int => | |
281 | 274 | a | |
282 | 275 | case _ => | |
283 | 276 | 0 | |
284 | 277 | } | |
285 | 278 | let UserStakedTokenAmount = match getInteger(this, UserStakedTokenKey) { | |
286 | 279 | case a: Int => | |
287 | 280 | a | |
288 | 281 | case _ => | |
289 | 282 | 0 | |
290 | 283 | } | |
291 | 284 | let ActualDelay = match getInteger(this, "Delay") { | |
292 | 285 | case a: Int => | |
293 | 286 | a | |
294 | 287 | case _ => | |
295 | 288 | 0 | |
296 | 289 | } | |
297 | 290 | let GovernTokenKey = "GovernTokenMaxDeposit" | |
298 | 291 | let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey" | |
299 | 292 | let PrizeWinner = getStringValue(this, MaxGovernTokenDepositerKey) | |
300 | 293 | let PrizeHeight = match getInteger(this, "PrizeHeight") { | |
301 | 294 | case a: Int => | |
302 | 295 | a | |
303 | 296 | case _ => | |
304 | 297 | 0 | |
305 | 298 | } | |
306 | 299 | let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) { | |
307 | 300 | case a: Int => | |
308 | 301 | a | |
309 | 302 | case _ => | |
310 | 303 | 0 | |
311 | 304 | } | |
312 | 305 | if (if ((PrizeAmount == 0)) | |
313 | 306 | then true | |
314 | 307 | else (100 > GovernTokenAmount)) | |
315 | 308 | then throw("No prize to Claim or No enough Govern Token en Contract") | |
316 | 309 | else if ((UserGovernTokenKey != PrizeWinner)) | |
317 | 310 | then throw("You are not the winner hence cannot claim the reward ") | |
318 | 311 | else if ((1 > UserStakedTokenAmount)) | |
319 | 312 | then throw(("You have to Stake StakedToken to claim reward | |
320 | 313 | Your Balance of Staked Tokens is: " + toString(UserStakedTokenAmount))) | |
321 | 314 | else if (if (if ((UserGovernTokenAmount >= 100)) | |
322 | 315 | then (height >= (PrizeHeight + ActualDelay)) | |
323 | 316 | else false) | |
324 | 317 | then (height > 0) | |
325 | 318 | else false) | |
326 | 319 | then if ((UserGovernTokenAmount >= MaxGovernTokenDeposit)) | |
327 | 320 | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry("FundBox", 0), DataEntry(GovernTokenKey, 0), DataEntry(UserGovernTokenKey, 0), DataEntry(MaxGovernTokenDepositerKey, ""), DataEntry("PrizeHeight", 0), DataEntry("Delay", 0), DataEntry("DelayCost", 0)]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 100, GovernToken)])) | |
328 | 321 | else throw((("You should deposit at least " + toString(MaxGovernTokenDeposit)) + " to be able to claim reward")) | |
329 | 322 | else throw(((((((("You have to deposit 100 GovernToken to claim Reward | |
330 | 323 | Your Balance is: " + toString(UserGovernTokenAmount)) + " | |
331 | 324 | Deposit done at: ") + toString(PrizeHeight)) + " And wait:") + toString((PrizeHeight + 10))) + "And Height is:") + toString(height))) | |
332 | 325 | } | |
333 | 326 | ||
334 | 327 |
github/deemru/w8io/169f3d6 44.95 ms ◑