tx · 6apooq4Be9XrT1TDr71ezrhXCQHq6JFBisubk2nQ1EKm 3N5NCEUJze7iYT63sSq2jLqJ4dtbu31P32L: -0.01400000 Waves 2019.09.10 15:01 [669986] smart account 3N5NCEUJze7iYT63sSq2jLqJ4dtbu31P32L > SELF 0.00000000 Waves
{ "type": 13, "id": "6apooq4Be9XrT1TDr71ezrhXCQHq6JFBisubk2nQ1EKm", "fee": 1400000, "feeAssetId": null, "timestamp": 1568116817648, "version": 1, "sender": "3N5NCEUJze7iYT63sSq2jLqJ4dtbu31P32L", "senderPublicKey": "Ho4R7JJ3qa66rLHUBWDkNTCgxvBahvmis1aHLva1jPU6", "proofs": [ "3b4p2JUPp8TNJWPXCQz6vL11oCTPqthyCBivhkmfsmp3Sqa4cVzRaRMjoueR16gxLMxrDyaHu92QDQ3ijrETz3Hs" ], "script": "base64:AAIDAAAAAAAAAAAAAAAoAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAALnYmFzZTY0Ok1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBTUlJQ0NnS0NBZ0VBNSs0NDY5ZVNRT3gzbGhuQ2FWWXFONU1ickd0TFZ3VERLeHZKSUJMdkVScS9zQ3RpMzVvdytsWWhPeEJ1dDJWYURJZkZmVVN3SmR4czJDR1dhRzhtbFlsZTNSRDEyNlZwc2RTVVVrVlI1YzhmWmRvV09vaEtvMUE1bmJaVFhpNFJoVW1wUXZVTTMwYXZqSjF2T0Q4bDA3WE1TUSs5OVdsQVVFVlhkbTBvUWVLSHoweGpMNVRDdFYrNkh4R2ZTWDZJZlhuaERNczBFYVNtK2x5Zzc2SHM3c0MyL2pYTGhueXlXdVc5SUVwaGdSd2daSTArN3FTdTVsNWV2TFFoenNBSDRSYklYSmtXWitKV2N6aWU1SEJYMXdyc01DZ3o1MmNBdEJoYWFCNGRWREtxbmh2R1psRDVjUk5teEQxNXFaZXlUNU5HU2NBMjJxc2YxMG5UUlJWK0g2VGpUNXpaWG95SThjV3N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AAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAGd2FsbGV0BQAAAAl3aW5BbW91bnQFAAAABHVuaXQFAAAAA25pbAUAAAAId3JpdGVTZXQJAAACAAAAAQkAASwAAAACBQAAAA1FcnJvckdhbWVPdmVyBQAAAAZzdGF0dXMAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAN0dHgFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAADc3R4BQAAAAckbWF0Y2gwBgcHZgRo7g==", "chainId": 84, "height": 669986, "spentComplexity": 0 } View: original | compacted Prev: none Next: DQ5F21Kg2U4uk5GSiWqHXy5C1CTKggwFPgECqTY9ZXXs Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let RSAPUBLIC = fromBase64String("base64:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA5+4469eSQOx3lhnCaVYqN5MbrGtLVwTDKxvJIBLvERq/sCti35ow+lYhOxBut2VaDIfFfUSwJdxs2CGWaG8mlYle3RD126VpsdSUUkVR5c8fZdoWOohKo1A5nbZTXi4RhUmpQvUM30avjJ1vOD8l07XMSQ+99WlAUEVXdm0oQeKHz0xjL5TCtV+6HxGfSX6IfXnhDMs0EaSm+lyg76Hs7sC2/jXLhnyyWuW9IEphgRwgZI0+7qSu5l5evLQhzsAH4RbIXJkWZ+JWczie5HBX1wrsMCgz52cAtBhaaB4dVDKqnhvGZlD5cRNmxD15qZeyT5NGScA22qsf10nTRRV+H6TjT5zZXoyI8cWsg5EtnO4Wau8QsxckpVNgL+Dzxwm1/FiNp5Bt4LD/yBW2Yb98FB6Vf95yCy+49fPILG9xA5iMONXZRpIq5xw48fjth8TLvLXRUE9uk+wToQT/tf8ip/eJ5Ow4M5YSO0CZ1EDk86dD9W4oto4b6bHa2EZ91wRXZH7J8zCAo9yUVAJcfCdeEE7SQrjYiD/F9rFOFCvE1LZRSLLEnbvrdWDjPRYxml8YUNtEQs/C+8SJJkamzoRcVE84cxwvrAFhrSf4xXCk+LwYYFz1UguUC6x1979jxIR3J+HWhwTXwfDoDXEMrWAj0veorTYeYB1BMAWu9vRsDNMCAwEAAQ==") | |
5 | + | ||
6 | + | let ServerAddress = addressFromStringValue("{{server_address}}") | |
7 | + | ||
8 | + | let RouletteSections = 21 | |
9 | + | ||
10 | + | let DataGameNumberKey = "APP_GAME_ID" | |
11 | + | ||
12 | + | let DataUserGameKey = "USER_GAME_ID_" | |
13 | + | ||
14 | + | let DataAmountKey = "AMOUNT" | |
15 | + | ||
16 | + | let DataSectionKey = "SECTION" | |
17 | + | ||
18 | + | let DataStatusKey = "STATUS" | |
19 | + | ||
20 | + | let DataResultKey = "RESULT" | |
21 | + | ||
22 | + | let DataWinAmountKey = "WIN_AMOUNT" | |
23 | + | ||
24 | + | let DataStatusNew = "NEW" | |
25 | + | ||
26 | + | let DataStatusWin = "WIN" | |
27 | + | ||
28 | + | let DataStatusLoose = "LOOSE" | |
29 | + | ||
30 | + | let WAVELET = ((100 * 1000) * 1000) | |
31 | + | ||
32 | + | let COMMISSION = ((5 * WAVELET) / 1000) | |
33 | + | ||
34 | + | let BET1 = (1 * WAVELET) | |
35 | + | ||
36 | + | let BET2 = (2 * WAVELET) | |
37 | + | ||
38 | + | let BET4 = (4 * WAVELET) | |
39 | + | ||
40 | + | let BET8 = (8 * WAVELET) | |
41 | + | ||
42 | + | let BET14 = (14 * WAVELET) | |
43 | + | ||
44 | + | let Sections = [0, 2, 20, 2, 5, 2, 10, 2, 6, 2, 5, 2, 6, 2, 5, 2, 10, 2, 5, 2, 6] | |
45 | + | ||
46 | + | let ErrorOnlyWavesAccepted = "Only waves accepted" | |
47 | + | ||
48 | + | let ErrorMustGreaterThan0 = "Parameter size must be greater than 0" | |
49 | + | ||
50 | + | let ErrorMustLessThan100 = "Parameter size must be less than 100" | |
51 | + | ||
52 | + | let ErrorBetMustBeInWaves = "Bet amount must be in Waves" | |
53 | + | ||
54 | + | let ErrorTransactionMustBeInWaves = "Transaction's fee must be in Waves" | |
55 | + | ||
56 | + | let ErrorTransactionUsed = "Passed txId had been used before. Game aborted." | |
57 | + | ||
58 | + | let ErrorKeyNotFound = "Key not found: " | |
59 | + | ||
60 | + | let ErrorGameOver = "Game already is over " | |
61 | + | ||
62 | + | let ErrorIncorrectSectionResult = "Incorrect section result" | |
63 | + | ||
64 | + | let ErrorBetAmountNotInRange = "Bet amount is not in range" | |
65 | + | ||
66 | + | func StoreData (transactionId,key,value) = DataEntry(((transactionId + "_") + key), value) | |
67 | + | ||
68 | + | ||
69 | + | func StoreDataInt (transactionId,key,value) = DataEntry(((transactionId + "_") + key), value) | |
70 | + | ||
71 | + | ||
72 | + | func GetData (key) = match getString(this, key) { | |
73 | + | case str: String => | |
74 | + | str | |
75 | + | case _ => | |
76 | + | throw((ErrorKeyNotFound + key)) | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | func GetDataString (transactionId,key) = { | |
81 | + | let fullKey = ((transactionId + "_") + key) | |
82 | + | match getString(this, fullKey) { | |
83 | + | case str: String => | |
84 | + | str | |
85 | + | case _ => | |
86 | + | throw((ErrorKeyNotFound + fullKey)) | |
87 | + | } | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | func GetDataInt (transactionId,key) = { | |
92 | + | let fullKey = ((transactionId + "_") + key) | |
93 | + | match getInteger(this, fullKey) { | |
94 | + | case str: Int => | |
95 | + | str | |
96 | + | case _ => | |
97 | + | throw((ErrorKeyNotFound + fullKey)) | |
98 | + | } | |
99 | + | } | |
100 | + | ||
101 | + | ||
102 | + | func NewGameId () = { | |
103 | + | let gameNum = match getInteger(this, DataGameNumberKey) { | |
104 | + | case num: Int => | |
105 | + | num | |
106 | + | case _ => | |
107 | + | 0 | |
108 | + | } | |
109 | + | (gameNum + 1) | |
110 | + | } | |
111 | + | ||
112 | + | ||
113 | + | func GenerateRandInt (gameId,rsaSign) = { | |
114 | + | let rsaSigValid = rsaVerify(SHA256, fromBase58String(gameId), toBytes(rsaSign), RSAPUBLIC) | |
115 | + | if (rsaSigValid) | |
116 | + | then { | |
117 | + | let rand = (toInt(sha256(toBytes(rsaSign))) % RouletteSections) | |
118 | + | if ((0 > rand)) | |
119 | + | then (-1 * rand) | |
120 | + | else rand | |
121 | + | } | |
122 | + | else throw("Invalid RSA signature") | |
123 | + | } | |
124 | + | ||
125 | + | ||
126 | + | func GetStatus (result) = if (result) | |
127 | + | then DataStatusWin | |
128 | + | else DataStatusLoose | |
129 | + | ||
130 | + | ||
131 | + | func GetWinAmount (betAmt,section) = { | |
132 | + | let isCorrectResult = if (if (if (if ((section == 2)) | |
133 | + | then true | |
134 | + | else (section == 5)) | |
135 | + | then true | |
136 | + | else (section == 6)) | |
137 | + | then true | |
138 | + | else (section == 10)) | |
139 | + | then true | |
140 | + | else (section == 20) | |
141 | + | let betAmtValid = if (if (if (if ((betAmt == (BET1 + COMMISSION))) | |
142 | + | then true | |
143 | + | else (betAmt == (BET2 + COMMISSION))) | |
144 | + | then true | |
145 | + | else (betAmt == (BET4 + COMMISSION))) | |
146 | + | then true | |
147 | + | else (betAmt == (BET8 + COMMISSION))) | |
148 | + | then true | |
149 | + | else (betAmt == (BET14 + COMMISSION)) | |
150 | + | if (!(isCorrectResult)) | |
151 | + | then throw(ErrorIncorrectSectionResult) | |
152 | + | else if (betAmtValid) | |
153 | + | then ((betAmt - COMMISSION) * section) | |
154 | + | else throw(ErrorBetAmountNotInRange) | |
155 | + | } | |
156 | + | ||
157 | + | ||
158 | + | @Callable(i) | |
159 | + | func bet (expectedResult) = { | |
160 | + | let gameNumber = NewGameId() | |
161 | + | let gameTransactionId = toBase58String(i.transactionId) | |
162 | + | let address = toBase58String(i.caller.bytes) | |
163 | + | let pmt = extract(i.payment) | |
164 | + | let txIdUsed = isDefined(getString(this, gameTransactionId)) | |
165 | + | let betNotInWaves = isDefined(pmt.assetId) | |
166 | + | let feeNotInWaves = isDefined(pmt.assetId) | |
167 | + | let amount = pmt.amount | |
168 | + | let winAmt = GetWinAmount(pmt.amount, expectedResult) | |
169 | + | if (betNotInWaves) | |
170 | + | then throw(ErrorBetMustBeInWaves) | |
171 | + | else if (feeNotInWaves) | |
172 | + | then throw(ErrorTransactionMustBeInWaves) | |
173 | + | else if (txIdUsed) | |
174 | + | then throw(ErrorTransactionUsed) | |
175 | + | else ScriptResult(WriteSet([DataEntry((DataUserGameKey + toString(gameNumber)), gameTransactionId), DataEntry(gameTransactionId, address), DataEntry(DataGameNumberKey, gameNumber), StoreDataInt(gameTransactionId, DataAmountKey, amount), StoreDataInt(gameTransactionId, DataSectionKey, expectedResult), StoreData(gameTransactionId, DataStatusKey, DataStatusNew), StoreDataInt(gameTransactionId, DataWinAmountKey, winAmt)]), TransferSet([ScriptTransfer(ServerAddress, COMMISSION, unit)])) | |
176 | + | } | |
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | @Callable(i) | |
181 | + | func result (gameTransactionId,rsa) = { | |
182 | + | let randIndex = GenerateRandInt(gameTransactionId, rsa) | |
183 | + | let selectedSection = GetDataInt(gameTransactionId, DataSectionKey) | |
184 | + | let status = GetDataString(gameTransactionId, DataStatusKey) | |
185 | + | if ((status == DataStatusNew)) | |
186 | + | then { | |
187 | + | let randSection = Sections[randIndex] | |
188 | + | let isWin = (randSection == selectedSection) | |
189 | + | let writeSet = WriteSet([StoreData(gameTransactionId, DataStatusKey, GetStatus(isWin)), StoreDataInt(gameTransactionId, DataResultKey, randSection)]) | |
190 | + | if (isWin) | |
191 | + | then { | |
192 | + | let wallet = GetData(gameTransactionId) | |
193 | + | let winAmount = GetDataInt(gameTransactionId, DataWinAmountKey) | |
194 | + | ScriptResult(writeSet, TransferSet([ScriptTransfer(addressFromStringValue(wallet), winAmount, unit)])) | |
195 | + | } | |
196 | + | else writeSet | |
197 | + | } | |
198 | + | else throw((ErrorGameOver + status)) | |
199 | + | } | |
200 | + | ||
201 | + | ||
202 | + | @Verifier(tx) | |
203 | + | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
204 | + | then match tx { | |
205 | + | case ttx: TransferTransaction => | |
206 | + | true | |
207 | + | case stx: SetScriptTransaction => | |
208 | + | true | |
209 | + | case _ => | |
210 | + | false | |
211 | + | } | |
212 | + | else false | |
213 | + |
github/deemru/w8io/026f985 32.28 ms ◑