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