tx · DLxWEvxiwsUidWEArdj6diuL3GM88UxGnfEoHdM4jDsh

3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL:  -0.01400000 Waves

2019.08.23 18:20 [643952] smart account 3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL > SELF 0.00000000 Waves

{ "type": 13, "id": "DLxWEvxiwsUidWEArdj6diuL3GM88UxGnfEoHdM4jDsh", "fee": 1400000, "feeAssetId": null, "timestamp": 1566573607315, "version": 1, "sender": "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL", "senderPublicKey": "FbEMepLNcZb6VBpsH5JJg4j43UEV27dMRqv1Pq6JFLgy", "proofs": [ "43PxVPkNRuTMeVNBfXq5y528FCMZCurWXznB48HeS1kMnCJmmW4iy36zkmV8x6AGNcSiwPUyKg3LvkndB5eXVWaS" ], "script": "base64:AAIDAAAAAAAAAAAAAAAUAAAAAApiZXRBc3NldElkAQAAACAea7QCZF/XAXMBPEnDQ5kqHUHyOfWmXu9KHDHL6zcNNwAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAAZtaW5CZXQAAAAAAABMS0AAAAAAD21pbk1hdGNoTm9taW5hbAAAAAAAAExLQAAAAAAGbGV2ZWwxAAAAAAAAAAD6AAAAAAZsZXZlbDIAAAAAAAAAAJYAAAAABmxldmVsMwAAAAAAAAAAZAAAAAAIY2FzaEJhY2sAAAAAAAAAAfQAAAAACHRvdGFsUmVmAAAAAAAAAAAKAAAAAA1jaGFuZ2VBZGRyZXNzAgAAACMzTkF4c2JIeFM2M2F6ZEFpY1Z2TEdzeGpBUTlEc0s2TDROTAAAAAALbWluV2l0aGRyYXcAAAAAAAAPQkABAAAAE2dldENhbGxlckJ5RGVsZWdhdGUAAAACAAAAAWkAAAAIZnVuY3Rpb24EAAAABmNhbGxlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAxjYWxsZXJQcmVmaXgJAAEsAAAAAgIAAAAJZGVsZWdhdGVf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next: 65XvzpAzJNNnLF7vxdtD65GvYvbM7CoHtzzBqvJSGHJe Diff:
OldNewDifferences
99
1010 let minMatchNominal = 5000000
1111
12-let level1 = 3
12+let level1 = 250
1313
14-let level2 = 1
14+let level2 = 150
1515
16-let level3 = 1
16+let level3 = 100
1717
18-let cashBack = 5
18+let cashBack = 500
19+
20+let totalRef = 10
1921
2022 let changeAddress = "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL"
2123
193195 let amount = extract(getInteger(this, (matchId + "_amount")))
194196 let txid = toBase58String(i.transactionId)
195197 let timestamp = toString(lastBlock.timestamp)
198+ let refAmount = ((amount * totalRef) / 1000)
196199 ScriptResult(WriteSet( match getReferer(winnerAddress) {
197200 case ref1: String =>
198- let incLevel1 = ((amount * level1) / 1000)
199- let incCashBack = ((amount * cashBack) / 1000)
201+ let incLevel1 = ((refAmount * level1) / 1000)
202+ let incCashBack = ((refAmount * cashBack) / 1000)
200203 [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) {
201204 case ref2: String =>
202- let incLevel2 = ((amount * level2) / 1000)
205+ let incLevel2 = ((refAmount * level2) / 1000)
203206 [balanceIncrement(ref2, incLevel2), recordBalanceIncrement(ref2, winnerAddress, incLevel2, "l2", txid, timestamp), match getReferer(ref2) {
204207 case ref3: String =>
205- let incLevel3 = ((amount * level3) / 1000)
206-[balanceIncrement(ref3, incLevel3), recordBalanceIncrement(ref3, winnerAddress, incLevel3, "l3", txid, timestamp), balanceIncrement(changeAddress, (((amount - incLevel1) - incLevel2) - incLevel3)), recordBalanceIncrement(changeAddress, winnerAddress, (((amount - incLevel1) - incLevel2) - incLevel3), "change", txid, timestamp)]
208+ let incLevel3 = ((refAmount * level3) / 1000)
209+[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)]
207210 case _ =>
208-[balanceIncrement(changeAddress, ((amount - incLevel1) - incLevel2)), recordBalanceIncrement(changeAddress, winnerAddress, ((amount - incLevel1) - incLevel2), "change", txid, timestamp)]
211+[balanceIncrement(changeAddress, ((refAmount - incLevel1) - incLevel2)), recordBalanceIncrement(changeAddress, winnerAddress, ((refAmount - incLevel1) - incLevel2), "change", txid, timestamp)]
209212 }]
210213 case _ =>
211-[balanceIncrement(changeAddress, (amount - incLevel1)), recordBalanceIncrement(changeAddress, winnerAddress, (amount - incLevel1), "change", txid, timestamp)]
214+[balanceIncrement(changeAddress, (refAmount - incLevel1)), recordBalanceIncrement(changeAddress, winnerAddress, (refAmount - incLevel1), "change", txid, timestamp)]
212215 }]
213216 case _ =>
214-[balanceIncrement(changeAddress, amount), recordBalanceIncrement(changeAddress, winnerAddress, amount, "change", txid, timestamp)]
215- }), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), amount, betAssetId)]))
217+[balanceIncrement(changeAddress, refAmount), recordBalanceIncrement(changeAddress, winnerAddress, refAmount, "change", txid, timestamp)]
218+ }), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), (amount - refAmount), betAssetId)]))
216219 }
217220 }
218221
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
12-let level1 = 3
12+let level1 = 250
1313
14-let level2 = 1
14+let level2 = 150
1515
16-let level3 = 1
16+let level3 = 100
1717
18-let cashBack = 5
18+let cashBack = 500
19+
20+let totalRef = 10
1921
2022 let changeAddress = "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL"
2123
2224 let minWithdraw = 1000000
2325
2426 func getCallerByDelegate (i,function) = {
2527 let caller = toBase58String(i.caller.bytes)
2628 let callerPrefix = ("delegate_" + caller)
2729 if ((getBoolean(this, ((callerPrefix + "_") + function)) == true))
2830 then match getString(this, (callerPrefix + "_address")) {
2931 case s: String =>
3032 s
3133 case _ =>
3234 caller
3335 }
3436 else caller
3537 }
3638
3739
3840 func checkFee (i) = if ((i.fee > maxFee))
3941 then throw("unreasonable large fee")
4042 else if ((i.feeAssetId != unit))
4143 then throw("fee must be in WAVES")
4244 else true
4345
4446
4547 func repayFee (i,ws,amount,recipient) = if (checkFee(i))
4648 then if (if ((amount > 0))
4749 then isDefined(recipient)
4850 else false)
4951 then ScriptResult(ws, TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(extract(recipient), amount, betAssetId)]))
5052 else ScriptResult(ws, TransferSet([ScriptTransfer(i.caller, i.fee, unit)]))
5153 else throw("error")
5254
5355
5456 func checkOwner (i,betid) = (getString(this, (betid + "_owner")) == toBase58String(i.caller.bytes))
5557
5658
5759 func getUnspent (betid) = (extract(getInteger(this, (betid + "_amount"))) - extract(getInteger(this, (betid + "_spent"))))
5860
5961
6062 func isDefeated (betid) = {
6163 let defeatStatus = getInteger(this, (betid + "_defeat"))
6264 if ((defeatStatus == 1))
6365 then true
6466 else (defeatStatus == 3)
6567 }
6668
6769
6870 func getReferer (user) = getString(this, (user + "_referer"))
6971
7072
7173 func balanceIncrement (address,inc) = {
7274 let balanceKey = (address + "_balance")
7375 DataEntry(balanceKey, (inc + match getInteger(this, balanceKey) {
7476 case b: Int =>
7577 b
7678 case _ =>
7779 0
7880 }))
7981 }
8082
8183
8284 func recordBalanceIncrement (address,owner,inc,level,txId,timestamp) = DataEntry(((("fund_" + address) + "_") + txId), ((((((owner + ":") + toString(inc)) + ":") + level) + ":") + timestamp))
8385
8486
8587 @Callable(i)
8688 func bet (event,subevent,side,odds) = {
8789 let owner = toBase58String(i.caller.bytes)
8890 let payment = extract(i.payment)
8991 if ((payment.assetId != betAssetId))
9092 then throw(("bet must be in asset " + toBase58String(betAssetId)))
9193 else if ((minBet > payment.amount))
9294 then throw(("minimum allowed bet is " + toString(minBet)))
9395 else if (if ((side != "for"))
9496 then (side != "against")
9597 else false)
9698 then throw("unexpected side")
9799 else {
98100 let betid = (((((("bet_" + event) + "_") + toBase58String(i.caller.bytes)) + "_") + take(toBase58String(i.transactionId), 15)) + "_")
99101 let sequenceKey = ((("seq_" + event) + "_") + subevent)
100102 let sequence = match getInteger(this, sequenceKey) {
101103 case prevS: Int =>
102104 (prevS + 1)
103105 case _ =>
104106 1
105107 }
106108 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)
107109 }
108110 }
109111
110112
111113
112114 @Callable(i)
113115 func cancel (betid) = if ((getString(this, (betid + "_owner")) != getCallerByDelegate(i, "autocancel")))
114116 then throw("must be owner or its delegate to cancel")
115117 else {
116118 let amount = extract(getInteger(this, (betid + "_amount")))
117119 let spent = extract(getInteger(this, (betid + "_spent")))
118120 let cancelAmount = (amount - spent)
119121 repayFee(i, WriteSet([DataEntry((betid + "_spent"), amount), DataEntry((betid + "_cancel_amount"), cancelAmount), DataEntry((betid + "_cancel_tx"), toBase58String(i.transactionId))]), cancelAmount, i.caller)
120122 }
121123
122124
123125
124126 @Callable(i)
125127 func betMatch (betFor,betAgainst) = if ((getString(this, (betFor + "_event")) != getString(this, (betAgainst + "_event"))))
126128 then throw("event id must match")
127129 else if ((getString(this, (betFor + "_subevent")) != getString(this, (betAgainst + "_subevent"))))
128130 then throw("subevent id must match")
129131 else if ((getString(this, (betFor + "_side")) != "for"))
130132 then throw("invalid *for* bet")
131133 else if ((getString(this, (betAgainst + "_side")) != "against"))
132134 then throw("invalid *against* bet")
133135 else {
134136 let betForOwner = getStringValue(this, (betFor + "_owner"))
135137 let betAgainstOwner = getStringValue(this, (betAgainst + "_owner"))
136138 let eventid = extract(getString(this, (betFor + "_event")))
137139 let matchid = (((((((("match_" + eventid) + "_") + takeRight(betForOwner, 10)) + "_") + takeRight(betAgainstOwner, 10)) + "_") + toBase58String(i.transactionId)) + "_")
138140 let odds = extract(getInteger(this, (betFor + "_odds")))
139141 let unspentFor = getUnspent(betFor)
140142 let unspentAgainst = getUnspent(betAgainst)
141143 let maxForNominal = unspentFor
142144 let maxAgainstNominal = ((unspentAgainst * 100) / (odds - 100))
143145 let matchNominal = if ((maxForNominal > maxAgainstNominal))
144146 then maxAgainstNominal
145147 else maxForNominal
146148 if ((minMatchNominal > matchNominal))
147149 then throw("match nominal too low")
148150 else {
149151 let spendFor = matchNominal
150152 let spendAgainst = ((matchNominal * (odds - 100)) / 100)
151153 let newSpentFor = (spendFor + extract(getInteger(this, (betFor + "_spent"))))
152154 let newSpentAgainst = (spendAgainst + extract(getInteger(this, (betAgainst + "_spent"))))
153155 if ((newSpentFor > extract(getInteger(this, (betFor + "_amount")))))
154156 then throw("invalid match")
155157 else if ((newSpentAgainst > extract(getInteger(this, (betAgainst + "_amount")))))
156158 then throw("invalid match")
157159 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)
158160 }
159161 }
160162
161163
162164
163165 @Callable(i)
164166 func approveDefeat (betId,defeat) = if (if (isDefined(getInteger(this, (betId + "_defeat"))))
165167 then (defeat == 2)
166168 else false)
167169 then throw("can't dispute after approve")
168170 else if ((getString(this, (betId + "_owner")) != getCallerByDelegate(i, "autoapprove")))
169171 then throw("must be owner or its delegate to approve")
170172 else repayFee(i, WriteSet([DataEntry((betId + "_defeat"), defeat)]), 0, unit)
171173
172174
173175
174176 @Callable(i)
175177 func payWinner (matchId) = if (!(checkFee(i)))
176178 then throw("error")
177179 else if (isDefined(getInteger(this, (matchId + "_paid"))))
178180 then throw("already paid")
179181 else {
180182 let betForId = extract(getString(this, (matchId + "_for")))
181183 let betAgainstId = extract(getString(this, (matchId + "_against")))
182184 let betForDefeated = isDefeated(betForId)
183185 let betAgainstDefeated = isDefeated(betAgainstId)
184186 if (if (!(betForDefeated))
185187 then !(betAgainstDefeated)
186188 else false)
187189 then throw("no side approved defeat")
188190 else {
189191 let winnerId = if (betForDefeated)
190192 then betAgainstId
191193 else betForId
192194 let winnerAddress = getStringValue(this, (winnerId + "_owner"))
193195 let amount = extract(getInteger(this, (matchId + "_amount")))
194196 let txid = toBase58String(i.transactionId)
195197 let timestamp = toString(lastBlock.timestamp)
198+ let refAmount = ((amount * totalRef) / 1000)
196199 ScriptResult(WriteSet( match getReferer(winnerAddress) {
197200 case ref1: String =>
198- let incLevel1 = ((amount * level1) / 1000)
199- let incCashBack = ((amount * cashBack) / 1000)
201+ let incLevel1 = ((refAmount * level1) / 1000)
202+ let incCashBack = ((refAmount * cashBack) / 1000)
200203 [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) {
201204 case ref2: String =>
202- let incLevel2 = ((amount * level2) / 1000)
205+ let incLevel2 = ((refAmount * level2) / 1000)
203206 [balanceIncrement(ref2, incLevel2), recordBalanceIncrement(ref2, winnerAddress, incLevel2, "l2", txid, timestamp), match getReferer(ref2) {
204207 case ref3: String =>
205- let incLevel3 = ((amount * level3) / 1000)
206-[balanceIncrement(ref3, incLevel3), recordBalanceIncrement(ref3, winnerAddress, incLevel3, "l3", txid, timestamp), balanceIncrement(changeAddress, (((amount - incLevel1) - incLevel2) - incLevel3)), recordBalanceIncrement(changeAddress, winnerAddress, (((amount - incLevel1) - incLevel2) - incLevel3), "change", txid, timestamp)]
208+ let incLevel3 = ((refAmount * level3) / 1000)
209+[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)]
207210 case _ =>
208-[balanceIncrement(changeAddress, ((amount - incLevel1) - incLevel2)), recordBalanceIncrement(changeAddress, winnerAddress, ((amount - incLevel1) - incLevel2), "change", txid, timestamp)]
211+[balanceIncrement(changeAddress, ((refAmount - incLevel1) - incLevel2)), recordBalanceIncrement(changeAddress, winnerAddress, ((refAmount - incLevel1) - incLevel2), "change", txid, timestamp)]
209212 }]
210213 case _ =>
211-[balanceIncrement(changeAddress, (amount - incLevel1)), recordBalanceIncrement(changeAddress, winnerAddress, (amount - incLevel1), "change", txid, timestamp)]
214+[balanceIncrement(changeAddress, (refAmount - incLevel1)), recordBalanceIncrement(changeAddress, winnerAddress, (refAmount - incLevel1), "change", txid, timestamp)]
212215 }]
213216 case _ =>
214-[balanceIncrement(changeAddress, amount), recordBalanceIncrement(changeAddress, winnerAddress, amount, "change", txid, timestamp)]
215- }), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), amount, betAssetId)]))
217+[balanceIncrement(changeAddress, refAmount), recordBalanceIncrement(changeAddress, winnerAddress, refAmount, "change", txid, timestamp)]
218+ }), TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(addressFromStringValue(winnerAddress), (amount - refAmount), betAssetId)]))
216219 }
217220 }
218221
219222
220223
221224 @Callable(i)
222225 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)
223226
224227
225228
226229 @Callable(i)
227230 func withdraw () = if (!(checkFee(i)))
228231 then throw("error")
229232 else {
230233 let owner = toBase58String(i.caller.bytes)
231234 let txid = toBase58String(i.transactionId)
232235 let balanceKey = (owner + "_balance")
233236 let amount = match getInteger(this, balanceKey) {
234237 case b: Int =>
235238 b
236239 case _ =>
237240 0
238241 }
239242 if ((minWithdraw > amount))
240243 then throw(("Min withdraw amount is" + toString(minWithdraw)))
241244 else ScriptResult(WriteSet([DataEntry(balanceKey, 0), DataEntry(((("withdraw_" + owner) + "_") + txid), ((toString(amount) + ":") + toString(lastBlock.timestamp)))]), TransferSet([ScriptTransfer(i.caller, (amount + i.fee), unit)]))
242245 }
243246
244247
245248
246249 @Callable(i)
247250 func register (referer,salt) = if (!(checkFee(i)))
248251 then throw("error")
249252 else if ((take(toBase58String(i.transactionId), 3) != "123"))
250253 then throw("proof of work failed")
251254 else {
252255 let owner = toBase58String(i.caller.bytes)
253256 if (isDefined(getReferer(owner)))
254257 then throw("Already registered")
255258 else ScriptResult(WriteSet([DataEntry((owner + "_referer"), referer), DataEntry(((referer + "_referral_") + owner), owner)]), TransferSet([ScriptTransfer(i.caller, i.fee, unit)]))
256259 }
257260
258261

github/deemru/w8io/026f985 
49.08 ms