tx · C6BVxkC4o14UBNcA5r9YrqtbVuDsDvAXyShBAjCgvhvw

3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD:  -0.01500000 Waves

2019.10.05 15:14 [706422] smart account 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD > SELF 0.00000000 Waves

{ "type": 13, "id": "C6BVxkC4o14UBNcA5r9YrqtbVuDsDvAXyShBAjCgvhvw", "fee": 1500000, "feeAssetId": null, "timestamp": 1570277702918, "version": 1, "sender": "3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD", "senderPublicKey": "8W9JLTJTfxrJrBNXxngzueBF4vJqeb6p9jFob7wb6QWQ", "proofs": [ "32UqUxGQFMYaxeAG1VUNTZSq32UAapASsrhucS7UQN8kwi14huuQiS2oavyxLja1PpwLCHMZjnpNSkvXnWN8cMgL" ], "script": "base64:AAIDAAAAAAAAAAwIARIAEgYKBAgICAgAAAAkAAAAAA1yc2FQdWJsaWNLZXkxCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9raXV6L0JWNEVqb3hHaFRtTkNidDJUZ2tiU1BIL3c2OWIzRjFyS21ENjFKaVBYdnZGOEwycEk5eE9ZY1c0Rm1vRVpWSGxSUXRBbGFKeWtsMytyc3JFQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkyCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQUpuWHpiTS9WMnNEVjFVTGJQU09sSGtsZE9UV1JySGk1ZnhJa0JtdWV2ckNsTVBWSDdycWNjd2lyRE5jTWRJZHdYSEk5QWRoajlGV2p3R0l3ZlUvSzZNQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkzCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9SRGV2eTByNGt6THFPeVNsb0I2M0h1djJlNHplSEt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NjcmlwdFRyYW5zYWN0aW9uBAAAAARzc3R4BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAARzc3R4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAAEc3N0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAARzc3R4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAABGlzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAABGlzdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAARpc3R4AAAABnByb29mcwAAAAAAAAAAAAgFAAAABGlzdHgAAAAPc2VuZGVyUHVibGljS2V5B21kymc=", "chainId": 84, "height": 706422, "spentComplexity": 0 } View: original | compacted Prev: 6RhvMkHuiRQWbRM2MxGbMC5CCL81SBcyC1oY93tASMP9 Next: 5mQsmZJmPFCJhXUDARfCcsAjr863bBCGYJrh2mKmdjA1 Diff:
OldNewDifferences
88 let rsaPublicKey3 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAORDevy0r4kzLqOySloB63Huv2e4zeHKHjCsy5vtFKmWZbXJa8gZYt4+EklFIo1K9oqu5BAPVfJ3FOzs2U1A+g0CAwEAAQ==")
99
1010 let gameTimeFrame = (1440 * 2)
11+
12+let commission = 500000
1113
1214 let stateAcc = "Accepted"
1315
5557
5658 let VstMaxAmt = (VstMinAmt * 10)
5759
58-func pmtAmtCheck (pmtAssetId,pmtAmt) = if ((pmtAssetId == "WAVES"))
59- then if (if ((pmtAmt >= WavesMinAmt))
60- then (WavesMaxAmt >= pmtAmt)
60+func pmtAmtCheck (pmtAssetId,betAmount) = if ((pmtAssetId == "WAVES"))
61+ then if (if ((betAmount >= WavesMinAmt))
62+ then (WavesMaxAmt >= betAmount)
6163 else false)
6264 then true
6365 else throw("Bet amount is not in range")
6466 else if ((pmtAssetId == "BTC"))
65- then if (if ((pmtAmt >= BtcMinAmt))
66- then (BtcMaxAmt >= pmtAmt)
67+ then if (if ((betAmount >= BtcMinAmt))
68+ then (BtcMaxAmt >= betAmount)
6769 else false)
6870 then true
6971 else throw("Bet amount is not in range")
7072 else if ((pmtAssetId == "ETH"))
71- then if (if ((pmtAmt >= EthMinAmt))
72- then (EthMaxAmt >= pmtAmt)
73+ then if (if ((betAmount >= EthMinAmt))
74+ then (EthMaxAmt >= betAmount)
7375 else false)
7476 then true
7577 else throw("Bet amount is not in range")
7678 else if ((pmtAssetId == "LTC"))
77- then if (if ((pmtAmt >= LtcMinAmt))
78- then (LtcMaxAmt >= pmtAmt)
79+ then if (if ((betAmount >= LtcMinAmt))
80+ then (LtcMaxAmt >= betAmount)
7981 else false)
8082 then true
8183 else throw("Bet amount is not in range")
8284 else if ((pmtAssetId == "WCT"))
83- then if (if ((pmtAmt >= WctMinAmt))
84- then (WctMaxAmt >= pmtAmt)
85+ then if (if ((betAmount >= WctMinAmt))
86+ then (WctMaxAmt >= betAmount)
8587 else false)
8688 then true
8789 else throw("Bet amount is not in range")
88- else if (if ((pmtAmt >= VstMinAmt))
89- then (VstMaxAmt >= pmtAmt)
90+ else if (if ((betAmount >= VstMinAmt))
91+ then (VstMaxAmt >= betAmount)
9092 else false)
9193 then true
9294 else throw("Bet amount is not in range")
218220 @Callable(i)
219221 func makeBet () = {
220222 let pmt = extract(i.payment)
221- let pmtAmt = pmt.amount
223+ let betAmount = (pmt.amount - commission)
222224 let gameId = toBase58String(i.transactionId)
223225 let gameStart = height
224226 let playerPublicKey = toBase58String(i.callerPublicKey)
235237 else if ((pmt.assetId == vstId))
236238 then "VST"
237239 else throw("AssetId is incorrect")
238- let setReservedBalance = increaseReservedBalance(pmtAmt, pmtAssetName)
239- let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, pmtAmt)
240+ let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName)
241+ let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, betAmount)
240242 if (pmtAmtCorrect)
241243 then {
242- let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(pmtAmt)) + "_") + pmtAssetName) + "_") + toString(gameStart))
244+ let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(betAmount)) + "_") + pmtAssetName) + "_") + toString(gameStart))
243245 WriteSet([DataEntry(gameId, dataString), DataEntry(("Reserved_" + pmtAssetName), setReservedBalance)])
244246 }
245247 else throw("assetId is incorrect")
274276 let multiplier = defineMultiplier(threeDrums, twoDrums)
275277 ((betAmt * multiplier) / 10)
276278 }
279+ let winPmtAmt = {
280+ let balance = assetBalance(this, assetId58)
281+ if ((winAmt > balance))
282+ then (betAmt * 2)
283+ else winAmt
284+ }
277285 let stringForNewData = ((((((dataList[1] + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4])
278286 let droppedElements = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2])
279287 if (stateCorrect)
280288 then if (gameTimeCheck)
281289 then if ((winAmt == 0))
282290 then WriteSet([DataEntry(gameId, ((((((stateLose + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)])
283- else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winAmt, assetId58)]))
291+ else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winPmtAmt, assetId58)]))
284292 else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)]))
285293 else throw("Game state is incorrect")
286294 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let rsaPublicKey1 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOkiuz/BV4EjoxGhTmNCbt2TgkbSPH/w69b3F1rKmD61JiPXvvF8L2pI9xOYcW4FmoEZVHlRQtAlaJykl3+rsrECAwEAAQ==")
55
66 let rsaPublicKey2 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnXzbM/V2sDV1ULbPSOlHkldOTWRrHi5fxIkBmuevrClMPVH7rqccwirDNcMdIdwXHI9Adhj9FWjwGIwfU/K6MCAwEAAQ==")
77
88 let rsaPublicKey3 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAORDevy0r4kzLqOySloB63Huv2e4zeHKHjCsy5vtFKmWZbXJa8gZYt4+EklFIo1K9oqu5BAPVfJ3FOzs2U1A+g0CAwEAAQ==")
99
1010 let gameTimeFrame = (1440 * 2)
11+
12+let commission = 500000
1113
1214 let stateAcc = "Accepted"
1315
1416 let stateWin = "Win"
1517
1618 let stateTimeout = "WinByTimeout"
1719
1820 let stateLose = "Lose"
1921
2022 let wavesId = unit
2123
2224 let btcId = base58'Gt4HLkHunts7bWbtYP5UCsAPW7TUA4gmQEnjgjbZ2NqB'
2325
2426 let ethId = base58'6A79GDQj8bdHqUaoJQ3qE1TCPnBc3wFirNCSsAY5RKry'
2527
2628 let ltcId = base58'7oRhs4zoufHM4KiBDuJwRXUWb9JQaFt98N8ubpmytMmw'
2729
2830 let vstId = base58'5UyDjBMx1Q8UWhJj1r7JuA6h4aCkKrHE1J19HvMXRpRd'
2931
3032 let wctId = base58'Ae5W927iuKSLLT6Sdt3bqWze6ZUbYHDWzPY6dLKQusZv'
3133
3234 let divider = 1000
3335
3436 let WavesMinAmt = (100000000 / divider)
3537
3638 let WavesMaxAmt = (WavesMinAmt * 10)
3739
3840 let BtcMinAmt = (10000 / divider)
3941
4042 let BtcMaxAmt = (BtcMinAmt * 10)
4143
4244 let EthMinAmt = (1000000 / divider)
4345
4446 let EthMaxAmt = (EthMinAmt * 10)
4547
4648 let LtcMinAmt = (2000000 / divider)
4749
4850 let LtcMaxAmt = (LtcMinAmt * 10)
4951
5052 let WctMinAmt = (500000000 / divider)
5153
5254 let WctMaxAmt = (WctMinAmt * 10)
5355
5456 let VstMinAmt = (500000000 / divider)
5557
5658 let VstMaxAmt = (VstMinAmt * 10)
5759
58-func pmtAmtCheck (pmtAssetId,pmtAmt) = if ((pmtAssetId == "WAVES"))
59- then if (if ((pmtAmt >= WavesMinAmt))
60- then (WavesMaxAmt >= pmtAmt)
60+func pmtAmtCheck (pmtAssetId,betAmount) = if ((pmtAssetId == "WAVES"))
61+ then if (if ((betAmount >= WavesMinAmt))
62+ then (WavesMaxAmt >= betAmount)
6163 else false)
6264 then true
6365 else throw("Bet amount is not in range")
6466 else if ((pmtAssetId == "BTC"))
65- then if (if ((pmtAmt >= BtcMinAmt))
66- then (BtcMaxAmt >= pmtAmt)
67+ then if (if ((betAmount >= BtcMinAmt))
68+ then (BtcMaxAmt >= betAmount)
6769 else false)
6870 then true
6971 else throw("Bet amount is not in range")
7072 else if ((pmtAssetId == "ETH"))
71- then if (if ((pmtAmt >= EthMinAmt))
72- then (EthMaxAmt >= pmtAmt)
73+ then if (if ((betAmount >= EthMinAmt))
74+ then (EthMaxAmt >= betAmount)
7375 else false)
7476 then true
7577 else throw("Bet amount is not in range")
7678 else if ((pmtAssetId == "LTC"))
77- then if (if ((pmtAmt >= LtcMinAmt))
78- then (LtcMaxAmt >= pmtAmt)
79+ then if (if ((betAmount >= LtcMinAmt))
80+ then (LtcMaxAmt >= betAmount)
7981 else false)
8082 then true
8183 else throw("Bet amount is not in range")
8284 else if ((pmtAssetId == "WCT"))
83- then if (if ((pmtAmt >= WctMinAmt))
84- then (WctMaxAmt >= pmtAmt)
85+ then if (if ((betAmount >= WctMinAmt))
86+ then (WctMaxAmt >= betAmount)
8587 else false)
8688 then true
8789 else throw("Bet amount is not in range")
88- else if (if ((pmtAmt >= VstMinAmt))
89- then (VstMaxAmt >= pmtAmt)
90+ else if (if ((betAmount >= VstMinAmt))
91+ then (VstMaxAmt >= betAmount)
9092 else false)
9193 then true
9294 else throw("Bet amount is not in range")
9395
9496
9597 func increaseReservedBalance (pmtAmt,pmtAssetName) = {
9698 let currentReservedBalance = {
9799 let valueReservedBalance = getInteger(this, ("Reserved_" + pmtAssetName))
98100 match valueReservedBalance {
99101 case a: Int =>
100102 a
101103 case _ =>
102104 0
103105 }
104106 }
105107 let newReservedBalance = (currentReservedBalance + pmtAmt)
106108 if ((wavesBalance(this) >= newReservedBalance))
107109 then {
108110 let increaseReservedBalance = newReservedBalance
109111 increaseReservedBalance
110112 }
111113 else throw("Bet was rejected. Insufficient funds on game account.")
112114 }
113115
114116
115117 func getDataList (gameId) = {
116118 let getDataString = getString(this, gameId)
117119 let a = match getDataString {
118120 case a: String =>
119121 a
120122 case _ =>
121123 throw("GameId was not found")
122124 }
123125 split(a, "_")
124126 }
125127
126128
127129 func intToElem (rsaInt) = if ((2 > rsaInt))
128130 then "7"
129131 else if ((4 > rsaInt))
130132 then "6"
131133 else if ((6 > rsaInt))
132134 then "5"
133135 else if ((8 > rsaInt))
134136 then "4"
135137 else if ((10 > rsaInt))
136138 then "3"
137139 else if ((12 > rsaInt))
138140 then "2"
139141 else "1"
140142
141143
142144 func rsaToInt (gameId,rsaSign,rsaPublicKey) = {
143145 let rsaCheck = rsaVerify(SHA256, toBytes(gameId), fromBase64String(rsaSign), rsaPublicKey)
144146 if (rsaCheck)
145147 then {
146148 let rsaInt = ((toInt(sha256(fromBase64String(rsaSign))) % 19) + 1)
147149 if (if ((rsaInt > 0))
148150 then (20 >= rsaInt)
149151 else false)
150152 then rsaInt
151153 else throw("Integer is not in range")
152154 }
153155 else throw("Rsa Signature is invalid")
154156 }
155157
156158
157159 func decreaseReservedBalance (betAmt,assetId) = {
158160 let valueReservedBalance = getInteger(this, ("Reserved_" + assetId))
159161 let extractReservedBalance = match valueReservedBalance {
160162 case a: Int =>
161163 a
162164 case _ =>
163165 0
164166 }
165167 let decreaseReservedBalance = (extractReservedBalance - betAmt)
166168 if ((decreaseReservedBalance > 0))
167169 then decreaseReservedBalance
168170 else throw("Reserved balance couldn't be less than 0")
169171 }
170172
171173
172174 func defineMultiplier (threeDrums,twoDrums) = if ((threeDrums == "777"))
173175 then 5370
174176 else if ((threeDrums == "666"))
175177 then 1300
176178 else if ((threeDrums == "555"))
177179 then 450
178180 else if ((threeDrums == "444"))
179181 then 200
180182 else if ((threeDrums == "333"))
181183 then 150
182184 else if ((threeDrums == "222"))
183185 then 110
184186 else if ((threeDrums == "111"))
185187 then 40
186188 else if ((twoDrums == "77"))
187189 then 270
188190 else if ((twoDrums == "66"))
189191 then 130
190192 else if ((twoDrums == "55"))
191193 then 65
192194 else if ((twoDrums == "44"))
193195 then 30
194196 else if ((twoDrums == "33"))
195197 then 20
196198 else if ((twoDrums == "22"))
197199 then 15
198200 else if ((twoDrums == "11"))
199201 then 10
200202 else 0
201203
202204
203205 func AssetNameToBase58 (assetName) = if ((assetName == "WAVES"))
204206 then wavesId
205207 else if ((assetName == "BTC"))
206208 then btcId
207209 else if ((assetName == "ETH"))
208210 then ethId
209211 else if ((assetName == "LTC"))
210212 then ltcId
211213 else if ((assetName == "VST"))
212214 then vstId
213215 else if ((assetName == "WCT"))
214216 then wctId
215217 else throw("Asset name is incorrect")
216218
217219
218220 @Callable(i)
219221 func makeBet () = {
220222 let pmt = extract(i.payment)
221- let pmtAmt = pmt.amount
223+ let betAmount = (pmt.amount - commission)
222224 let gameId = toBase58String(i.transactionId)
223225 let gameStart = height
224226 let playerPublicKey = toBase58String(i.callerPublicKey)
225227 let pmtAssetName = if (!(isDefined(pmt.assetId)))
226228 then "WAVES"
227229 else if ((pmt.assetId == btcId))
228230 then "BTC"
229231 else if ((pmt.assetId == ethId))
230232 then "ETH"
231233 else if ((pmt.assetId == ltcId))
232234 then "LTC"
233235 else if ((pmt.assetId == wctId))
234236 then "WCT"
235237 else if ((pmt.assetId == vstId))
236238 then "VST"
237239 else throw("AssetId is incorrect")
238- let setReservedBalance = increaseReservedBalance(pmtAmt, pmtAssetName)
239- let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, pmtAmt)
240+ let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName)
241+ let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, betAmount)
240242 if (pmtAmtCorrect)
241243 then {
242- let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(pmtAmt)) + "_") + pmtAssetName) + "_") + toString(gameStart))
244+ let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(betAmount)) + "_") + pmtAssetName) + "_") + toString(gameStart))
243245 WriteSet([DataEntry(gameId, dataString), DataEntry(("Reserved_" + pmtAssetName), setReservedBalance)])
244246 }
245247 else throw("assetId is incorrect")
246248 }
247249
248250
249251
250252 @Callable(i)
251253 func playGame (gameId,rsaSign1,rsaSign2,rsaSign3) = {
252254 let dataList = getDataList(gameId)
253255 let gameState = dataList[0]
254256 let playerAddress = addressFromPublicKey(fromBase58String(dataList[1]))
255257 let betAmt = parseIntValue(dataList[2])
256258 let assetName = dataList[3]
257259 let gameStart = parseIntValue(dataList[4])
258260 let assetId58 = AssetNameToBase58(assetName)
259261 let gameTimeCheck = (gameTimeFrame > (height - gameStart))
260262 let stateCorrect = (gameState == stateAcc)
261263 let setReservedBalance = decreaseReservedBalance(betAmt, assetName)
262264 let droppedElementsList = {
263265 let roll1Int = rsaToInt(gameId, rsaSign1, rsaPublicKey1)
264266 let roll2Int = rsaToInt(gameId, rsaSign2, rsaPublicKey2)
265267 let roll3Int = rsaToInt(gameId, rsaSign3, rsaPublicKey3)
266268 let element1 = intToElem(roll1Int)
267269 let element2 = intToElem(roll2Int)
268270 let element3 = intToElem(roll3Int)
269271 [element1, element2, element3]
270272 }
271273 let winAmt = {
272274 let threeDrums = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2])
273275 let twoDrums = (droppedElementsList[0] + droppedElementsList[1])
274276 let multiplier = defineMultiplier(threeDrums, twoDrums)
275277 ((betAmt * multiplier) / 10)
276278 }
279+ let winPmtAmt = {
280+ let balance = assetBalance(this, assetId58)
281+ if ((winAmt > balance))
282+ then (betAmt * 2)
283+ else winAmt
284+ }
277285 let stringForNewData = ((((((dataList[1] + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4])
278286 let droppedElements = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2])
279287 if (stateCorrect)
280288 then if (gameTimeCheck)
281289 then if ((winAmt == 0))
282290 then WriteSet([DataEntry(gameId, ((((((stateLose + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)])
283- else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winAmt, assetId58)]))
291+ else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winPmtAmt, assetId58)]))
284292 else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)]))
285293 else throw("Game state is incorrect")
286294 }
287295
288296
289297 @Verifier(tx)
290298 func verify () = match tx {
291299 case ttx: TransferTransaction =>
292300 let valueReservedBalance = getInteger(this, "Reserved")
293301 let reservedBalance = match valueReservedBalance {
294302 case a: Int =>
295303 a
296304 case _ =>
297305 0
298306 }
299307 let availableBalance = (wavesBalance(this) - reservedBalance)
300308 let availibleAmount = (availableBalance >= ttx.amount)
301309 let signature = sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey)
302310 if (availibleAmount)
303311 then signature
304312 else false
305313 case sstx: SetScriptTransaction =>
306314 sigVerify(sstx.bodyBytes, sstx.proofs[0], sstx.senderPublicKey)
307315 case istx: InvokeScriptTransaction =>
308316 sigVerify(istx.bodyBytes, istx.proofs[0], istx.senderPublicKey)
309317 case _ =>
310318 false
311319 }
312320

github/deemru/w8io/169f3d6 
57.45 ms