tx · 65XvzpAzJNNnLF7vxdtD65GvYvbM7CoHtzzBqvJSGHJe

3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL:  -0.01400000 Waves

2019.08.23 18:36 [643970] smart account 3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL > SELF 0.00000000 Waves

{ "type": 13, "id": "65XvzpAzJNNnLF7vxdtD65GvYvbM7CoHtzzBqvJSGHJe", "fee": 1400000, "feeAssetId": null, "timestamp": 1566574585699, "version": 1, "sender": "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL", "senderPublicKey": "FbEMepLNcZb6VBpsH5JJg4j43UEV27dMRqv1Pq6JFLgy", "proofs": [ "naG3J6eMjnQ6jrA2F8nf629aPtAgthqET5djR3qj4sFKqsAhBrkuEP3BuRJ5NC9ERfbNUZaicwY5YpFne1htVXH" ], "script": "base64:AAIDAAAAAAAAAAAAAAAUAAAAAApiZXRBc3NldElkAQAAACAea7QCZF/XAXMBPEnDQ5kqHUHyOfWmXu9KHDHL6zcNNwAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAAZtaW5CZXQAAAAAAABMS0AAAAAAD21pbk1hdGNoTm9taW5hbAAAAAAAAExLQAAAAAAGbGV2ZWwxAAAAAAAAAAD6AAAAAAZsZXZlbDIAAAAAAAAAAJYAAAAABmxldmVsMwAAAAAAAAAAZAAAAAAIY2FzaEJhY2sAAAAAAAAAAfQAAAAACHRvdGFsUmVmAAAAAAAAAAAKAAAAAA1jaGFuZ2VBZGRyZXNzAgAAACMzTkF4c2JIeFM2M2F6ZEFpY1Z2TEdzeGpBUTlEc0s2TDROTAAAAAALbWluV2l0aGRyYXcAAAAAAAAPQkABAAAAE2dldENhbGxlckJ5RGVsZWdhdGUAAAACAAAAAWkAAAAIZnVuY3Rpb24EAAAABmNhbGxlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAxjYWxsZXJQcmVmaXgJAAEsAAAAAgIAAAAJZGVsZWd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sh Next: none Diff:
OldNewDifferences
196196 let txid = toBase58String(i.transactionId)
197197 let timestamp = toString(lastBlock.timestamp)
198198 let refAmount = ((amount * totalRef) / 1000)
199- ScriptResult(WriteSet( match getReferer(winnerAddress) {
199+ ScriptResult(WriteSet([DataEntry((matchId + "_paid"), toBase58String(i.transactionId)), match getReferer(winnerAddress) {
200200 case ref1: String =>
201201 let incLevel1 = ((refAmount * level1) / 1000)
202202 let incCashBack = ((refAmount * cashBack) / 1000)
203-[DataEntry((matchId + "_paid"), toBase58String(i.transactionId)), balanceIncrement(winnerAddress, incCashBack), recordBalanceIncrement(winnerAddress, winnerAddress, incCashBack, "cashback", txid, timestamp), balanceIncrement(ref1, incLevel1), recordBalanceIncrement(ref1, winnerAddress, incLevel1, "l1", txid, timestamp), match getReferer(ref1) {
203+[balanceIncrement(winnerAddress, incCashBack), recordBalanceIncrement(winnerAddress, winnerAddress, incCashBack, "cashback", txid, timestamp), balanceIncrement(ref1, incLevel1), recordBalanceIncrement(ref1, winnerAddress, incLevel1, "l1", txid, timestamp), match getReferer(ref1) {
204204 case ref2: String =>
205205 let incLevel2 = ((refAmount * level2) / 1000)
206206 [balanceIncrement(ref2, incLevel2), recordBalanceIncrement(ref2, winnerAddress, incLevel2, "l2", txid, timestamp), match getReferer(ref2) {
215215 }]
216216 case _ =>
217217 [balanceIncrement(changeAddress, refAmount), recordBalanceIncrement(changeAddress, winnerAddress, refAmount, "change", txid, timestamp)]
218- }), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), (amount - refAmount), betAssetId)]))
218+ }]), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), (amount - refAmount), betAssetId)]))
219219 }
220220 }
221221
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let betAssetId = base58'33kV5hRVtgEGpYqhp9wQn2g9hP1fNWSYGCzzYk1T9Hyg'
55
66 let maxFee = 5000000
77
88 let minBet = 5000000
99
1010 let minMatchNominal = 5000000
1111
1212 let level1 = 250
1313
1414 let level2 = 150
1515
1616 let level3 = 100
1717
1818 let cashBack = 500
1919
2020 let totalRef = 10
2121
2222 let changeAddress = "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL"
2323
2424 let minWithdraw = 1000000
2525
2626 func getCallerByDelegate (i,function) = {
2727 let caller = toBase58String(i.caller.bytes)
2828 let callerPrefix = ("delegate_" + caller)
2929 if ((getBoolean(this, ((callerPrefix + "_") + function)) == true))
3030 then match getString(this, (callerPrefix + "_address")) {
3131 case s: String =>
3232 s
3333 case _ =>
3434 caller
3535 }
3636 else caller
3737 }
3838
3939
4040 func checkFee (i) = if ((i.fee > maxFee))
4141 then throw("unreasonable large fee")
4242 else if ((i.feeAssetId != unit))
4343 then throw("fee must be in WAVES")
4444 else true
4545
4646
4747 func repayFee (i,ws,amount,recipient) = if (checkFee(i))
4848 then if (if ((amount > 0))
4949 then isDefined(recipient)
5050 else false)
5151 then ScriptResult(ws, TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(extract(recipient), amount, betAssetId)]))
5252 else ScriptResult(ws, TransferSet([ScriptTransfer(i.caller, i.fee, unit)]))
5353 else throw("error")
5454
5555
5656 func checkOwner (i,betid) = (getString(this, (betid + "_owner")) == toBase58String(i.caller.bytes))
5757
5858
5959 func getUnspent (betid) = (extract(getInteger(this, (betid + "_amount"))) - extract(getInteger(this, (betid + "_spent"))))
6060
6161
6262 func isDefeated (betid) = {
6363 let defeatStatus = getInteger(this, (betid + "_defeat"))
6464 if ((defeatStatus == 1))
6565 then true
6666 else (defeatStatus == 3)
6767 }
6868
6969
7070 func getReferer (user) = getString(this, (user + "_referer"))
7171
7272
7373 func balanceIncrement (address,inc) = {
7474 let balanceKey = (address + "_balance")
7575 DataEntry(balanceKey, (inc + match getInteger(this, balanceKey) {
7676 case b: Int =>
7777 b
7878 case _ =>
7979 0
8080 }))
8181 }
8282
8383
8484 func recordBalanceIncrement (address,owner,inc,level,txId,timestamp) = DataEntry(((("fund_" + address) + "_") + txId), ((((((owner + ":") + toString(inc)) + ":") + level) + ":") + timestamp))
8585
8686
8787 @Callable(i)
8888 func bet (event,subevent,side,odds) = {
8989 let owner = toBase58String(i.caller.bytes)
9090 let payment = extract(i.payment)
9191 if ((payment.assetId != betAssetId))
9292 then throw(("bet must be in asset " + toBase58String(betAssetId)))
9393 else if ((minBet > payment.amount))
9494 then throw(("minimum allowed bet is " + toString(minBet)))
9595 else if (if ((side != "for"))
9696 then (side != "against")
9797 else false)
9898 then throw("unexpected side")
9999 else {
100100 let betid = (((((("bet_" + event) + "_") + toBase58String(i.caller.bytes)) + "_") + take(toBase58String(i.transactionId), 15)) + "_")
101101 let sequenceKey = ((("seq_" + event) + "_") + subevent)
102102 let sequence = match getInteger(this, sequenceKey) {
103103 case prevS: Int =>
104104 (prevS + 1)
105105 case _ =>
106106 1
107107 }
108108 repayFee(i, WriteSet([DataEntry((betid + "owner"), owner), DataEntry((betid + "event"), event), DataEntry((betid + "subevent"), subevent), DataEntry((betid + "side"), side), DataEntry((betid + "odds"), odds), DataEntry((betid + "amount"), payment.amount), DataEntry((betid + "spent"), 0), DataEntry((betid + "timestamp"), lastBlock.timestamp), DataEntry((betid + "sequence"), sequence), DataEntry(sequenceKey, sequence)]), 0, unit)
109109 }
110110 }
111111
112112
113113
114114 @Callable(i)
115115 func cancel (betid) = if ((getString(this, (betid + "_owner")) != getCallerByDelegate(i, "autocancel")))
116116 then throw("must be owner or its delegate to cancel")
117117 else {
118118 let amount = extract(getInteger(this, (betid + "_amount")))
119119 let spent = extract(getInteger(this, (betid + "_spent")))
120120 let cancelAmount = (amount - spent)
121121 repayFee(i, WriteSet([DataEntry((betid + "_spent"), amount), DataEntry((betid + "_cancel_amount"), cancelAmount), DataEntry((betid + "_cancel_tx"), toBase58String(i.transactionId))]), cancelAmount, i.caller)
122122 }
123123
124124
125125
126126 @Callable(i)
127127 func betMatch (betFor,betAgainst) = if ((getString(this, (betFor + "_event")) != getString(this, (betAgainst + "_event"))))
128128 then throw("event id must match")
129129 else if ((getString(this, (betFor + "_subevent")) != getString(this, (betAgainst + "_subevent"))))
130130 then throw("subevent id must match")
131131 else if ((getString(this, (betFor + "_side")) != "for"))
132132 then throw("invalid *for* bet")
133133 else if ((getString(this, (betAgainst + "_side")) != "against"))
134134 then throw("invalid *against* bet")
135135 else {
136136 let betForOwner = getStringValue(this, (betFor + "_owner"))
137137 let betAgainstOwner = getStringValue(this, (betAgainst + "_owner"))
138138 let eventid = extract(getString(this, (betFor + "_event")))
139139 let matchid = (((((((("match_" + eventid) + "_") + takeRight(betForOwner, 10)) + "_") + takeRight(betAgainstOwner, 10)) + "_") + toBase58String(i.transactionId)) + "_")
140140 let odds = extract(getInteger(this, (betFor + "_odds")))
141141 let unspentFor = getUnspent(betFor)
142142 let unspentAgainst = getUnspent(betAgainst)
143143 let maxForNominal = unspentFor
144144 let maxAgainstNominal = ((unspentAgainst * 100) / (odds - 100))
145145 let matchNominal = if ((maxForNominal > maxAgainstNominal))
146146 then maxAgainstNominal
147147 else maxForNominal
148148 if ((minMatchNominal > matchNominal))
149149 then throw("match nominal too low")
150150 else {
151151 let spendFor = matchNominal
152152 let spendAgainst = ((matchNominal * (odds - 100)) / 100)
153153 let newSpentFor = (spendFor + extract(getInteger(this, (betFor + "_spent"))))
154154 let newSpentAgainst = (spendAgainst + extract(getInteger(this, (betAgainst + "_spent"))))
155155 if ((newSpentFor > extract(getInteger(this, (betFor + "_amount")))))
156156 then throw("invalid match")
157157 else if ((newSpentAgainst > extract(getInteger(this, (betAgainst + "_amount")))))
158158 then throw("invalid match")
159159 else repayFee(i, WriteSet([DataEntry((matchid + "amount"), (spendFor + spendAgainst)), DataEntry((matchid + "for"), betFor), DataEntry((matchid + "against"), betAgainst), DataEntry((betFor + "_spent"), newSpentFor), DataEntry((betAgainst + "_spent"), newSpentAgainst)]), 0, unit)
160160 }
161161 }
162162
163163
164164
165165 @Callable(i)
166166 func approveDefeat (betId,defeat) = if (if (isDefined(getInteger(this, (betId + "_defeat"))))
167167 then (defeat == 2)
168168 else false)
169169 then throw("can't dispute after approve")
170170 else if ((getString(this, (betId + "_owner")) != getCallerByDelegate(i, "autoapprove")))
171171 then throw("must be owner or its delegate to approve")
172172 else repayFee(i, WriteSet([DataEntry((betId + "_defeat"), defeat)]), 0, unit)
173173
174174
175175
176176 @Callable(i)
177177 func payWinner (matchId) = if (!(checkFee(i)))
178178 then throw("error")
179179 else if (isDefined(getInteger(this, (matchId + "_paid"))))
180180 then throw("already paid")
181181 else {
182182 let betForId = extract(getString(this, (matchId + "_for")))
183183 let betAgainstId = extract(getString(this, (matchId + "_against")))
184184 let betForDefeated = isDefeated(betForId)
185185 let betAgainstDefeated = isDefeated(betAgainstId)
186186 if (if (!(betForDefeated))
187187 then !(betAgainstDefeated)
188188 else false)
189189 then throw("no side approved defeat")
190190 else {
191191 let winnerId = if (betForDefeated)
192192 then betAgainstId
193193 else betForId
194194 let winnerAddress = getStringValue(this, (winnerId + "_owner"))
195195 let amount = extract(getInteger(this, (matchId + "_amount")))
196196 let txid = toBase58String(i.transactionId)
197197 let timestamp = toString(lastBlock.timestamp)
198198 let refAmount = ((amount * totalRef) / 1000)
199- ScriptResult(WriteSet( match getReferer(winnerAddress) {
199+ ScriptResult(WriteSet([DataEntry((matchId + "_paid"), toBase58String(i.transactionId)), match getReferer(winnerAddress) {
200200 case ref1: String =>
201201 let incLevel1 = ((refAmount * level1) / 1000)
202202 let incCashBack = ((refAmount * cashBack) / 1000)
203-[DataEntry((matchId + "_paid"), toBase58String(i.transactionId)), balanceIncrement(winnerAddress, incCashBack), recordBalanceIncrement(winnerAddress, winnerAddress, incCashBack, "cashback", txid, timestamp), balanceIncrement(ref1, incLevel1), recordBalanceIncrement(ref1, winnerAddress, incLevel1, "l1", txid, timestamp), match getReferer(ref1) {
203+[balanceIncrement(winnerAddress, incCashBack), recordBalanceIncrement(winnerAddress, winnerAddress, incCashBack, "cashback", txid, timestamp), balanceIncrement(ref1, incLevel1), recordBalanceIncrement(ref1, winnerAddress, incLevel1, "l1", txid, timestamp), match getReferer(ref1) {
204204 case ref2: String =>
205205 let incLevel2 = ((refAmount * level2) / 1000)
206206 [balanceIncrement(ref2, incLevel2), recordBalanceIncrement(ref2, winnerAddress, incLevel2, "l2", txid, timestamp), match getReferer(ref2) {
207207 case ref3: String =>
208208 let incLevel3 = ((refAmount * level3) / 1000)
209209 [balanceIncrement(ref3, incLevel3), recordBalanceIncrement(ref3, winnerAddress, incLevel3, "l3", txid, timestamp), balanceIncrement(changeAddress, (((refAmount - incLevel1) - incLevel2) - incLevel3)), recordBalanceIncrement(changeAddress, winnerAddress, (((refAmount - incLevel1) - incLevel2) - incLevel3), "change", txid, timestamp)]
210210 case _ =>
211211 [balanceIncrement(changeAddress, ((refAmount - incLevel1) - incLevel2)), recordBalanceIncrement(changeAddress, winnerAddress, ((refAmount - incLevel1) - incLevel2), "change", txid, timestamp)]
212212 }]
213213 case _ =>
214214 [balanceIncrement(changeAddress, (refAmount - incLevel1)), recordBalanceIncrement(changeAddress, winnerAddress, (refAmount - incLevel1), "change", txid, timestamp)]
215215 }]
216216 case _ =>
217217 [balanceIncrement(changeAddress, refAmount), recordBalanceIncrement(changeAddress, winnerAddress, refAmount, "change", txid, timestamp)]
218- }), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), (amount - refAmount), betAssetId)]))
218+ }]), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), (amount - refAmount), betAssetId)]))
219219 }
220220 }
221221
222222
223223
224224 @Callable(i)
225225 func delegate (delegateTo,enableAutoApprove,enableAutoCancel) = repayFee(i, WriteSet([DataEntry((("delegate_" + delegateTo) + "_address"), toBase58String(i.caller.bytes)), DataEntry((("delegate_" + delegateTo) + "_autoapprove"), enableAutoApprove), DataEntry((("delegate_" + delegateTo) + "_autocancel"), enableAutoCancel)]), 0, unit)
226226
227227
228228
229229 @Callable(i)
230230 func withdraw () = if (!(checkFee(i)))
231231 then throw("error")
232232 else {
233233 let owner = toBase58String(i.caller.bytes)
234234 let txid = toBase58String(i.transactionId)
235235 let balanceKey = (owner + "_balance")
236236 let amount = match getInteger(this, balanceKey) {
237237 case b: Int =>
238238 b
239239 case _ =>
240240 0
241241 }
242242 if ((minWithdraw > amount))
243243 then throw(("Min withdraw amount is" + toString(minWithdraw)))
244244 else ScriptResult(WriteSet([DataEntry(balanceKey, 0), DataEntry(((("withdraw_" + owner) + "_") + txid), ((toString(amount) + ":") + toString(lastBlock.timestamp)))]), TransferSet([ScriptTransfer(i.caller, (amount + i.fee), unit)]))
245245 }
246246
247247
248248
249249 @Callable(i)
250250 func register (referer,salt) = if (!(checkFee(i)))
251251 then throw("error")
252252 else if ((take(toBase58String(i.transactionId), 3) != "123"))
253253 then throw("proof of work failed")
254254 else {
255255 let owner = toBase58String(i.caller.bytes)
256256 if (isDefined(getReferer(owner)))
257257 then throw("Already registered")
258258 else ScriptResult(WriteSet([DataEntry((owner + "_referer"), referer), DataEntry(((referer + "_referral_") + owner), owner)]), TransferSet([ScriptTransfer(i.caller, i.fee, unit)]))
259259 }
260260
261261

github/deemru/w8io/026f985 
57.20 ms