tx · 6HkiJZhvmR393T8YxBmF85gjSsyRMGhGGpe1W1C2nAgF 3MyrsoUShtK8LVWE6mGVinCdwiJeedCtkvr: -0.01000000 Waves 2023.11.27 13:33 [2861687] smart account 3MyrsoUShtK8LVWE6mGVinCdwiJeedCtkvr > SELF 0.00000000 Waves
{ "type": 13, "id": "6HkiJZhvmR393T8YxBmF85gjSsyRMGhGGpe1W1C2nAgF", "fee": 1000000, "feeAssetId": null, "timestamp": 1701081238896, "version": 1, "sender": "3MyrsoUShtK8LVWE6mGVinCdwiJeedCtkvr", "senderPublicKey": "53WfUfPHKFYj846Npe6Bu5indsxPueAsu9YWe8fnprXh", "proofs": [ "3YjjjgLG8Wo2w9aA9gFbxe7DpWSvRuVyyTqtt3mzrRQBFFSnDjG3USBQrir33kFedZCzQcCvBxQT7DZDdMPyWzKb" ], "script": "base64:BgIaCAISBgoECAgBCBIDCgEEEgMKAQgSBAoCCAJBAANTRVACAl9fAAdXQVZFU0lEAQQTq9kzAAZXQVZFU0QAgMLXLwAJR0FNRV9OQU1FAg9DYXJkIG9mIHRoZSBEYXkADFJBTkRPTV9SQU5HRQAoAAhOVU1fQkVUUwABAQxnZXRTdHJPckZhaWwCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUHYWRkcmVzcwUDa2V5CQC5CQIJAMwIAgIKbWFuZGF0b3J5IAkAzAgCCQClCAEFB2FkZHJlc3MJAMwIAgIBLgkAzAgCBQNrZXkJAMwIAgIPIGlzIG5vdCBkZWZpbmVkBQNuaWwCAAEMZ2V0SW50T3JGYWlsAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCaCAIFB2FkZHJlc3MFA2tleQkAuQkCCQDMCAICCm1hbmRhdG9yeSAJAMwIAgkApQgBBQdhZGRyZXNzCQDMCAICAS4JAMwIAgUDa2V5CQDMCAICDyBpcyBub3QgZGVmaW5lZAUDbmlsAgABDWdldEJvb2xPckZhaWwC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W5zYWN0aW9uBANzdHgFByRtYXRjaDAKAQdjaGVja2VyAgNhY2MFYXNzZXQDBQNhY2MJAAACCQEIZ2V0SW50T3ICCQEYa2V5UmVzZXJ2YXRpb25CeUFzc2V0U3RyAQUFYXNzZXQAAAAABwoAAiRsBQZBU1NFVFMKAAIkcwkAkAMBBQIkbAoABSRhY2MwBgoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQEHY2hlY2tlcgIFAiRhCQCRAwIFAiRsBQIkaQoBBSRmMF8yAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQACAQIUTGlzdCBzaXplIGV4Y2VlZHMgMTAJAQUkZjBfMgIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgcHN6gJbg==", "chainId": 84, "height": 2861687, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: DGsR1vDJrNaRA1WeRT65YhtvBeNefZrwUSMGXTQ1f4cU Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEP = "__" | |
5 | + | ||
6 | + | let WAVESID = base58'WAVES' | |
7 | + | ||
8 | + | let WAVESD = 100000000 | |
9 | + | ||
10 | + | let GAME_NAME = "Card of the Day" | |
11 | + | ||
12 | + | let RANDOM_RANGE = 40 | |
13 | + | ||
14 | + | let NUM_BETS = 1 | |
15 | + | ||
16 | + | func getStrOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
17 | + | ||
18 | + | ||
19 | + | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
20 | + | ||
21 | + | ||
22 | + | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
23 | + | ||
24 | + | ||
25 | + | let allowedAssetsKey = "%s%s__cfg__allowedAssets" | |
26 | + | ||
27 | + | let assetsDecimalsKey = "%s%s__cfg__assetsDecimals" | |
28 | + | ||
29 | + | let betDividersKey = "%s%s__cfg__assetsBetDividers" | |
30 | + | ||
31 | + | let RSAPUBLIC64KEY = "%s%s__cfg__rsaPublic64" | |
32 | + | ||
33 | + | let SERVERADDRESSKEY = "%s%s__cfg__benzAddress" | |
34 | + | ||
35 | + | let RANDTIMEFRAMEKEY = "%s%s__cfg__withdrawTimeFrame" | |
36 | + | ||
37 | + | let GAMESCOUNTERKEY = "%s%s__runtime__gameNum" | |
38 | + | ||
39 | + | let blockedKey = "%s%s__runtime__contractIsBlocked" | |
40 | + | ||
41 | + | func getIntArray (key) = { | |
42 | + | let a = getStrOrFail(this, key) | |
43 | + | func filler (acc,el) = (acc :+ parseIntValue(el)) | |
44 | + | ||
45 | + | let $l = split(a, SEP) | |
46 | + | let $s = size($l) | |
47 | + | let $acc0 = nil | |
48 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
49 | + | then $a | |
50 | + | else filler($a, $l[$i]) | |
51 | + | ||
52 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
53 | + | then $a | |
54 | + | else throw("List size exceeds 10") | |
55 | + | ||
56 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | let ASSETS = split(getStrOrFail(this, allowedAssetsKey), SEP) | |
61 | + | ||
62 | + | let DECIMALS = getIntArray(assetsDecimalsKey) | |
63 | + | ||
64 | + | let BETDIVIDERS = getIntArray(betDividersKey) | |
65 | + | ||
66 | + | func keyReservationByAssetStr (assetStr) = ("$RESERVED_AMOUNT_" + assetStr) | |
67 | + | ||
68 | + | ||
69 | + | func keyReservationByAssetIdx (assetIdx) = keyReservationByAssetStr(ASSETS[assetIdx]) | |
70 | + | ||
71 | + | ||
72 | + | let MINFEEWAVES = ((5 * WAVESD) / 1000) | |
73 | + | ||
74 | + | let idxAssets = 0 | |
75 | + | ||
76 | + | let idxDecimals = 1 | |
77 | + | ||
78 | + | let idxDividers = 2 | |
79 | + | ||
80 | + | let BET1 = 1 | |
81 | + | ||
82 | + | let BET2 = 2 | |
83 | + | ||
84 | + | let BET4 = 4 | |
85 | + | ||
86 | + | let BET8 = 8 | |
87 | + | ||
88 | + | let BET14 = 14 | |
89 | + | ||
90 | + | let RATEMULT = 10000 | |
91 | + | ||
92 | + | let RATE = 250000 | |
93 | + | ||
94 | + | let BETS = [BET2] | |
95 | + | ||
96 | + | let IdxGameState = 0 | |
97 | + | ||
98 | + | let IdxPlayerChoice = 1 | |
99 | + | ||
100 | + | let IdxPlayerPubKey58 = 2 | |
101 | + | ||
102 | + | let IdxStartedHeight = 3 | |
103 | + | ||
104 | + | let IdxWinAmount = 4 | |
105 | + | ||
106 | + | let IdxAssetId = 5 | |
107 | + | ||
108 | + | let STATESUBMITTED = "SUBMITTED" | |
109 | + | ||
110 | + | let STATEWON = "WON" | |
111 | + | ||
112 | + | let STATELOST = "LOST" | |
113 | + | ||
114 | + | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " key is not specified in this.state")) | |
115 | + | ||
116 | + | ||
117 | + | let RSAPUBLIC = fromBase64String(getStringOrFail(RSAPUBLIC64KEY)) | |
118 | + | ||
119 | + | let SERVER = addressFromStringValue(getStringOrFail(SERVERADDRESSKEY)) | |
120 | + | ||
121 | + | let RANDORACLETIMEFRAME = valueOrElse(getInteger(this, RANDTIMEFRAMEKEY), 7200) | |
122 | + | ||
123 | + | func getIntOr (key,default) = if (isDefined(getInteger(key))) | |
124 | + | then getIntegerValue(key) | |
125 | + | else default | |
126 | + | ||
127 | + | ||
128 | + | func setInt (key,value) = IntegerEntry(key, value) | |
129 | + | ||
130 | + | ||
131 | + | func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1)) | |
132 | + | ||
133 | + | ||
134 | + | func changeInt (key,by) = setInt(key, (getIntOr(key, 0) + by)) | |
135 | + | ||
136 | + | ||
137 | + | func assetIdToStr (assetIdOrUnit) = match assetIdOrUnit { | |
138 | + | case b: ByteVector => | |
139 | + | toBase58String(b) | |
140 | + | case _ => | |
141 | + | "WAVES" | |
142 | + | } | |
143 | + | ||
144 | + | ||
145 | + | func assetIdFromStr (assetIdStr) = if ((assetIdStr == "WAVES")) | |
146 | + | then unit | |
147 | + | else fromBase58String(assetIdStr) | |
148 | + | ||
149 | + | ||
150 | + | func getAssetBalance (assetIdOrUnit) = match assetIdOrUnit { | |
151 | + | case assetId: ByteVector => | |
152 | + | assetBalance(this, assetId) | |
153 | + | case _ => | |
154 | + | wavesBalance(this).available | |
155 | + | } | |
156 | + | ||
157 | + | ||
158 | + | func increaseReserveAmount (winAmount,assetIdx) = { | |
159 | + | let assetIdStr = ASSETS[assetIdx] | |
160 | + | let newReservedAmount = (getIntOr(keyReservationByAssetIdx(assetIdx), 0) + winAmount) | |
161 | + | if ((newReservedAmount > getAssetBalance(assetIdFromStr(assetIdStr)))) | |
162 | + | then throw((("Insufficient funds on " + GAME_NAME) + " account. Transaction was rejected for your safety.")) | |
163 | + | else newReservedAmount | |
164 | + | } | |
165 | + | ||
166 | + | ||
167 | + | func decreaseReservedAmount (gameId,assetIdx,winAmount) = if ((0 > (getIntOr(keyReservationByAssetIdx(assetIdx), 0) - winAmount))) | |
168 | + | then throw((("Invalid " + GAME_NAME) + " account state - reserved amount is less than 0")) | |
169 | + | else changeInt(keyReservationByAssetIdx(assetIdx), -(winAmount)) | |
170 | + | ||
171 | + | ||
172 | + | func validateAndGetAssetIdx (assetIdStr) = { | |
173 | + | let idx = indexOf(ASSETS, assetIdStr) | |
174 | + | if (!(isDefined(idx))) | |
175 | + | then throw("Invalid payment asset") | |
176 | + | else value(idx) | |
177 | + | } | |
178 | + | ||
179 | + | ||
180 | + | func validateBetAndGetWinAmount (bet,internalAssetIdx,playerChoice) = { | |
181 | + | let dicesCount = size(playerChoice) | |
182 | + | func checkAmount (a,x) = if (a) | |
183 | + | then true | |
184 | + | else (bet == ((x * DECIMALS[internalAssetIdx]) / BETDIVIDERS[internalAssetIdx])) | |
185 | + | ||
186 | + | if (!({ | |
187 | + | let $l = BETS | |
188 | + | let $s = size($l) | |
189 | + | let $acc0 = false | |
190 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
191 | + | then $a | |
192 | + | else checkAmount($a, $l[$i]) | |
193 | + | ||
194 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
195 | + | then $a | |
196 | + | else throw("List size exceeds 5") | |
197 | + | ||
198 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
199 | + | })) | |
200 | + | then throw("Bet amount is not valid") | |
201 | + | else if ((parseInt(playerChoice) == unit)) | |
202 | + | then throw("Invalid player's choice") | |
203 | + | else fraction(bet, RATE, RATEMULT) | |
204 | + | } | |
205 | + | ||
206 | + | ||
207 | + | func generateRandChoice (gameId,rsaSign,playerChoice) = { | |
208 | + | let rsaSigValid = rsaVerify_16Kb(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
209 | + | if (!(rsaSigValid)) | |
210 | + | then throw("Invalid RSA signature") | |
211 | + | else { | |
212 | + | let rand = (toInt(sha256((rsaSign + toBytes(playerChoice)))) % RANDOM_RANGE) | |
213 | + | toString(rand) | |
214 | + | } | |
215 | + | } | |
216 | + | ||
217 | + | ||
218 | + | func isPlayerWin (playerChoice,randChoise) = if ((size(playerChoice) == NUM_BETS)) | |
219 | + | then (randChoise == toString((RANDOM_RANGE - 1))) | |
220 | + | else false | |
221 | + | ||
222 | + | ||
223 | + | func formatGameDataS (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty) = makeString([gameStatus, playerChoice, playerPubKey58, startedHeight, winAmount, assetIdx, if ((randOrEmpty == "")) | |
224 | + | then "" | |
225 | + | else randOrEmpty], "_") | |
226 | + | ||
227 | + | ||
228 | + | func formatGameData (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty) = formatGameDataS(gameStatus, playerChoice, playerPubKey58, toString(startedHeight), toString(winAmount), toString(assetIdx), randOrEmpty) | |
229 | + | ||
230 | + | ||
231 | + | func finishGameData (origGameData,gameStatus,rand,winByTimeout) = { | |
232 | + | let finishGameData = formatGameDataS(gameStatus, origGameData[IdxPlayerChoice], origGameData[IdxPlayerPubKey58], origGameData[IdxStartedHeight], origGameData[IdxWinAmount], origGameData[IdxAssetId], rand) | |
233 | + | if (winByTimeout) | |
234 | + | then (finishGameData + "_TIMEOUT") | |
235 | + | else finishGameData | |
236 | + | } | |
237 | + | ||
238 | + | ||
239 | + | func extractGameData (gameId) = split(match getString(this, gameId) { | |
240 | + | case str: String => | |
241 | + | str | |
242 | + | case _ => | |
243 | + | throw((("Game: " + gameId) + " not found.")) | |
244 | + | }, "_") | |
245 | + | ||
246 | + | ||
247 | + | @Callable(i) | |
248 | + | func constructorV1 (rsaPublic64,benzAddress,randOracleTimeFrame,tokensDescriptor) = if ((i.caller != SERVER)) | |
249 | + | then throw("not authorized") | |
250 | + | else { | |
251 | + | func splitter (acc,elem) = { | |
252 | + | let tokList = split(elem, ":") | |
253 | + | if ((size(tokList) != 4)) | |
254 | + | then throw("Invalid asset record") | |
255 | + | else $Tuple3((acc._1 :+ tokList[idxAssets]), (acc._2 :+ tokList[idxDecimals]), (acc._3 :+ tokList[idxDividers])) | |
256 | + | } | |
257 | + | ||
258 | + | let r = { | |
259 | + | let $l = split_4C(tokensDescriptor, "_") | |
260 | + | let $s = size($l) | |
261 | + | let $acc0 = $Tuple3(nil, nil, nil) | |
262 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
263 | + | then $a | |
264 | + | else splitter($a, $l[$i]) | |
265 | + | ||
266 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
267 | + | then $a | |
268 | + | else throw("List size exceeds 10") | |
269 | + | ||
270 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
271 | + | } | |
272 | + | [StringEntry(RSAPUBLIC64KEY, rsaPublic64), StringEntry(SERVERADDRESSKEY, benzAddress), IntegerEntry(RANDTIMEFRAMEKEY, randOracleTimeFrame), StringEntry(allowedAssetsKey, makeString_2C(r._1, SEP)), StringEntry(assetsDecimalsKey, makeString(r._2, SEP)), StringEntry(betDividersKey, makeString(r._3, SEP))] | |
273 | + | } | |
274 | + | ||
275 | + | ||
276 | + | ||
277 | + | @Callable(i) | |
278 | + | func maintenance (blocked) = if ((i.caller != SERVER)) | |
279 | + | then throw("not authorized") | |
280 | + | else [BooleanEntry(blockedKey, blocked)] | |
281 | + | ||
282 | + | ||
283 | + | ||
284 | + | @Callable(i) | |
285 | + | func bet (playerChoice) = if (valueOrElse(getBoolean(blockedKey), false)) | |
286 | + | then throw("Game is stopped for maintenence") | |
287 | + | else { | |
288 | + | let gameId = toBase58String(i.transactionId) | |
289 | + | if ((1 >= size(i.payments))) | |
290 | + | then throw("2 payments must be attached") | |
291 | + | else if (isDefined(getString(this, gameId))) | |
292 | + | then throw((("Bet for: " + gameId) + " was already made.")) | |
293 | + | else { | |
294 | + | let betPmt = value(i.payments[0]) | |
295 | + | let feePmt = value(i.payments[1]) | |
296 | + | if (isDefined(feePmt.assetId)) | |
297 | + | then throw("feePmt (2nd payment) assetId must be in Waves") | |
298 | + | else if ((MINFEEWAVES > feePmt.amount)) | |
299 | + | then throw("feePmt (2nd payment) must be >= 0.005 Waves") | |
300 | + | else { | |
301 | + | let assetIdStr = assetIdToStr(betPmt.assetId) | |
302 | + | let internalAssetIdx = validateAndGetAssetIdx(assetIdStr) | |
303 | + | let commission = feePmt.amount | |
304 | + | let winAmount = validateBetAndGetWinAmount(betPmt.amount, internalAssetIdx, playerChoice) | |
305 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
306 | + | let gameData = formatGameData(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmount, internalAssetIdx, "") | |
307 | + | [IntegerEntry(keyReservationByAssetIdx(internalAssetIdx), increaseReserveAmount(winAmount, internalAssetIdx)), incrementInt(GAMESCOUNTERKEY), StringEntry(gameId, gameData), ScriptTransfer(SERVER, commission, feePmt.assetId)] | |
308 | + | } | |
309 | + | } | |
310 | + | } | |
311 | + | ||
312 | + | ||
313 | + | ||
314 | + | @Callable(i) | |
315 | + | func withdraw (gameId,rsaSign) = { | |
316 | + | let gameData = extractGameData(gameId) | |
317 | + | let gameState = gameData[IdxGameState] | |
318 | + | let playerChoice = gameData[IdxPlayerChoice] | |
319 | + | let startedHeight = parseIntValue(gameData[IdxStartedHeight]) | |
320 | + | let winAmount = parseIntValue(gameData[IdxWinAmount]) | |
321 | + | let assetIdx = parseIntValue(gameData[IdxAssetId]) | |
322 | + | let playerPubKey58 = gameData[IdxPlayerPubKey58] | |
323 | + | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
324 | + | if ((gameState != STATESUBMITTED)) | |
325 | + | then throw("Invalid game state for passed gameId") | |
326 | + | else if ((i.caller != SERVER)) | |
327 | + | then throw("Regular withdraw can be done by server only") | |
328 | + | else { | |
329 | + | let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME) | |
330 | + | let randChoise = if (winByTimeout) | |
331 | + | then playerChoice | |
332 | + | else generateRandChoice(gameId, rsaSign, playerChoice) | |
333 | + | let playerWin = isPlayerWin(playerChoice, randChoise) | |
334 | + | let newGameStatus = if (playerWin) | |
335 | + | then STATEWON | |
336 | + | else STATELOST | |
337 | + | let newGameData = finishGameData(gameData, newGameStatus, randChoise, winByTimeout) | |
338 | + | ([StringEntry(gameId, newGameData), decreaseReservedAmount(gameId, assetIdx, winAmount)] ++ (if (playerWin) | |
339 | + | then [ScriptTransfer(playerAddress, winAmount, assetIdFromStr(ASSETS[assetIdx]))] | |
340 | + | else nil)) | |
341 | + | } | |
342 | + | } | |
343 | + | ||
344 | + | ||
345 | + | @Verifier(tx) | |
346 | + | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
347 | + | then match tx { | |
348 | + | case ttx: TransferTransaction => | |
349 | + | let assetIdx = validateAndGetAssetIdx(assetIdToStr(ttx.assetId)) | |
350 | + | ((getAssetBalance(ttx.assetId) - ttx.amount) >= getIntOr(keyReservationByAssetIdx(assetIdx), 0)) | |
351 | + | case stx: SetScriptTransaction => | |
352 | + | func checker (acc,asset) = if (acc) | |
353 | + | then (getIntOr(keyReservationByAssetStr(asset), 0) == 0) | |
354 | + | else false | |
355 | + | ||
356 | + | let $l = ASSETS | |
357 | + | let $s = size($l) | |
358 | + | let $acc0 = true | |
359 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
360 | + | then $a | |
361 | + | else checker($a, $l[$i]) | |
362 | + | ||
363 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
364 | + | then $a | |
365 | + | else throw("List size exceeds 10") | |
366 | + | ||
367 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
368 | + | case _ => | |
369 | + | false | |
370 | + | } | |
371 | + | else false | |
372 | + |
github/deemru/w8io/026f985 88.32 ms ◑