tx · 9JS3dratRqWYXYu5GHpKL1TrT3qzZQBaqioWBgfUaxp5

3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z:  -0.01000000 Waves

2024.12.31 05:40 [3438094] smart account 3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z > SELF 0.00000000 Waves

{ "type": 13, "id": "9JS3dratRqWYXYu5GHpKL1TrT3qzZQBaqioWBgfUaxp5", "fee": 1000000, "feeAssetId": null, "timestamp": 1735612899519, "version": 2, "chainId": 84, "sender": "3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z", "senderPublicKey": "5CoDbXxoqnvJpx9GrS6M4G5GYJXh9rcoiXJz7RYTPVkL", "proofs": [ "2ruM6eSaBv3PShcGJ53rwJM2SdpE4ndPv7oZ6shv3wCRibaGm3tk4VinWf8rVSonqGa9oraoNrLoZj8mWQfKemXZ" ], "script": "base64:BgImCAISCgoIAQgEAhEYFBISBAoCCAgSABIDCgEBEgASABIAEgMKAQgXAANNMTYAgICE/qbe4READlNUQUtFUlNfQU1PVU5UAICAmqbqr+MBAAtURUFNX0FNT1VOVACAgJqm6q/jAQANTUFSS0VUX0FNT1VOVACAgNCx0v6aDgALWUVBUl9CTE9DS1MJAGgCAO0CAKALAAxTVEFLRV9QRVJJT0QJAGgCAAUFC1lFQVJfQkxPQ0tTAAtCTEVTU19QUklDRQCA0NvD9AIAC0ZPTU9fUEVSSU9EADwADmdvcmNBc3NldElkS2V5Agtnb3JjQXNzZXRJZAALZ29yY0Fzc2V0SWQJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAoQgBBQ5nb3JjQXNzZXRJZEtleQIWR09SQyBpcyBub3QgaXNzdWVkIHlldAAMaXNzdWVUaW1lS2V5Aglpc3N1ZVRpbWUAFHN0YWtlcnNBbW91bnRMZWZ0S2V5AhFzdGFrZXJzQW1vdW50TGVmdAAUc3Rha2VkQW1vdW50VG90YWxLZXkCC3N0YWtlZFRvdGFsARVzdGFrZWRBbW91bnRCeVV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c2UCCQCfCAEFEWN1cnJlbnRKYWNrcG90S2V5AAAEDGxhc3RGb21vVGltZQkBC3ZhbHVlT3JFbHNlAgkAnwgBBQ9sYXN0Rm9tb1RpbWVLZXkAAAQObGFzdEZvbW9QbGF5ZXIJAQt2YWx1ZU9yRWxzZQIJAKIIAQURbGFzdEZvbW9QbGF5ZXJLZXkCAAkAlAoCBQNuaWwJAMwIAgkArAICAhglcyVkX19nb3JjQXZhaWxUb0NsYWltX18JAKQDAQUKdXNlckFtb3VudAkAzAgCCQCsAgICFSVzJWRfX2phY2twb3RBbW91bnRfXwkApAMBBQ1qYWNrcG90QW1vdW50CQDMCAIJAKwCAgIUJXMlZF9fbGFzdEZvbW9UaW1lX18JAKQDAQUMbGFzdEZvbW9UaW1lCQDMCAIJAKwCAgIWJXMlc19fbGFzdEZvbW9QbGF5ZXJfXwUObGFzdEZvbW9QbGF5ZXIJAMwIAgkArAICAhclcyVkX19hbW91bnRMZWZ0VG90YWxfXwkApAMBBQ9hbW91bnRMZWZ0VG90YWwFA25pbABrjq1W", "height": 3438094, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AmxgdiqTBFbeeWbRqAzCtMKSk4Q6XAiZQuUCQj2CZcKs Next: 6ozQ3mkGfpZQNF9Jy1XBNJVvR2c33mQKVpvSyFMXm2uq Diff:
OldNewDifferences
9595 else false)
9696 then (lastFomoPlayer != "")
9797 else false)
98- then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), jackpotAmount, gorcAssetId)]
99- else nil
100- (([IntegerEntry(currentJackpotKey, BLESS_PRICE), IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller))] ++ changeActions) ++ fomoActions)
98+ then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), jackpotAmount, gorcAssetId), IntegerEntry(currentJackpotKey, BLESS_PRICE)]
99+ else [IntegerEntry(currentJackpotKey, (jackpotAmount + BLESS_PRICE))]
100+ (([IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller))] ++ changeActions) ++ fomoActions)
101101 }
102102 }
103103 }
132132 then throw("GORC payments only!")
133133 else {
134134 let addr = toString(i.caller)
135- let $t053555406 = gorcStats(addr)
136- let userAmount = $t053555406._1
137- let amountLeftTotal = $t053555406._2
135+ let $t054215472 = gorcStats(addr)
136+ let userAmount = $t054215472._1
137+ let amountLeftTotal = $t054215472._2
138138 let userAmountKey = stakedAmountByUserKey(addr)
139139 let claimActions = if ((userAmount > 0))
140140 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
158158 if ((0 > (oldAmount - amount)))
159159 then throw(((("You have only " + fixedPoint(oldAmount, 8)) + " GORC staked, tried to unstake ") + fixedPoint(amount, 8)))
160160 else {
161- let $t063676418 = gorcStats(addr)
162- let userAmount = $t063676418._1
163- let amountLeftTotal = $t063676418._2
161+ let $t064336484 = gorcStats(addr)
162+ let userAmount = $t064336484._1
163+ let amountLeftTotal = $t064336484._2
164164 let claimActions = if ((userAmount > 0))
165165 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
166166 else nil
176176 then throw("No payments required")
177177 else {
178178 let addr = toString(i.caller)
179- let $t069827033 = gorcStats(addr)
180- let userAmount = $t069827033._1
181- let amountLeftTotal = $t069827033._2
179+ let $t070487099 = gorcStats(addr)
180+ let userAmount = $t070487099._1
181+ let amountLeftTotal = $t070487099._2
182182 let claimActions = if ((userAmount > 0))
183183 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
184184 else nil
199199
200200 @Callable(i)
201201 func statsREADONLY (userAddrOpt) = {
202- let $t074927550 = gorcStats(userAddrOpt)
203- let userAmount = $t074927550._1
204- let amountLeftTotal = $t074927550._2
202+ let $t075587616 = gorcStats(userAddrOpt)
203+ let userAmount = $t075587616._1
204+ let amountLeftTotal = $t075587616._2
205205 let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
206206 let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0)
207207 let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let M16 = 10000000000000000
55
66 let STAKERS_AMOUNT = 1000000000000000
77
88 let TEAM_AMOUNT = 1000000000000000
99
1010 let MARKET_AMOUNT = 8000000000000000
1111
1212 let YEAR_BLOCKS = (365 * 1440)
1313
1414 let STAKE_PERIOD = (5 * YEAR_BLOCKS)
1515
1616 let BLESS_PRICE = 100000000000
1717
1818 let FOMO_PERIOD = 60
1919
2020 let gorcAssetIdKey = "gorcAssetId"
2121
2222 let gorcAssetId = valueOrErrorMessage(getBinary(gorcAssetIdKey), "GORC is not issued yet")
2323
2424 let issueTimeKey = "issueTime"
2525
2626 let stakersAmountLeftKey = "stakersAmountLeft"
2727
2828 let stakedAmountTotalKey = "stakedTotal"
2929
3030 func stakedAmountByUserKey (addr) = ("stakedAmount_" + addr)
3131
3232
3333 func lastClaimTimeByUserKey (addr) = ("lastClaimTime_" + addr)
3434
3535
3636 let lastFomoTimeKey = "lastFomoTime"
3737
3838 let currentJackpotKey = "currentJackpot"
3939
4040 let lastFomoPlayerKey = "lastFomoPlayer"
4141
4242 let teamWalletAddrKey = "teamWalletAddr"
4343
4444 let brokerAddrKey = "brokerAddr"
4545
4646 func gorcStats (userAddrOpt) = {
4747 let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0)
4848 let lastUserTime = valueOrElse(getInteger(lastClaimTimeByUserKey(userAddrOpt)), -1)
4949 if ((0 > lastUserTime))
5050 then $Tuple2(0, amountLeftTotal)
5151 else {
5252 let issueTime = valueOrErrorMessage(getInteger(issueTimeKey), "GORC is not issued yet")
5353 let nowLimited = min([height, (issueTime + STAKE_PERIOD)])
5454 let userShares = valueOrElse(getInteger(stakedAmountByUserKey(userAddrOpt)), 0)
5555 let totalShares = valueOrElse(getInteger(stakedAmountTotalKey), 0)
5656 let userTemporal = fraction(STAKERS_AMOUNT, (nowLimited - lastUserTime), STAKE_PERIOD)
5757 let userAmount = if ((totalShares != 0))
5858 then fraction(userTemporal, userShares, totalShares)
5959 else 0
6060 $Tuple2(userAmount, (amountLeftTotal - userAmount))
6161 }
6262 }
6363
6464
6565 func fixedPoint (val,decimals) = {
6666 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
6767 let lowPart = toString((val % tenPow))
6868 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
6969 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
7070 }
7171
7272
7373 func fomoInternal (i) = if ((size(i.payments) != 1))
7474 then throw("exactly 1 payment must be attached")
7575 else {
7676 let pmt = i.payments[0]
7777 let amt = pmt.amount
7878 if (if (!(isDefined(pmt.assetId)))
7979 then true
8080 else (value(pmt.assetId) != gorcAssetId))
8181 then throw("GORC payments only!")
8282 else {
8383 let change = (amt - BLESS_PRICE)
8484 if ((0 > change))
8585 then throw(((("You need to sacrifice " + fixedPoint(BLESS_PRICE, 8)) + " GORC, but I see only ") + fixedPoint(amt, 8)))
8686 else {
8787 let changeActions = if ((change > 0))
8888 then [ScriptTransfer(i.caller, change, gorcAssetId)]
8989 else nil
9090 let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0)
9191 let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "")
9292 let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
9393 let fomoActions = if (if (if ((height > (lastFomoTime + FOMO_PERIOD)))
9494 then (jackpotAmount > 0)
9595 else false)
9696 then (lastFomoPlayer != "")
9797 else false)
98- then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), jackpotAmount, gorcAssetId)]
99- else nil
100- (([IntegerEntry(currentJackpotKey, BLESS_PRICE), IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller))] ++ changeActions) ++ fomoActions)
98+ then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), jackpotAmount, gorcAssetId), IntegerEntry(currentJackpotKey, BLESS_PRICE)]
99+ else [IntegerEntry(currentJackpotKey, (jackpotAmount + BLESS_PRICE))]
100+ (([IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller))] ++ changeActions) ++ fomoActions)
101101 }
102102 }
103103 }
104104
105105
106106 @Callable(i)
107107 func testArgs (intVal,strVal,boolVal,binVal,arrInt,arrStr,arrBool,arrBin) = nil
108108
109109
110110
111111 @Callable(i)
112112 func constructorV1 (teamWalletAddr,brokerAddr) = if ((i.caller != this))
113113 then throw("Permission denied")
114114 else {
115115 let issuedAmount = M16
116116 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)
117117 let assetId = calculateAssetId(issue)
118118 [issue, BinaryEntry(gorcAssetIdKey, assetId), IntegerEntry(issueTimeKey, height), IntegerEntry(stakersAmountLeftKey, STAKERS_AMOUNT), StringEntry(teamWalletAddrKey, teamWalletAddr), StringEntry(brokerAddrKey, brokerAddr), ScriptTransfer(addressFromStringValue(teamWalletAddr), TEAM_AMOUNT, assetId), ScriptTransfer(addressFromStringValue(brokerAddr), MARKET_AMOUNT, assetId)]
119119 }
120120
121121
122122
123123 @Callable(i)
124124 func stakeGorc () = if ((size(i.payments) != 1))
125125 then throw("exactly 1 payment must be attached")
126126 else {
127127 let pmt = i.payments[0]
128128 let amt = pmt.amount
129129 if (if (!(isDefined(pmt.assetId)))
130130 then true
131131 else (value(pmt.assetId) != gorcAssetId))
132132 then throw("GORC payments only!")
133133 else {
134134 let addr = toString(i.caller)
135- let $t053555406 = gorcStats(addr)
136- let userAmount = $t053555406._1
137- let amountLeftTotal = $t053555406._2
135+ let $t054215472 = gorcStats(addr)
136+ let userAmount = $t054215472._1
137+ let amountLeftTotal = $t054215472._2
138138 let userAmountKey = stakedAmountByUserKey(addr)
139139 let claimActions = if ((userAmount > 0))
140140 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
141141 else nil
142142 $Tuple2((claimActions ++ [IntegerEntry(stakedAmountTotalKey, (valueOrElse(getInteger(stakedAmountTotalKey), 0) + amt)), IntegerEntry(userAmountKey, (valueOrElse(getInteger(userAmountKey), 0) + amt)), IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), userAmount)
143143 }
144144 }
145145
146146
147147
148148 @Callable(i)
149149 func unstakeGorc (amount) = if ((0 >= amount))
150150 then throw("Amount should be positive")
151151 else {
152152 let addr = toString(i.caller)
153153 if ((size(i.payments) != 0))
154154 then throw("No payments required")
155155 else {
156156 let userAmountKey = stakedAmountByUserKey(addr)
157157 let oldAmount = valueOrElse(getInteger(userAmountKey), 0)
158158 if ((0 > (oldAmount - amount)))
159159 then throw(((("You have only " + fixedPoint(oldAmount, 8)) + " GORC staked, tried to unstake ") + fixedPoint(amount, 8)))
160160 else {
161- let $t063676418 = gorcStats(addr)
162- let userAmount = $t063676418._1
163- let amountLeftTotal = $t063676418._2
161+ let $t064336484 = gorcStats(addr)
162+ let userAmount = $t064336484._1
163+ let amountLeftTotal = $t064336484._2
164164 let claimActions = if ((userAmount > 0))
165165 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
166166 else nil
167167 $Tuple2((claimActions ++ [IntegerEntry(stakedAmountTotalKey, (valueOrErrorMessage(getInteger(stakedAmountTotalKey), "No GORC staked") - amount)), IntegerEntry(userAmountKey, (oldAmount - amount)), IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), 0)
168168 }
169169 }
170170 }
171171
172172
173173
174174 @Callable(i)
175175 func claimGorc () = if ((size(i.payments) != 0))
176176 then throw("No payments required")
177177 else {
178178 let addr = toString(i.caller)
179- let $t069827033 = gorcStats(addr)
180- let userAmount = $t069827033._1
181- let amountLeftTotal = $t069827033._2
179+ let $t070487099 = gorcStats(addr)
180+ let userAmount = $t070487099._1
181+ let amountLeftTotal = $t070487099._2
182182 let claimActions = if ((userAmount > 0))
183183 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
184184 else nil
185185 $Tuple2((claimActions ++ [IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), userAmount)
186186 }
187187
188188
189189
190190 @Callable(i)
191191 func answerMe () = $Tuple2(fomoInternal(i), toInt(i.transactionId))
192192
193193
194194
195195 @Callable(i)
196196 func blessMe () = $Tuple2(fomoInternal(i), 42)
197197
198198
199199
200200 @Callable(i)
201201 func statsREADONLY (userAddrOpt) = {
202- let $t074927550 = gorcStats(userAddrOpt)
203- let userAmount = $t074927550._1
204- let amountLeftTotal = $t074927550._2
202+ let $t075587616 = gorcStats(userAddrOpt)
203+ let userAmount = $t075587616._1
204+ let amountLeftTotal = $t075587616._2
205205 let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
206206 let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0)
207207 let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "")
208208 $Tuple2(nil, [("%s%d__gorcAvailToClaim__" + toString(userAmount)), ("%s%d__jackpotAmount__" + toString(jackpotAmount)), ("%s%d__lastFomoTime__" + toString(lastFomoTime)), ("%s%s__lastFomoPlayer__" + lastFomoPlayer), ("%s%d__amountLeftTotal__" + toString(amountLeftTotal))])
209209 }
210210
211211

github/deemru/w8io/169f3d6 
35.56 ms