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