tx · 5rvpZRhiBw9zDWWdWwWj9ddqmVyuLmxXsExcTr4JNxBi 3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z: -0.01300000 Waves 2025.01.07 16:59 [3448846] smart account 3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z > SELF 0.00000000 Waves
{ "type": 13, "id": "5rvpZRhiBw9zDWWdWwWj9ddqmVyuLmxXsExcTr4JNxBi", "fee": 1300000, "feeAssetId": null, "timestamp": 1736258391899, "version": 2, "chainId": 84, "sender": "3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z", "senderPublicKey": "5CoDbXxoqnvJpx9GrS6M4G5GYJXh9rcoiXJz7RYTPVkL", "proofs": [ "k2Kn7GtLZmJUAfW3CET2pU6HuXfSF1yFafSbmGV6j7itrXDBqKjqyPBJgGcgumz7ZStH8Cz9Qf2ao8mcZnSSefV" ], "script": "base64:BgIyCAISCgoIAQgEAhEYFBISBAoCCAgSABIDCgEBEgASABIAEgMKAQESABIDCgEIEgMKAQgsAANNMTYAgICE/qbe4READlNUQUtFUlNfQU1PVU5UAICAzvK+j6oFAAtURUFNX0FNT1VOVACAgJqm6q/jAQANTUFSS0VUX0FNT1VOVACAgJzl/Z7UCgALWUVBUl9CTE9DS1MJAGgCAO0CAKALAAxTVEFLRV9QRVJJT0QJAGgCAAUFC1lFQVJfQkxPQ0tTAAtCTEVTU19QUklDRQCA0NvD9AIADUxPVFRFUllfUFJJQ0UAgNDbw/QCAAtGT01PX1BFUklPRAA8AAxSQU5ET01fREVMQVkAAgAUQ1VSUkVOVF9KQUNLUE9UX1BFUkMAMgARTkVYVF9KQUNLUE9UX1BFUkMAFAAMU1RBS0VSU19QRVJDABQACVRFQU1fUEVSQwAKAA5nb3JjQXNzZXRJZEtleQILZ29yY0Fzc2V0SWQAC2dvcmNBc3NldElkCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKEIAQUOZ29yY0Fzc2V0SWRLZXkCFkdPUkMgaXMgbm90IGlzc3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QDMCAIJAKwCAgINJXMlZF9fZ3Vlc3NfXwkApAMBBQVndWVzcwUDbmlsAWkBEndhbGxldEluZm9SRUFET05MWQEOdXNlckFkZHJlc3NPcHQJAJQKAgUDbmlsCQEOd2FsbGV0SW50ZXJuYWwBBQ51c2VyQWRkcmVzc09wdACgWdLK", "height": 3448846, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: nrHckPCsDibbJErdzhdt5m9gk8oea1CUSrwfQmoqX4W Next: none Diff:
Old | New | Differences | |
---|---|---|---|
55 | 55 | ||
56 | 56 | let lastFomoPlayerKey = "lastFomoPlayer" | |
57 | 57 | ||
58 | + | let lastFomoWinnerKey = "lastFomoWinner" | |
59 | + | ||
60 | + | let lastFomoWinnerAmountKey = "lastFomoWinnerAmount" | |
61 | + | ||
62 | + | let lastFomoWinnerTimeKey = "lastFomoWinnerTime" | |
63 | + | ||
58 | 64 | let teamWalletAddrKey = "teamWalletAddr" | |
59 | 65 | ||
60 | 66 | let brokerAddrKey = "brokerAddr" | |
71 | 77 | let currLotteryJackpotKey = "currLotteryJackpot" | |
72 | 78 | ||
73 | 79 | let nextLotteryJackpotKey = "nextLotteryJackpot" | |
80 | + | ||
81 | + | let lastLotteryWinnerKey = "lastLotteryWinner" | |
82 | + | ||
83 | + | let lastLotteryWinnerAmountKey = "lastLotteryWinnerAmount" | |
84 | + | ||
85 | + | let lastLotteryWinnerTimeKey = "lastLotteryWinnerTime" | |
74 | 86 | ||
75 | 87 | func gorcStats (userAddrOpt) = { | |
76 | 88 | let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0) | |
130 | 142 | else false) | |
131 | 143 | then (lastFomoPlayer != "") | |
132 | 144 | else false) | |
133 | - | then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), fomoCurrJackpot, gorcAssetId), IntegerEntry(currFomoJackpotKey, (fomoNextJackpot + deltaCurrJackpot)), IntegerEntry(nextFomoJackpotKey, deltaNextJackpot)] | |
145 | + | then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), fomoCurrJackpot, gorcAssetId), StringEntry(lastFomoWinnerKey, lastFomoPlayer), IntegerEntry(lastFomoWinnerAmountKey, fomoCurrJackpot), IntegerEntry(lastFomoWinnerTimeKey, lastBlock.timestamp), IntegerEntry(currFomoJackpotKey, (fomoNextJackpot + deltaCurrJackpot)), IntegerEntry(nextFomoJackpotKey, deltaNextJackpot)] | |
134 | 146 | else [IntegerEntry(currFomoJackpotKey, (fomoCurrJackpot + deltaCurrJackpot)), IntegerEntry(nextFomoJackpotKey, (fomoNextJackpot + deltaNextJackpot))] | |
135 | 147 | (([IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller)), ScriptTransfer(addressFromStringValue(getStringValue(teamWalletAddrKey)), deltaTeamAmount, gorcAssetId), IntegerEntry(stakersAmountLeftKey, (getIntegerValue(stakersAmountLeftKey) + deltaStakersAmount)), IntegerEntry(stakersAmountTotalKey, (getIntegerValue(stakersAmountTotalKey) + deltaStakersAmount))] ++ changeActions) ++ fomoActions) | |
136 | 148 | } | |
188 | 200 | then throw("GORC payments only!") | |
189 | 201 | else { | |
190 | 202 | let addr = toString(i.caller) | |
191 | - | let $ | |
192 | - | let userAmount = $ | |
193 | - | let amountLeftTotal = $ | |
203 | + | let $t074627513 = gorcStats(addr) | |
204 | + | let userAmount = $t074627513._1 | |
205 | + | let amountLeftTotal = $t074627513._2 | |
194 | 206 | let userAmountKey = stakedAmountByUserKey(addr) | |
195 | 207 | let claimActions = if ((userAmount > 0)) | |
196 | 208 | then [ScriptTransfer(i.caller, userAmount, gorcAssetId)] | |
214 | 226 | if ((0 > (oldAmount - amount))) | |
215 | 227 | then throw(((("You have only " + fixedPoint(oldAmount, 8)) + " GORC staked, tried to unstake ") + fixedPoint(amount, 8))) | |
216 | 228 | else { | |
217 | - | let $ | |
218 | - | let userAmount = $ | |
219 | - | let amountLeftTotal = $ | |
229 | + | let $t084748525 = gorcStats(addr) | |
230 | + | let userAmount = $t084748525._1 | |
231 | + | let amountLeftTotal = $t084748525._2 | |
220 | 232 | let claimActions = if ((userAmount > 0)) | |
221 | 233 | then [ScriptTransfer(i.caller, userAmount, gorcAssetId)] | |
222 | 234 | else nil | |
232 | 244 | then throw("No payments required") | |
233 | 245 | else { | |
234 | 246 | let addr = toString(i.caller) | |
235 | - | let $ | |
236 | - | let userAmount = $ | |
237 | - | let amountLeftTotal = $ | |
247 | + | let $t090899140 = gorcStats(addr) | |
248 | + | let userAmount = $t090899140._1 | |
249 | + | let amountLeftTotal = $t090899140._2 | |
238 | 250 | let claimActions = if ((userAmount > 0)) | |
239 | 251 | then [ScriptTransfer(i.caller, userAmount, gorcAssetId)] | |
240 | 252 | else nil | |
310 | 322 | let rand = getRandomNumber(12, salt, entropy) | |
311 | 323 | let currJackpot = valueOrElse(getInteger(currLotteryJackpotKey), 0) | |
312 | 324 | let winActions = if ((rand == guess)) | |
313 | - | then [ScriptTransfer(i.caller, currJackpot, gorcAssetId), IntegerEntry(currLotteryJackpotKey, valueOrElse(getInteger(nextLotteryJackpotKey), 0)), IntegerEntry(nextLotteryJackpotKey, 0)] | |
325 | + | then [ScriptTransfer(i.caller, currJackpot, gorcAssetId), StringEntry(lastLotteryWinnerKey, addr), IntegerEntry(lastLotteryWinnerAmountKey, currJackpot), IntegerEntry(lastLotteryWinnerTimeKey, lastBlock.timestamp), IntegerEntry(currLotteryJackpotKey, valueOrElse(getInteger(nextLotteryJackpotKey), 0)), IntegerEntry(nextLotteryJackpotKey, 0)] | |
314 | 326 | else nil | |
315 | 327 | $Tuple2(([DeleteEntry(finishKey), DeleteEntry(guessKey), DeleteEntry(saltKey)] ++ winActions), rand) | |
316 | 328 | } | |
320 | 332 | ||
321 | 333 | @Callable(i) | |
322 | 334 | func statsREADONLY (userAddrOpt) = { | |
323 | - | let $ | |
324 | - | let userAmount = $ | |
325 | - | let amountLeftTotal = $ | |
335 | + | let $t01310313161 = gorcStats(userAddrOpt) | |
336 | + | let userAmount = $t01310313161._1 | |
337 | + | let amountLeftTotal = $t01310313161._2 | |
326 | 338 | let currFomoJackpot = valueOrElse(getInteger(currFomoJackpotKey), 0) | |
327 | 339 | let nextFomoJackpot = valueOrElse(getInteger(nextFomoJackpotKey), 0) | |
328 | 340 | let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let M16 = 10000000000000000 | |
5 | 5 | ||
6 | 6 | let STAKERS_AMOUNT = 3000000000000000 | |
7 | 7 | ||
8 | 8 | let TEAM_AMOUNT = 1000000000000000 | |
9 | 9 | ||
10 | 10 | let MARKET_AMOUNT = 6000000000000000 | |
11 | 11 | ||
12 | 12 | let YEAR_BLOCKS = (365 * 1440) | |
13 | 13 | ||
14 | 14 | let STAKE_PERIOD = (5 * YEAR_BLOCKS) | |
15 | 15 | ||
16 | 16 | let BLESS_PRICE = 100000000000 | |
17 | 17 | ||
18 | 18 | let LOTTERY_PRICE = 100000000000 | |
19 | 19 | ||
20 | 20 | let FOMO_PERIOD = 60 | |
21 | 21 | ||
22 | 22 | let RANDOM_DELAY = 2 | |
23 | 23 | ||
24 | 24 | let CURRENT_JACKPOT_PERC = 50 | |
25 | 25 | ||
26 | 26 | let NEXT_JACKPOT_PERC = 20 | |
27 | 27 | ||
28 | 28 | let STAKERS_PERC = 20 | |
29 | 29 | ||
30 | 30 | let TEAM_PERC = 10 | |
31 | 31 | ||
32 | 32 | let gorcAssetIdKey = "gorcAssetId" | |
33 | 33 | ||
34 | 34 | let gorcAssetId = valueOrErrorMessage(getBinary(gorcAssetIdKey), "GORC is not issued yet") | |
35 | 35 | ||
36 | 36 | let issueTimeKey = "issueTime" | |
37 | 37 | ||
38 | 38 | let stakersAmountTotalKey = "stakersAmountTotal" | |
39 | 39 | ||
40 | 40 | let stakersAmountLeftKey = "stakersAmountLeft" | |
41 | 41 | ||
42 | 42 | let stakedAmountTotalKey = "stakedTotal" | |
43 | 43 | ||
44 | 44 | func stakedAmountByUserKey (addr) = ("stakedAmount_" + addr) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func lastClaimTimeByUserKey (addr) = ("lastClaimTime_" + addr) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | let lastFomoTimeKey = "lastFomoTime" | |
51 | 51 | ||
52 | 52 | let currFomoJackpotKey = "currFomoJackpot" | |
53 | 53 | ||
54 | 54 | let nextFomoJackpotKey = "nextFomoJackpot" | |
55 | 55 | ||
56 | 56 | let lastFomoPlayerKey = "lastFomoPlayer" | |
57 | 57 | ||
58 | + | let lastFomoWinnerKey = "lastFomoWinner" | |
59 | + | ||
60 | + | let lastFomoWinnerAmountKey = "lastFomoWinnerAmount" | |
61 | + | ||
62 | + | let lastFomoWinnerTimeKey = "lastFomoWinnerTime" | |
63 | + | ||
58 | 64 | let teamWalletAddrKey = "teamWalletAddr" | |
59 | 65 | ||
60 | 66 | let brokerAddrKey = "brokerAddr" | |
61 | 67 | ||
62 | 68 | func keyCommit (address) = ("finishBlockFor_" + address) | |
63 | 69 | ||
64 | 70 | ||
65 | 71 | func keyGuess (address) = ("guessFor_" + address) | |
66 | 72 | ||
67 | 73 | ||
68 | 74 | func keySalt (address) = ("saltFor_" + address) | |
69 | 75 | ||
70 | 76 | ||
71 | 77 | let currLotteryJackpotKey = "currLotteryJackpot" | |
72 | 78 | ||
73 | 79 | let nextLotteryJackpotKey = "nextLotteryJackpot" | |
80 | + | ||
81 | + | let lastLotteryWinnerKey = "lastLotteryWinner" | |
82 | + | ||
83 | + | let lastLotteryWinnerAmountKey = "lastLotteryWinnerAmount" | |
84 | + | ||
85 | + | let lastLotteryWinnerTimeKey = "lastLotteryWinnerTime" | |
74 | 86 | ||
75 | 87 | func gorcStats (userAddrOpt) = { | |
76 | 88 | let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0) | |
77 | 89 | let lastUserTime = valueOrElse(getInteger(lastClaimTimeByUserKey(userAddrOpt)), -1) | |
78 | 90 | if ((0 > lastUserTime)) | |
79 | 91 | then $Tuple2(0, amountLeftTotal) | |
80 | 92 | else { | |
81 | 93 | let issueTime = valueOrErrorMessage(getInteger(issueTimeKey), "GORC is not issued yet") | |
82 | 94 | let nowLimited = min([height, (issueTime + STAKE_PERIOD)]) | |
83 | 95 | let userShares = valueOrElse(getInteger(stakedAmountByUserKey(userAddrOpt)), 0) | |
84 | 96 | let totalShares = valueOrElse(getInteger(stakedAmountTotalKey), 0) | |
85 | 97 | let stakersAmountTotal = valueOrElse(getInteger(stakersAmountTotalKey), STAKERS_AMOUNT) | |
86 | 98 | let userTemporal = fraction(stakersAmountTotal, (nowLimited - lastUserTime), STAKE_PERIOD) | |
87 | 99 | let userAmount = if ((totalShares != 0)) | |
88 | 100 | then fraction(userTemporal, userShares, totalShares) | |
89 | 101 | else 0 | |
90 | 102 | $Tuple2(userAmount, (amountLeftTotal - userAmount)) | |
91 | 103 | } | |
92 | 104 | } | |
93 | 105 | ||
94 | 106 | ||
95 | 107 | func fixedPoint (val,decimals) = { | |
96 | 108 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
97 | 109 | let lowPart = toString((val % tenPow)) | |
98 | 110 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
99 | 111 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
100 | 112 | } | |
101 | 113 | ||
102 | 114 | ||
103 | 115 | func fomoInternal (i) = if ((size(i.payments) != 1)) | |
104 | 116 | then throw("exactly 1 payment must be attached") | |
105 | 117 | else { | |
106 | 118 | let pmt = i.payments[0] | |
107 | 119 | let amt = pmt.amount | |
108 | 120 | if (if (!(isDefined(pmt.assetId))) | |
109 | 121 | then true | |
110 | 122 | else (value(pmt.assetId) != gorcAssetId)) | |
111 | 123 | then throw("GORC payments only!") | |
112 | 124 | else { | |
113 | 125 | let change = (amt - BLESS_PRICE) | |
114 | 126 | if ((0 > change)) | |
115 | 127 | then throw(((("You need to sacrifice " + fixedPoint(BLESS_PRICE, 8)) + " GORC, but I see only ") + fixedPoint(amt, 8))) | |
116 | 128 | else { | |
117 | 129 | let changeActions = if ((change > 0)) | |
118 | 130 | then [ScriptTransfer(i.caller, change, gorcAssetId)] | |
119 | 131 | else nil | |
120 | 132 | let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0) | |
121 | 133 | let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "") | |
122 | 134 | let deltaCurrJackpot = fraction(BLESS_PRICE, CURRENT_JACKPOT_PERC, 100) | |
123 | 135 | let deltaNextJackpot = fraction(BLESS_PRICE, NEXT_JACKPOT_PERC, 100) | |
124 | 136 | let deltaTeamAmount = fraction(BLESS_PRICE, TEAM_PERC, 100) | |
125 | 137 | let deltaStakersAmount = (((BLESS_PRICE - deltaCurrJackpot) - deltaNextJackpot) - deltaTeamAmount) | |
126 | 138 | let fomoCurrJackpot = valueOrElse(getInteger(currFomoJackpotKey), 0) | |
127 | 139 | let fomoNextJackpot = valueOrElse(getInteger(nextFomoJackpotKey), 0) | |
128 | 140 | let fomoActions = if (if (if ((height > (lastFomoTime + FOMO_PERIOD))) | |
129 | 141 | then (fomoCurrJackpot > 0) | |
130 | 142 | else false) | |
131 | 143 | then (lastFomoPlayer != "") | |
132 | 144 | else false) | |
133 | - | then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), fomoCurrJackpot, gorcAssetId), IntegerEntry(currFomoJackpotKey, (fomoNextJackpot + deltaCurrJackpot)), IntegerEntry(nextFomoJackpotKey, deltaNextJackpot)] | |
145 | + | then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), fomoCurrJackpot, gorcAssetId), StringEntry(lastFomoWinnerKey, lastFomoPlayer), IntegerEntry(lastFomoWinnerAmountKey, fomoCurrJackpot), IntegerEntry(lastFomoWinnerTimeKey, lastBlock.timestamp), IntegerEntry(currFomoJackpotKey, (fomoNextJackpot + deltaCurrJackpot)), IntegerEntry(nextFomoJackpotKey, deltaNextJackpot)] | |
134 | 146 | else [IntegerEntry(currFomoJackpotKey, (fomoCurrJackpot + deltaCurrJackpot)), IntegerEntry(nextFomoJackpotKey, (fomoNextJackpot + deltaNextJackpot))] | |
135 | 147 | (([IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller)), ScriptTransfer(addressFromStringValue(getStringValue(teamWalletAddrKey)), deltaTeamAmount, gorcAssetId), IntegerEntry(stakersAmountLeftKey, (getIntegerValue(stakersAmountLeftKey) + deltaStakersAmount)), IntegerEntry(stakersAmountTotalKey, (getIntegerValue(stakersAmountTotalKey) + deltaStakersAmount))] ++ changeActions) ++ fomoActions) | |
136 | 148 | } | |
137 | 149 | } | |
138 | 150 | } | |
139 | 151 | ||
140 | 152 | ||
141 | 153 | func getRandomNumber (maxValue,salt,entropy) = if ((0 >= maxValue)) | |
142 | 154 | then throw("maxValue should be > 0") | |
143 | 155 | else { | |
144 | 156 | let randomHash = sha256_16Kb((salt + entropy)) | |
145 | 157 | (toInt(randomHash) % maxValue) | |
146 | 158 | } | |
147 | 159 | ||
148 | 160 | ||
149 | 161 | func walletInternal (userAddressOpt) = { | |
150 | 162 | let addr = addressFromString(userAddressOpt) | |
151 | 163 | let balance = if (isDefined(addr)) | |
152 | 164 | then wavesBalance(value(addr)) | |
153 | 165 | else BalanceDetails(0, 0, 0, 0) | |
154 | 166 | let gorcBalance = if (isDefined(addr)) | |
155 | 167 | then assetBalance(value(addr), gorcAssetId) | |
156 | 168 | else 0 | |
157 | 169 | let stakedGorc = valueOrElse(getInteger(stakedAmountByUserKey(userAddressOpt)), 0) | |
158 | 170 | [("%s%d__wavesBalance__" + toString(balance.available)), ("%s%d__gorcBalance__" + toString(gorcBalance)), ("%s%d__stakedGorc__" + toString(stakedGorc))] | |
159 | 171 | } | |
160 | 172 | ||
161 | 173 | ||
162 | 174 | @Callable(i) | |
163 | 175 | func testArgs (intVal,strVal,boolVal,binVal,arrInt,arrStr,arrBool,arrBin) = nil | |
164 | 176 | ||
165 | 177 | ||
166 | 178 | ||
167 | 179 | @Callable(i) | |
168 | 180 | func constructorV1 (teamWalletAddr,brokerAddr) = if ((i.caller != this)) | |
169 | 181 | then throw("Permission denied") | |
170 | 182 | else { | |
171 | 183 | let issuedAmount = M16 | |
172 | 184 | let issue = Issue("GORC", "Meme coin by God of Random Chance. Visit https://gorc.meme, sacrifice to the God of Random and you will receive an answer to any question or a blessing. Lucky one gets a Gift of God", issuedAmount, 8, false, unit, 0) | |
173 | 185 | let assetId = calculateAssetId(issue) | |
174 | 186 | [issue, BinaryEntry(gorcAssetIdKey, assetId), IntegerEntry(issueTimeKey, height), IntegerEntry(stakersAmountLeftKey, STAKERS_AMOUNT), IntegerEntry(stakersAmountTotalKey, STAKERS_AMOUNT), StringEntry(teamWalletAddrKey, teamWalletAddr), StringEntry(brokerAddrKey, brokerAddr), ScriptTransfer(addressFromStringValue(teamWalletAddr), TEAM_AMOUNT, assetId), ScriptTransfer(addressFromStringValue(brokerAddr), MARKET_AMOUNT, assetId)] | |
175 | 187 | } | |
176 | 188 | ||
177 | 189 | ||
178 | 190 | ||
179 | 191 | @Callable(i) | |
180 | 192 | func stakeGorc () = if ((size(i.payments) != 1)) | |
181 | 193 | then throw("exactly 1 payment must be attached") | |
182 | 194 | else { | |
183 | 195 | let pmt = i.payments[0] | |
184 | 196 | let amt = pmt.amount | |
185 | 197 | if (if (!(isDefined(pmt.assetId))) | |
186 | 198 | then true | |
187 | 199 | else (value(pmt.assetId) != gorcAssetId)) | |
188 | 200 | then throw("GORC payments only!") | |
189 | 201 | else { | |
190 | 202 | let addr = toString(i.caller) | |
191 | - | let $ | |
192 | - | let userAmount = $ | |
193 | - | let amountLeftTotal = $ | |
203 | + | let $t074627513 = gorcStats(addr) | |
204 | + | let userAmount = $t074627513._1 | |
205 | + | let amountLeftTotal = $t074627513._2 | |
194 | 206 | let userAmountKey = stakedAmountByUserKey(addr) | |
195 | 207 | let claimActions = if ((userAmount > 0)) | |
196 | 208 | then [ScriptTransfer(i.caller, userAmount, gorcAssetId)] | |
197 | 209 | else nil | |
198 | 210 | $Tuple2((claimActions ++ [IntegerEntry(stakedAmountTotalKey, (valueOrElse(getInteger(stakedAmountTotalKey), 0) + amt)), IntegerEntry(userAmountKey, (valueOrElse(getInteger(userAmountKey), 0) + amt)), IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), userAmount) | |
199 | 211 | } | |
200 | 212 | } | |
201 | 213 | ||
202 | 214 | ||
203 | 215 | ||
204 | 216 | @Callable(i) | |
205 | 217 | func unstakeGorc (amount) = if ((0 >= amount)) | |
206 | 218 | then throw("Amount should be positive") | |
207 | 219 | else { | |
208 | 220 | let addr = toString(i.caller) | |
209 | 221 | if ((size(i.payments) != 0)) | |
210 | 222 | then throw("No payments required") | |
211 | 223 | else { | |
212 | 224 | let userAmountKey = stakedAmountByUserKey(addr) | |
213 | 225 | let oldAmount = valueOrElse(getInteger(userAmountKey), 0) | |
214 | 226 | if ((0 > (oldAmount - amount))) | |
215 | 227 | then throw(((("You have only " + fixedPoint(oldAmount, 8)) + " GORC staked, tried to unstake ") + fixedPoint(amount, 8))) | |
216 | 228 | else { | |
217 | - | let $ | |
218 | - | let userAmount = $ | |
219 | - | let amountLeftTotal = $ | |
229 | + | let $t084748525 = gorcStats(addr) | |
230 | + | let userAmount = $t084748525._1 | |
231 | + | let amountLeftTotal = $t084748525._2 | |
220 | 232 | let claimActions = if ((userAmount > 0)) | |
221 | 233 | then [ScriptTransfer(i.caller, userAmount, gorcAssetId)] | |
222 | 234 | else nil | |
223 | 235 | $Tuple2((claimActions ++ [IntegerEntry(stakedAmountTotalKey, (valueOrErrorMessage(getInteger(stakedAmountTotalKey), "No GORC staked") - amount)), IntegerEntry(userAmountKey, (oldAmount - amount)), IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), 0) | |
224 | 236 | } | |
225 | 237 | } | |
226 | 238 | } | |
227 | 239 | ||
228 | 240 | ||
229 | 241 | ||
230 | 242 | @Callable(i) | |
231 | 243 | func claimGorc () = if ((size(i.payments) != 0)) | |
232 | 244 | then throw("No payments required") | |
233 | 245 | else { | |
234 | 246 | let addr = toString(i.caller) | |
235 | - | let $ | |
236 | - | let userAmount = $ | |
237 | - | let amountLeftTotal = $ | |
247 | + | let $t090899140 = gorcStats(addr) | |
248 | + | let userAmount = $t090899140._1 | |
249 | + | let amountLeftTotal = $t090899140._2 | |
238 | 250 | let claimActions = if ((userAmount > 0)) | |
239 | 251 | then [ScriptTransfer(i.caller, userAmount, gorcAssetId)] | |
240 | 252 | else nil | |
241 | 253 | $Tuple2((claimActions ++ [IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), userAmount) | |
242 | 254 | } | |
243 | 255 | ||
244 | 256 | ||
245 | 257 | ||
246 | 258 | @Callable(i) | |
247 | 259 | func answerMe () = $Tuple2(fomoInternal(i), toInt(i.transactionId)) | |
248 | 260 | ||
249 | 261 | ||
250 | 262 | ||
251 | 263 | @Callable(i) | |
252 | 264 | func blessMe () = $Tuple2(fomoInternal(i), 42) | |
253 | 265 | ||
254 | 266 | ||
255 | 267 | ||
256 | 268 | @Callable(i) | |
257 | 269 | func commitGuess (guess) = { | |
258 | 270 | let addr = toString(i.caller) | |
259 | 271 | let finishKey = keyCommit(addr) | |
260 | 272 | let guessKey = keyGuess(addr) | |
261 | 273 | if (isDefined(getInteger(finishKey))) | |
262 | 274 | then throw("You already made a bet, please use it") | |
263 | 275 | else if (if ((0 > guess)) | |
264 | 276 | then true | |
265 | 277 | else (guess > 11)) | |
266 | 278 | then throw("The number should be between 0 and 11") | |
267 | 279 | else if ((size(i.payments) != 1)) | |
268 | 280 | then throw("exactly 1 payment must be attached") | |
269 | 281 | else { | |
270 | 282 | let pmt = i.payments[0] | |
271 | 283 | let amt = pmt.amount | |
272 | 284 | if (if (!(isDefined(pmt.assetId))) | |
273 | 285 | then true | |
274 | 286 | else (value(pmt.assetId) != gorcAssetId)) | |
275 | 287 | then throw("GORC payments only!") | |
276 | 288 | else { | |
277 | 289 | let change = (amt - LOTTERY_PRICE) | |
278 | 290 | if ((0 > change)) | |
279 | 291 | then throw(((("You need to sacrifice " + fixedPoint(LOTTERY_PRICE, 8)) + " GORC, but I see only ") + fixedPoint(amt, 8))) | |
280 | 292 | else { | |
281 | 293 | let changeActions = if ((change > 0)) | |
282 | 294 | then [ScriptTransfer(i.caller, change, gorcAssetId)] | |
283 | 295 | else nil | |
284 | 296 | let finishBlock = (height + RANDOM_DELAY) | |
285 | 297 | let deltaCurrJackpot = fraction(LOTTERY_PRICE, CURRENT_JACKPOT_PERC, 100) | |
286 | 298 | let deltaNextJackpot = fraction(LOTTERY_PRICE, NEXT_JACKPOT_PERC, 100) | |
287 | 299 | let deltaTeamAmount = fraction(LOTTERY_PRICE, TEAM_PERC, 100) | |
288 | 300 | let deltaStakersAmount = (((LOTTERY_PRICE - deltaCurrJackpot) - deltaNextJackpot) - deltaTeamAmount) | |
289 | 301 | $Tuple2(([IntegerEntry(finishKey, finishBlock), IntegerEntry(guessKey, guess), IntegerEntry(currLotteryJackpotKey, (valueOrElse(getInteger(currLotteryJackpotKey), 0) + deltaCurrJackpot)), IntegerEntry(nextLotteryJackpotKey, (valueOrElse(getInteger(nextLotteryJackpotKey), 0) + deltaNextJackpot)), ScriptTransfer(addressFromStringValue(getStringValue(teamWalletAddrKey)), deltaTeamAmount, gorcAssetId), IntegerEntry(stakersAmountLeftKey, (getIntegerValue(stakersAmountLeftKey) + deltaStakersAmount)), IntegerEntry(stakersAmountTotalKey, (getIntegerValue(stakersAmountTotalKey) + deltaStakersAmount)), StringEntry(keySalt(addr), toBase58String(i.transactionId))] ++ changeActions), finishBlock) | |
290 | 302 | } | |
291 | 303 | } | |
292 | 304 | } | |
293 | 305 | } | |
294 | 306 | ||
295 | 307 | ||
296 | 308 | ||
297 | 309 | @Callable(i) | |
298 | 310 | func guessLottery () = { | |
299 | 311 | let addr = toString(i.caller) | |
300 | 312 | let finishKey = keyCommit(addr) | |
301 | 313 | let guessKey = keyGuess(addr) | |
302 | 314 | let guess = valueOrErrorMessage(getInteger(guessKey), "You have not made a bet") | |
303 | 315 | let finishBlock = valueOrErrorMessage(getInteger(finishKey), "You have not made a bet") | |
304 | 316 | if ((finishBlock > height)) | |
305 | 317 | then throw(("Random number is not ready yet, wait until height = " + toString(finishBlock))) | |
306 | 318 | else { | |
307 | 319 | let entropy = value(value(blockInfoByHeight(finishBlock)).vrf) | |
308 | 320 | let saltKey = keySalt(addr) | |
309 | 321 | let salt = fromBase58String(valueOrElse(getString(saltKey), "DEFAULT")) | |
310 | 322 | let rand = getRandomNumber(12, salt, entropy) | |
311 | 323 | let currJackpot = valueOrElse(getInteger(currLotteryJackpotKey), 0) | |
312 | 324 | let winActions = if ((rand == guess)) | |
313 | - | then [ScriptTransfer(i.caller, currJackpot, gorcAssetId), IntegerEntry(currLotteryJackpotKey, valueOrElse(getInteger(nextLotteryJackpotKey), 0)), IntegerEntry(nextLotteryJackpotKey, 0)] | |
325 | + | then [ScriptTransfer(i.caller, currJackpot, gorcAssetId), StringEntry(lastLotteryWinnerKey, addr), IntegerEntry(lastLotteryWinnerAmountKey, currJackpot), IntegerEntry(lastLotteryWinnerTimeKey, lastBlock.timestamp), IntegerEntry(currLotteryJackpotKey, valueOrElse(getInteger(nextLotteryJackpotKey), 0)), IntegerEntry(nextLotteryJackpotKey, 0)] | |
314 | 326 | else nil | |
315 | 327 | $Tuple2(([DeleteEntry(finishKey), DeleteEntry(guessKey), DeleteEntry(saltKey)] ++ winActions), rand) | |
316 | 328 | } | |
317 | 329 | } | |
318 | 330 | ||
319 | 331 | ||
320 | 332 | ||
321 | 333 | @Callable(i) | |
322 | 334 | func statsREADONLY (userAddrOpt) = { | |
323 | - | let $ | |
324 | - | let userAmount = $ | |
325 | - | let amountLeftTotal = $ | |
335 | + | let $t01310313161 = gorcStats(userAddrOpt) | |
336 | + | let userAmount = $t01310313161._1 | |
337 | + | let amountLeftTotal = $t01310313161._2 | |
326 | 338 | let currFomoJackpot = valueOrElse(getInteger(currFomoJackpotKey), 0) | |
327 | 339 | let nextFomoJackpot = valueOrElse(getInteger(nextFomoJackpotKey), 0) | |
328 | 340 | let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0) | |
329 | 341 | let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "") | |
330 | 342 | let currLotteryJackpot = valueOrElse(getInteger(currLotteryJackpotKey), 0) | |
331 | 343 | let nextLotteryJackpot = valueOrElse(getInteger(nextLotteryJackpotKey), 0) | |
332 | 344 | let finishKey = keyCommit(userAddrOpt) | |
333 | 345 | let guessKey = keyGuess(userAddrOpt) | |
334 | 346 | let guess = valueOrElse(getInteger(guessKey), -1) | |
335 | 347 | let finishBlock = valueOrElse(getInteger(finishKey), -1) | |
336 | 348 | $Tuple2(nil, [("%s%d__gorcAvailToClaim__" + toString(userAmount)), ("%s%d__currFomoJackpotAmount__" + toString(currFomoJackpot)), ("%s%d__nextFomoJackpotAmount__" + toString(nextFomoJackpot)), ("%s%d__currLotteryJackpotAmount__" + toString(currLotteryJackpot)), ("%s%d__nextLotteryJackpotAmount__" + toString(nextLotteryJackpot)), ("%s%d__lastFomoTime__" + toString(lastFomoTime)), ("%s%s__lastFomoPlayer__" + lastFomoPlayer), ("%s%d__amountLeftTotal__" + toString(amountLeftTotal)), ("%s%d__finishBlock__" + toString(finishBlock)), ("%s%d__guess__" + toString(guess))]) | |
337 | 349 | } | |
338 | 350 | ||
339 | 351 | ||
340 | 352 | ||
341 | 353 | @Callable(i) | |
342 | 354 | func walletInfoREADONLY (userAddressOpt) = $Tuple2(nil, walletInternal(userAddressOpt)) | |
343 | 355 | ||
344 | 356 |
github/deemru/w8io/169f3d6 66.30 ms ◑