tx · FAYupmaeWMfFJG7nJJyiYVAbkDpxmnKXbrtPbR7DG6nG 3N5q1m8whV3SztrPuN3z5sbKsEm3ZeSYF2T: -0.01600000 Waves 2024.06.07 14:45 [3140236] smart account 3N5q1m8whV3SztrPuN3z5sbKsEm3ZeSYF2T > SELF 0.00000000 Waves
{ "type": 13, "id": "FAYupmaeWMfFJG7nJJyiYVAbkDpxmnKXbrtPbR7DG6nG", "fee": 1600000, "feeAssetId": null, "timestamp": 1717760736516, "version": 2, "chainId": 84, "sender": "3N5q1m8whV3SztrPuN3z5sbKsEm3ZeSYF2T", "senderPublicKey": "BNpSmh5j4pzfsxKnEskdG2d4wxQZgbJwnFb5hC7NgrsA", "proofs": [ "3wbM39iivnWaQ1FC1mG3jvMQtP8stKmExe97PAXoxZsi8Vyv62xgT3exb1MtjpbHVuMo56wzWvcWwpnbkfMZTwwk" ], "script": "base64:AAIFAAAAAAAAADwIAhIDCgEIEgQKAggEEgcKBQgICAgIEgASBAoCCAESBAoCCAESBAoCCAESBAoCCAESCgoICAEBAQEBCAEAAAAZAAAAAAhhZG1pbm1zZwIAAAApRXJyb3I6IE9ubHkgYWRtaW4gY2FuIGNhbGwgdGhpcyBmdW5jdGlvbiEAAAAADmludmFsaWRBZGRyZXNzAgAAABdFcnJvcjogQWRkcmVzcyBpbnZhbGlkIQAAAAAPaW52YWxpZFRva2VuTXNnAgAAABVFcnJvcjogSW52YWxpZCBBc3NldCEAAAAADW1hdGNoTXNnRXJyb3ICAAAAakVycm9yOiBZb3UgYXJlIGFscmVhZHkgcGFydGljaXBhdGluZyBpbiBhIHJvb20uIFRyeSB0byBlbmQgaXQgb3IgbGVhdmUgdGhlIHJvb20gYnkgYWNjZXNzaW5nICdJbiBQcm9ncmVzcycAAAAACWJhbm5lZG1zZwIAAAA0RXJyb3I6IHRoZSB1c2VyIGhhcyBiZWVuIGJhbm5lZCBieSBhbiBhZG1pbmlzdHJhdG9yLgAAAAAGT3JhY2xlAgAAACMzTXh1ZFhOd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AABXwkBAAAACXRva2VuUm9vbQAAAAIFAAAAC2FkZHJlc3NSb29tBQAAAApoZWlnaHRSb29tCQAAZQAAAAIJAQAAAA9nZXRCYWxhbmNlVG9rZW4AAAACBQAAAAhhZGRyZXNzMgkBAAAACXRva2VuUm9vbQAAAAIFAAAAC2FkZHJlc3NSb29tBQAAAApoZWlnaHRSb29tBQAAAA1hZGRyZXNzMlZhbHVlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAIYWRkcmVzczMCAAAAAV8JAQAAAAl0b2tlblJvb20AAAACBQAAAAthZGRyZXNzUm9vbQUAAAAKaGVpZ2h0Um9vbQkAAGUAAAACCQEAAAAPZ2V0QmFsYW5jZVRva2VuAAAAAgUAAAAIYWRkcmVzczMJAQAAAAl0b2tlblJvb20AAAACBQAAAAthZGRyZXNzUm9vbQUAAAAKaGVpZ2h0Um9vbQUAAAANYWRkcmVzczNWYWx1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAACGFkZHJlc3M0AgAAAAFfCQEAAAAJdG9rZW5Sb29tAAAAAgUAAAALYWRkcmVzc1Jvb20FAAAACmhlaWdodFJvb20JAABlAAAAAgkBAAAAD2dldEJhbGFuY2VUb2tlbgAAAAIFAAAACGFkZHJlc3M0CQEAAAAJdG9rZW5Sb29tAAAAAgUAAAALYWRkcmVzc1Jvb20FAAAACmhlaWdodFJvb20FAAAADWFkZHJlc3M0VmFsdWUFAAAAA25pbAkAAAIAAAABBQAAAAhhZG1pbm1zZwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5O+9UmQ==", "height": 3140236, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DBHNdfuBXN9ekfFvyoKMKJisbZTiRMWAptjRp1aeq2V6 Next: DyyHzqa7WP8eUwpWTuWiH6taVB2WZVjoyfPwUjHKCqfU Diff:
Old | New | Differences | |
---|---|---|---|
86 | 86 | func isMatch (address) = { | |
87 | 87 | let c = toBase58String(address) | |
88 | 88 | if (isDefined(getBoolean((c + "_isMatch")))) | |
89 | - | then | |
89 | + | then getBooleanValue((c + "_isMatch")) | |
90 | 90 | else false | |
91 | 91 | } | |
92 | 92 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminmsg = "Error: Only admin can call this function!" | |
5 | 5 | ||
6 | 6 | let invalidAddress = "Error: Address invalid!" | |
7 | 7 | ||
8 | 8 | let invalidTokenMsg = "Error: Invalid Asset!" | |
9 | 9 | ||
10 | 10 | let matchMsgError = "Error: You are already participating in a room. Try to end it or leave the room by accessing 'In Progress'" | |
11 | 11 | ||
12 | 12 | let bannedmsg = "Error: the user has been banned by an administrator." | |
13 | 13 | ||
14 | 14 | let Oracle = "3MxudXNtrPExNtG9MsGV6e1kizuybgpiVq2" | |
15 | 15 | ||
16 | 16 | let roomExistError = "Error: You already have a previously created room. Go to 'In Progress' and close your room to create a new game." | |
17 | 17 | ||
18 | 18 | let balanceErrorMsg = "Error: You have no amount deposited as a chip in the poker module." | |
19 | 19 | ||
20 | 20 | let whithdrawError = "Error: Amount you want to withdraw greater than the amount available for withdrawal." | |
21 | 21 | ||
22 | 22 | let roomErrorNotExist = "Error:The room you want to join no longer exists." | |
23 | 23 | ||
24 | 24 | let errorGuest = "Error: You have not been invited to join this room." | |
25 | 25 | ||
26 | 26 | let errorMainGuest = "Error: You are the creator of the room." | |
27 | 27 | ||
28 | 28 | let errorCloseRoom = "Error: Only the room creator can close the room." | |
29 | 29 | ||
30 | 30 | func errorTokenInvalidAmount (assetId) = (("Error: You do not have enough chips in the poker module for asset " + assetId) + ". Go to 'Select Token', select the token you are using and click 'Deposit'.") | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func isValidToken (tokenId) = if ((tokenId == "WAVES")) | |
34 | 34 | then true | |
35 | 35 | else isDefined(getBoolean(Address(fromBase58String(Oracle)), tokenId)) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func convertToken (tokenId) = if ((tokenId == "WAVES")) | |
39 | 39 | then unit | |
40 | 40 | else fromBase58String(tokenId) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func isValidAddress (address) = (addressFromString(address) != unit) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func isGuest (address,Room,heightRoom) = { | |
47 | 47 | let address1 = getStringValue(((("address1_" + Room) + "_") + toString(heightRoom))) | |
48 | 48 | let address2 = getStringValue(((("address2_" + Room) + "_") + toString(heightRoom))) | |
49 | 49 | let address3 = getStringValue(((("address3_" + Room) + "_") + toString(heightRoom))) | |
50 | 50 | let address4 = getStringValue(((("address4_" + Room) + "_") + toString(heightRoom))) | |
51 | 51 | if (if (if ((address == address1)) | |
52 | 52 | then true | |
53 | 53 | else (address == address2)) | |
54 | 54 | then true | |
55 | 55 | else (address == address3)) | |
56 | 56 | then true | |
57 | 57 | else (address == address4) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getBalanceToken (address,tokenId) = if (isDefined(getInteger(((address + "_") + tokenId)))) | |
62 | 62 | then getIntegerValue(((address + "_") + tokenId)) | |
63 | 63 | else 0 | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func tokenRoom (address,heightRoom) = getStringValue((((address + "_height_") + toString(heightRoom)) + "_token")) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func isSufficientBalance (address,tokenId) = (getBalanceToken(address, tokenId) > 0) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func isAdmin (address) = { | |
73 | 73 | let c = toBase58String(address) | |
74 | 74 | if (isDefined(getString("admin"))) | |
75 | 75 | then if (if ((c == getStringValue("admin"))) | |
76 | 76 | then true | |
77 | 77 | else (c == toBase58String(this.bytes))) | |
78 | 78 | then true | |
79 | 79 | else false | |
80 | 80 | else if ((c == toBase58String(this.bytes))) | |
81 | 81 | then true | |
82 | 82 | else false | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func isMatch (address) = { | |
87 | 87 | let c = toBase58String(address) | |
88 | 88 | if (isDefined(getBoolean((c + "_isMatch")))) | |
89 | - | then | |
89 | + | then getBooleanValue((c + "_isMatch")) | |
90 | 90 | else false | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func isBanned (address) = if (isDefined(getBoolean((address + "_banned")))) | |
95 | 95 | then getBooleanValue((address + "_banned")) | |
96 | 96 | else false | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func isRoomExist (address) = isDefined(getBoolean(address)) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func addAdmin (address) = if (isAdmin(i.caller.bytes)) | |
104 | 104 | then if (isValidAddress(address)) | |
105 | 105 | then [StringEntry("admin", address)] | |
106 | 106 | else throw(invalidAddress) | |
107 | 107 | else throw(adminmsg) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | ||
111 | 111 | @Callable(i) | |
112 | 112 | func ban (address,isBanned) = if (isAdmin(i.caller.bytes)) | |
113 | 113 | then if (isValidAddress(address)) | |
114 | 114 | then [BooleanEntry((address + "_banned"), isBanned)] | |
115 | 115 | else throw(invalidAddress) | |
116 | 116 | else throw(adminmsg) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(i) | |
121 | 121 | func new (assetId,address1,address2,address3,address4) = { | |
122 | 122 | let kk = toBase58String(i.caller.bytes) | |
123 | 123 | if (isBanned(kk)) | |
124 | 124 | then throw(bannedmsg) | |
125 | 125 | else if (!(isValidToken(assetId))) | |
126 | 126 | then throw(invalidTokenMsg) | |
127 | 127 | else if (isMatch(i.caller.bytes)) | |
128 | 128 | then throw(matchMsgError) | |
129 | 129 | else if (!(isSufficientBalance(kk, assetId))) | |
130 | 130 | then throw(errorTokenInvalidAmount(assetId)) | |
131 | 131 | else if (isRoomExist(kk)) | |
132 | 132 | then throw(roomExistError) | |
133 | 133 | else if (if (if (if (if ((address1 != "")) | |
134 | 134 | then isValidAddress(address1) | |
135 | 135 | else false) | |
136 | 136 | then true | |
137 | 137 | else if ((address2 != "")) | |
138 | 138 | then isValidAddress(address2) | |
139 | 139 | else false) | |
140 | 140 | then true | |
141 | 141 | else if ((address3 != "")) | |
142 | 142 | then isValidAddress(address3) | |
143 | 143 | else false) | |
144 | 144 | then true | |
145 | 145 | else if ((address4 != "")) | |
146 | 146 | then isValidAddress(address4) | |
147 | 147 | else false) | |
148 | 148 | then [BooleanEntry(((kk + "_height_") + toString(height)), true), IntegerEntry((kk + "_height_latest"), height), StringEntry(((("address1_" + kk) + "_") + toString(height)), address1), StringEntry(((("address2_" + kk) + "_") + toString(height)), address2), StringEntry(((("address3_" + kk) + "_") + toString(height)), address3), StringEntry(((("address4_" + kk) + "_") + toString(height)), address4), StringEntry((((kk + "_height_") + toString(height)) + "_token"), assetId), BooleanEntry((kk + "_isMatch"), true), BooleanEntry(kk, true)] | |
149 | 149 | else throw(invalidAddress) | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func Deposit () = { | |
156 | 156 | let tId = match i.payments[0].assetId { | |
157 | 157 | case t: ByteVector => | |
158 | 158 | toBase58String(t) | |
159 | 159 | case _ => | |
160 | 160 | "WAVES" | |
161 | 161 | } | |
162 | 162 | let kk = toBase58String(i.caller.bytes) | |
163 | 163 | if (isBanned(kk)) | |
164 | 164 | then throw(bannedmsg) | |
165 | 165 | else if (!(isValidToken(tId))) | |
166 | 166 | then throw(invalidTokenMsg) | |
167 | 167 | else if (isMatch(i.caller.bytes)) | |
168 | 168 | then throw(matchMsgError) | |
169 | 169 | else [IntegerEntry(((kk + "_") + tId), (i.payments[0].amount + getBalanceToken(kk, tId)))] | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(i) | |
175 | 175 | func Withdraw (tId,amount) = { | |
176 | 176 | let kk = toBase58String(i.caller.bytes) | |
177 | 177 | if (isBanned(kk)) | |
178 | 178 | then throw(bannedmsg) | |
179 | 179 | else if (!(isValidToken(tId))) | |
180 | 180 | then throw(invalidTokenMsg) | |
181 | 181 | else if (isMatch(i.caller.bytes)) | |
182 | 182 | then throw(matchMsgError) | |
183 | 183 | else if ((getBalanceToken(kk, tId) == 0)) | |
184 | 184 | then throw(balanceErrorMsg) | |
185 | 185 | else if ((amount > getBalanceToken(kk, tId))) | |
186 | 186 | then throw(whithdrawError) | |
187 | 187 | else [ScriptTransfer(i.caller, amount, convertToken(tId)), IntegerEntry(((kk + "_") + tId), (getBalanceToken(kk, tId) - amount))] | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | ||
192 | 192 | @Callable(i) | |
193 | 193 | func join (address,heightRoom) = { | |
194 | 194 | let kk = toBase58String(i.caller.bytes) | |
195 | 195 | if (isBanned(kk)) | |
196 | 196 | then throw(bannedmsg) | |
197 | 197 | else if (isMatch(i.caller.bytes)) | |
198 | 198 | then throw(matchMsgError) | |
199 | 199 | else if (!(isRoomExist(address))) | |
200 | 200 | then throw(roomErrorNotExist) | |
201 | 201 | else if (!(isSufficientBalance(kk, tokenRoom(address, heightRoom)))) | |
202 | 202 | then throw(errorTokenInvalidAmount(tokenRoom(address, heightRoom))) | |
203 | 203 | else if (!(isGuest(kk, address, heightRoom))) | |
204 | 204 | then throw(errorGuest) | |
205 | 205 | else [BooleanEntry((kk + "_isMatch"), true), StringEntry((kk + "_matchIn"), address), IntegerEntry((kk + "_match_height"), heightRoom)] | |
206 | 206 | } | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | ||
210 | 210 | @Callable(i) | |
211 | 211 | func leaveRoom (address,heightRoom) = { | |
212 | 212 | let kk = toBase58String(i.caller.bytes) | |
213 | 213 | if (!(isRoomExist(address))) | |
214 | 214 | then throw(roomErrorNotExist) | |
215 | 215 | else if (!(isGuest(kk, address, heightRoom))) | |
216 | 216 | then throw(errorGuest) | |
217 | 217 | else if ((address == toBase58String(i.caller.bytes))) | |
218 | 218 | then throw(errorMainGuest) | |
219 | 219 | else [DeleteEntry((kk + "_isMatch")), DeleteEntry((kk + "_matchIn")), DeleteEntry((kk + "_match_height"))] | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | ||
224 | 224 | @Callable(i) | |
225 | 225 | func CloseRoom (address,heightRoom) = { | |
226 | 226 | let kk = toBase58String(i.caller.bytes) | |
227 | 227 | if (!(isRoomExist(address))) | |
228 | 228 | then throw(roomErrorNotExist) | |
229 | 229 | else if ((address == toBase58String(i.caller.bytes))) | |
230 | 230 | then [DeleteEntry((kk + "_isMatch")), DeleteEntry((kk + "_matchIn")), DeleteEntry((kk + "_match_height")), BooleanEntry(((kk + "_height_") + toString(height)), false), BooleanEntry((kk + "_isMatch"), false), BooleanEntry(kk, false)] | |
231 | 231 | else throw(errorCloseRoom) | |
232 | 232 | } | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | ||
236 | 236 | @Callable(i) | |
237 | 237 | func setWinner (winner,address1Value,address2Value,address3Value,address4Value,mainAddressValue,addressRoom,heightRoom) = if (isAdmin(i.caller.bytes)) | |
238 | 238 | then { | |
239 | 239 | let a = (((address1Value + address2Value) + address3Value) + address4Value) | |
240 | 240 | let address1 = getStringValue(((("address1_" + addressRoom) + "_") + toString(heightRoom))) | |
241 | 241 | let address2 = getStringValue(((("address2_" + addressRoom) + "_") + toString(heightRoom))) | |
242 | 242 | let address3 = getStringValue(((("address3_" + addressRoom) + "_") + toString(heightRoom))) | |
243 | 243 | let address4 = getStringValue(((("address4_" + addressRoom) + "_") + toString(heightRoom))) | |
244 | 244 | [ScriptTransfer(Address(fromBase58String(getStringValue("admin"))), ((a * 4) / 100), convertToken(tokenRoom(addressRoom, heightRoom))), StringEntry((((addressRoom + "_height_") + toString(height)) + "_winner"), winner), BooleanEntry(((addressRoom + "_height_") + toString(height)), false), BooleanEntry((addressRoom + "_isMatch"), false), BooleanEntry(addressRoom, false), DeleteEntry((addressRoom + "_isMatch")), DeleteEntry((addressRoom + "_matchIn")), DeleteEntry((addressRoom + "_match_height")), IntegerEntry(((winner + "_") + tokenRoom(addressRoom, heightRoom)), (getBalanceToken(winner, tokenRoom(addressRoom, heightRoom)) + (a - ((a * 4) / 100)))), IntegerEntry(((addressRoom + "_") + tokenRoom(addressRoom, heightRoom)), (getBalanceToken(addressRoom, tokenRoom(addressRoom, heightRoom)) - mainAddressValue)), IntegerEntry(((address1 + "_") + tokenRoom(addressRoom, heightRoom)), (getBalanceToken(address1, tokenRoom(addressRoom, heightRoom)) - address1Value)), IntegerEntry(((address2 + "_") + tokenRoom(addressRoom, heightRoom)), (getBalanceToken(address2, tokenRoom(addressRoom, heightRoom)) - address2Value)), IntegerEntry(((address3 + "_") + tokenRoom(addressRoom, heightRoom)), (getBalanceToken(address3, tokenRoom(addressRoom, heightRoom)) - address3Value)), IntegerEntry(((address4 + "_") + tokenRoom(addressRoom, heightRoom)), (getBalanceToken(address4, tokenRoom(addressRoom, heightRoom)) - address4Value))] | |
245 | 245 | } | |
246 | 246 | else throw(adminmsg) | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | @Verifier(tx) | |
250 | 250 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
251 | 251 |
github/deemru/w8io/026f985 38.51 ms ◑