tx · AmxgdiqTBFbeeWbRqAzCtMKSk4Q6XAiZQuUCQj2CZcKs

3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z:  -0.01000000 Waves

2024.12.31 05:35 [3438089] smart account 3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z > SELF 0.00000000 Waves

{ "type": 13, "id": "AmxgdiqTBFbeeWbRqAzCtMKSk4Q6XAiZQuUCQj2CZcKs", "fee": 1000000, "feeAssetId": null, "timestamp": 1735612509497, "version": 2, "chainId": 84, "sender": "3NCGjbgqZVk7eaqrLMEnEnqRhozNm1KTG5z", "senderPublicKey": "5CoDbXxoqnvJpx9GrS6M4G5GYJXh9rcoiXJz7RYTPVkL", "proofs": [ "45oYoF8bm2UrN99Z2ttYMHnqsciQjyfKKQKmZ8Ynf5sf7hgUGoFkvyKCXEc2TDfyLKKTzduE46cY3VjNa9ghUq3w" ], "script": "base64:BgImCAISCgoIAQgEAhEYFBISBAoCCAgSABIDCgEBEgASABIAEgMKAQgXAANNMTYAgICE/qbe4READlNUQUtFUlNfQU1PVU5UAICAmqbqr+MBAAtURUFNX0FNT1VOVACAgJqm6q/jAQANTUFSS0VUX0FNT1VOVACAgNCx0v6aDgALWUVBUl9CTE9DS1MJAGgCAO0CAKALAAxTVEFLRV9QRVJJT0QJAGgCAAUFC1lFQVJfQkxPQ0tTAAtCTEVTU19QUklDRQCA0NvD9AIAC0ZPTU9fUEVSSU9EADwADmdvcmNBc3NldElkS2V5Agtnb3JjQXNzZXRJZAALZ29yY0Fzc2V0SWQJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAoQgBBQ5nb3JjQXNzZXRJZEtleQIWR09SQyBpcyBub3QgaXNzdWVkIHlldAAMaXNzdWVUaW1lS2V5Aglpc3N1ZVRpbWUAFHN0YWtlcnNBbW91bnRMZWZ0S2V5AhFzdGFrZXJzQW1vdW50TGVmdAAUc3Rha2VkQW1vdW50VG90YWxLZXkCC3N0YWtlZFRvdGFsARVzdGFrZWRB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gBBQ9sYXN0Rm9tb1RpbWVLZXkAAAQObGFzdEZvbW9QbGF5ZXIJAQt2YWx1ZU9yRWxzZQIJAKIIAQURbGFzdEZvbW9QbGF5ZXJLZXkCAAkAlAoCBQNuaWwJAMwIAgkArAICAhglcyVkX19nb3JjQXZhaWxUb0NsYWltX18JAKQDAQUKdXNlckFtb3VudAkAzAgCCQCsAgICFSVzJWRfX2phY2twb3RBbW91bnRfXwkApAMBBQ1qYWNrcG90QW1vdW50CQDMCAIJAKwCAgIUJXMlZF9fbGFzdEZvbW9UaW1lX18JAKQDAQUMbGFzdEZvbW9UaW1lCQDMCAIJAKwCAgIWJXMlc19fbGFzdEZvbW9QbGF5ZXJfXwUObGFzdEZvbW9QbGF5ZXIJAMwIAgkArAICAhclcyVkX19hbW91bnRMZWZ0VG90YWxfXwkApAMBBQ9hbW91bnRMZWZ0VG90YWwFA25pbAAn9ru2", "height": 3438089, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DQt4xk4Jmmd4G5RqUeFENbHXh7xgRaazXXQ4AFQhFG1i Next: 9JS3dratRqWYXYu5GHpKL1TrT3qzZQBaqioWBgfUaxp5 Diff:
OldNewDifferences
3636 let lastFomoTimeKey = "lastFomoTime"
3737
3838 let currentJackpotKey = "currentJackpot"
39+
40+let lastFomoPlayerKey = "lastFomoPlayer"
3941
4042 let teamWalletAddrKey = "teamWalletAddr"
4143
8688 then [ScriptTransfer(i.caller, change, gorcAssetId)]
8789 else nil
8890 let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0)
89- let fomoActions = if ((height > (lastFomoTime + FOMO_PERIOD)))
90- then {
91- let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
92- if ((jackpotAmount > 0))
93- then [ScriptTransfer(i.caller, jackpotAmount, gorcAssetId)]
94- else nil
95- }
91+ let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "")
92+ let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
93+ let fomoActions = if (if (if ((height > (lastFomoTime + FOMO_PERIOD)))
94+ then (jackpotAmount > 0)
95+ else false)
96+ then (lastFomoPlayer != "")
97+ else false)
98+ then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), jackpotAmount, gorcAssetId)]
9699 else nil
97- (([IntegerEntry(currentJackpotKey, BLESS_PRICE), IntegerEntry(lastFomoTimeKey, height)] ++ changeActions) ++ fomoActions)
100+ (([IntegerEntry(currentJackpotKey, BLESS_PRICE), IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller))] ++ changeActions) ++ fomoActions)
98101 }
99102 }
100103 }
129132 then throw("GORC payments only!")
130133 else {
131134 let addr = toString(i.caller)
132- let $t051815232 = gorcStats(addr)
133- let userAmount = $t051815232._1
134- let amountLeftTotal = $t051815232._2
135+ let $t053555406 = gorcStats(addr)
136+ let userAmount = $t053555406._1
137+ let amountLeftTotal = $t053555406._2
135138 let userAmountKey = stakedAmountByUserKey(addr)
136139 let claimActions = if ((userAmount > 0))
137140 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
155158 if ((0 > (oldAmount - amount)))
156159 then throw(((("You have only " + fixedPoint(oldAmount, 8)) + " GORC staked, tried to unstake ") + fixedPoint(amount, 8)))
157160 else {
158- let $t061936244 = gorcStats(addr)
159- let userAmount = $t061936244._1
160- let amountLeftTotal = $t061936244._2
161+ let $t063676418 = gorcStats(addr)
162+ let userAmount = $t063676418._1
163+ let amountLeftTotal = $t063676418._2
161164 let claimActions = if ((userAmount > 0))
162165 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
163166 else nil
173176 then throw("No payments required")
174177 else {
175178 let addr = toString(i.caller)
176- let $t068086859 = gorcStats(addr)
177- let userAmount = $t068086859._1
178- let amountLeftTotal = $t068086859._2
179+ let $t069827033 = gorcStats(addr)
180+ let userAmount = $t069827033._1
181+ let amountLeftTotal = $t069827033._2
179182 let claimActions = if ((userAmount > 0))
180183 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
181184 else nil
196199
197200 @Callable(i)
198201 func statsREADONLY (userAddrOpt) = {
199- let $t073187376 = gorcStats(userAddrOpt)
200- let userAmount = $t073187376._1
201- let amountLeftTotal = $t073187376._2
202+ let $t074927550 = gorcStats(userAddrOpt)
203+ let userAmount = $t074927550._1
204+ let amountLeftTotal = $t074927550._2
202205 let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
203206 let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0)
204- $Tuple2(nil, [("%s%d__gorcAvailToClaim__" + toString(userAmount)), ("%s%d__jackpotAmount__" + toString(jackpotAmount)), ("%s%d__lastFomoTime__" + toString(lastFomoTime)), ("%s%d__amountLeftTotal__" + toString(amountLeftTotal))])
207+ let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "")
208+ $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))])
205209 }
206210
207211
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"
39+
40+let lastFomoPlayerKey = "lastFomoPlayer"
3941
4042 let teamWalletAddrKey = "teamWalletAddr"
4143
4244 let brokerAddrKey = "brokerAddr"
4345
4446 func gorcStats (userAddrOpt) = {
4547 let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0)
4648 let lastUserTime = valueOrElse(getInteger(lastClaimTimeByUserKey(userAddrOpt)), -1)
4749 if ((0 > lastUserTime))
4850 then $Tuple2(0, amountLeftTotal)
4951 else {
5052 let issueTime = valueOrErrorMessage(getInteger(issueTimeKey), "GORC is not issued yet")
5153 let nowLimited = min([height, (issueTime + STAKE_PERIOD)])
5254 let userShares = valueOrElse(getInteger(stakedAmountByUserKey(userAddrOpt)), 0)
5355 let totalShares = valueOrElse(getInteger(stakedAmountTotalKey), 0)
5456 let userTemporal = fraction(STAKERS_AMOUNT, (nowLimited - lastUserTime), STAKE_PERIOD)
5557 let userAmount = if ((totalShares != 0))
5658 then fraction(userTemporal, userShares, totalShares)
5759 else 0
5860 $Tuple2(userAmount, (amountLeftTotal - userAmount))
5961 }
6062 }
6163
6264
6365 func fixedPoint (val,decimals) = {
6466 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
6567 let lowPart = toString((val % tenPow))
6668 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
6769 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
6870 }
6971
7072
7173 func fomoInternal (i) = if ((size(i.payments) != 1))
7274 then throw("exactly 1 payment must be attached")
7375 else {
7476 let pmt = i.payments[0]
7577 let amt = pmt.amount
7678 if (if (!(isDefined(pmt.assetId)))
7779 then true
7880 else (value(pmt.assetId) != gorcAssetId))
7981 then throw("GORC payments only!")
8082 else {
8183 let change = (amt - BLESS_PRICE)
8284 if ((0 > change))
8385 then throw(((("You need to sacrifice " + fixedPoint(BLESS_PRICE, 8)) + " GORC, but I see only ") + fixedPoint(amt, 8)))
8486 else {
8587 let changeActions = if ((change > 0))
8688 then [ScriptTransfer(i.caller, change, gorcAssetId)]
8789 else nil
8890 let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0)
89- let fomoActions = if ((height > (lastFomoTime + FOMO_PERIOD)))
90- then {
91- let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
92- if ((jackpotAmount > 0))
93- then [ScriptTransfer(i.caller, jackpotAmount, gorcAssetId)]
94- else nil
95- }
91+ let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "")
92+ let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
93+ let fomoActions = if (if (if ((height > (lastFomoTime + FOMO_PERIOD)))
94+ then (jackpotAmount > 0)
95+ else false)
96+ then (lastFomoPlayer != "")
97+ else false)
98+ then [ScriptTransfer(addressFromStringValue(lastFomoPlayer), jackpotAmount, gorcAssetId)]
9699 else nil
97- (([IntegerEntry(currentJackpotKey, BLESS_PRICE), IntegerEntry(lastFomoTimeKey, height)] ++ changeActions) ++ fomoActions)
100+ (([IntegerEntry(currentJackpotKey, BLESS_PRICE), IntegerEntry(lastFomoTimeKey, height), StringEntry(lastFomoPlayerKey, toString(i.caller))] ++ changeActions) ++ fomoActions)
98101 }
99102 }
100103 }
101104
102105
103106 @Callable(i)
104107 func testArgs (intVal,strVal,boolVal,binVal,arrInt,arrStr,arrBool,arrBin) = nil
105108
106109
107110
108111 @Callable(i)
109112 func constructorV1 (teamWalletAddr,brokerAddr) = if ((i.caller != this))
110113 then throw("Permission denied")
111114 else {
112115 let issuedAmount = M16
113116 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)
114117 let assetId = calculateAssetId(issue)
115118 [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)]
116119 }
117120
118121
119122
120123 @Callable(i)
121124 func stakeGorc () = if ((size(i.payments) != 1))
122125 then throw("exactly 1 payment must be attached")
123126 else {
124127 let pmt = i.payments[0]
125128 let amt = pmt.amount
126129 if (if (!(isDefined(pmt.assetId)))
127130 then true
128131 else (value(pmt.assetId) != gorcAssetId))
129132 then throw("GORC payments only!")
130133 else {
131134 let addr = toString(i.caller)
132- let $t051815232 = gorcStats(addr)
133- let userAmount = $t051815232._1
134- let amountLeftTotal = $t051815232._2
135+ let $t053555406 = gorcStats(addr)
136+ let userAmount = $t053555406._1
137+ let amountLeftTotal = $t053555406._2
135138 let userAmountKey = stakedAmountByUserKey(addr)
136139 let claimActions = if ((userAmount > 0))
137140 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
138141 else nil
139142 $Tuple2((claimActions ++ [IntegerEntry(stakedAmountTotalKey, (valueOrElse(getInteger(stakedAmountTotalKey), 0) + amt)), IntegerEntry(userAmountKey, (valueOrElse(getInteger(userAmountKey), 0) + amt)), IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), userAmount)
140143 }
141144 }
142145
143146
144147
145148 @Callable(i)
146149 func unstakeGorc (amount) = if ((0 >= amount))
147150 then throw("Amount should be positive")
148151 else {
149152 let addr = toString(i.caller)
150153 if ((size(i.payments) != 0))
151154 then throw("No payments required")
152155 else {
153156 let userAmountKey = stakedAmountByUserKey(addr)
154157 let oldAmount = valueOrElse(getInteger(userAmountKey), 0)
155158 if ((0 > (oldAmount - amount)))
156159 then throw(((("You have only " + fixedPoint(oldAmount, 8)) + " GORC staked, tried to unstake ") + fixedPoint(amount, 8)))
157160 else {
158- let $t061936244 = gorcStats(addr)
159- let userAmount = $t061936244._1
160- let amountLeftTotal = $t061936244._2
161+ let $t063676418 = gorcStats(addr)
162+ let userAmount = $t063676418._1
163+ let amountLeftTotal = $t063676418._2
161164 let claimActions = if ((userAmount > 0))
162165 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
163166 else nil
164167 $Tuple2((claimActions ++ [IntegerEntry(stakedAmountTotalKey, (valueOrErrorMessage(getInteger(stakedAmountTotalKey), "No GORC staked") - amount)), IntegerEntry(userAmountKey, (oldAmount - amount)), IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), 0)
165168 }
166169 }
167170 }
168171
169172
170173
171174 @Callable(i)
172175 func claimGorc () = if ((size(i.payments) != 0))
173176 then throw("No payments required")
174177 else {
175178 let addr = toString(i.caller)
176- let $t068086859 = gorcStats(addr)
177- let userAmount = $t068086859._1
178- let amountLeftTotal = $t068086859._2
179+ let $t069827033 = gorcStats(addr)
180+ let userAmount = $t069827033._1
181+ let amountLeftTotal = $t069827033._2
179182 let claimActions = if ((userAmount > 0))
180183 then [ScriptTransfer(i.caller, userAmount, gorcAssetId)]
181184 else nil
182185 $Tuple2((claimActions ++ [IntegerEntry(lastClaimTimeByUserKey(addr), height), IntegerEntry(stakersAmountLeftKey, amountLeftTotal)]), userAmount)
183186 }
184187
185188
186189
187190 @Callable(i)
188191 func answerMe () = $Tuple2(fomoInternal(i), toInt(i.transactionId))
189192
190193
191194
192195 @Callable(i)
193196 func blessMe () = $Tuple2(fomoInternal(i), 42)
194197
195198
196199
197200 @Callable(i)
198201 func statsREADONLY (userAddrOpt) = {
199- let $t073187376 = gorcStats(userAddrOpt)
200- let userAmount = $t073187376._1
201- let amountLeftTotal = $t073187376._2
202+ let $t074927550 = gorcStats(userAddrOpt)
203+ let userAmount = $t074927550._1
204+ let amountLeftTotal = $t074927550._2
202205 let jackpotAmount = valueOrElse(getInteger(currentJackpotKey), 0)
203206 let lastFomoTime = valueOrElse(getInteger(lastFomoTimeKey), 0)
204- $Tuple2(nil, [("%s%d__gorcAvailToClaim__" + toString(userAmount)), ("%s%d__jackpotAmount__" + toString(jackpotAmount)), ("%s%d__lastFomoTime__" + toString(lastFomoTime)), ("%s%d__amountLeftTotal__" + toString(amountLeftTotal))])
207+ let lastFomoPlayer = valueOrElse(getString(lastFomoPlayerKey), "")
208+ $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))])
205209 }
206210
207211

github/deemru/w8io/169f3d6 
35.20 ms