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/XAXMBPEnDQ5kqHUHyOfWmXu9KHDHL6zcNNwAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAAZtaW5CZXQAAAAAAABMS0AAAAAAD21pbk1hdGNoTm9taW5hbAAAAAAAAExLQAAAAAAGbGV2ZWwxAAAAAAAAAAD6AAAAAAZsZXZlbDIAAAAAAAAAAJYAAAAABmxldmVsMwAAAAAAAAAAZAAAAAAIY2FzaEJhY2sAAAAAAAAAAfQAAAAACHRvdGFsUmVmAAAAAAAAAAAKAAAAAA1jaGFuZ2VBZGRyZXNzAgAAACMzTkF4c2JIeFM2M2F6ZEFpY1Z2TEdzeGpBUTlEc0s2TDROTAAAAAALbWluV2l0aGRyYXcAAAAAAAAPQkABAAAAE2dldENhbGxlckJ5RGVsZWdhdGUAAAACAAAAAWkAAAAIZnVuY3Rpb24EAAAABmNhbGxlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAxjYWxsZXJQcmVmaXgJAAEsAAAAAgIAAAAJZGVsZWdhdGVfB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: 65XvzpAzJNNnLF7vxdtD65GvYvbM7CoHtzzBqvJSGHJe Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let minMatchNominal = 5000000 | |
11 | 11 | ||
12 | - | let level1 = | |
12 | + | let level1 = 250 | |
13 | 13 | ||
14 | - | let level2 = | |
14 | + | let level2 = 150 | |
15 | 15 | ||
16 | - | let level3 = | |
16 | + | let level3 = 100 | |
17 | 17 | ||
18 | - | let cashBack = 5 | |
18 | + | let cashBack = 500 | |
19 | + | ||
20 | + | let totalRef = 10 | |
19 | 21 | ||
20 | 22 | let changeAddress = "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL" | |
21 | 23 | ||
193 | 195 | let amount = extract(getInteger(this, (matchId + "_amount"))) | |
194 | 196 | let txid = toBase58String(i.transactionId) | |
195 | 197 | let timestamp = toString(lastBlock.timestamp) | |
198 | + | let refAmount = ((amount * totalRef) / 1000) | |
196 | 199 | ScriptResult(WriteSet( match getReferer(winnerAddress) { | |
197 | 200 | case ref1: String => | |
198 | - | let incLevel1 = (( | |
199 | - | let incCashBack = (( | |
201 | + | let incLevel1 = ((refAmount * level1) / 1000) | |
202 | + | let incCashBack = ((refAmount * cashBack) / 1000) | |
200 | 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) { | |
201 | 204 | case ref2: String => | |
202 | - | let incLevel2 = (( | |
205 | + | let incLevel2 = ((refAmount * level2) / 1000) | |
203 | 206 | [balanceIncrement(ref2, incLevel2), recordBalanceIncrement(ref2, winnerAddress, incLevel2, "l2", txid, timestamp), match getReferer(ref2) { | |
204 | 207 | case ref3: String => | |
205 | - | let incLevel3 = (( | |
206 | - | [balanceIncrement(ref3, incLevel3), recordBalanceIncrement(ref3, winnerAddress, incLevel3, "l3", txid, timestamp), balanceIncrement(changeAddress, ((( | |
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)] | |
207 | 210 | case _ => | |
208 | - | [balanceIncrement(changeAddress, (( | |
211 | + | [balanceIncrement(changeAddress, ((refAmount - incLevel1) - incLevel2)), recordBalanceIncrement(changeAddress, winnerAddress, ((refAmount - incLevel1) - incLevel2), "change", txid, timestamp)] | |
209 | 212 | }] | |
210 | 213 | case _ => | |
211 | - | [balanceIncrement(changeAddress, ( | |
214 | + | [balanceIncrement(changeAddress, (refAmount - incLevel1)), recordBalanceIncrement(changeAddress, winnerAddress, (refAmount - incLevel1), "change", txid, timestamp)] | |
212 | 215 | }] | |
213 | 216 | case _ => | |
214 | - | [balanceIncrement(changeAddress, | |
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)])) | |
216 | 219 | } | |
217 | 220 | } | |
218 | 221 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let betAssetId = base58'33kV5hRVtgEGpYqhp9wQn2g9hP1fNWSYGCzzYk1T9Hyg' | |
5 | 5 | ||
6 | 6 | let maxFee = 5000000 | |
7 | 7 | ||
8 | 8 | let minBet = 5000000 | |
9 | 9 | ||
10 | 10 | let minMatchNominal = 5000000 | |
11 | 11 | ||
12 | - | let level1 = | |
12 | + | let level1 = 250 | |
13 | 13 | ||
14 | - | let level2 = | |
14 | + | let level2 = 150 | |
15 | 15 | ||
16 | - | let level3 = | |
16 | + | let level3 = 100 | |
17 | 17 | ||
18 | - | let cashBack = 5 | |
18 | + | let cashBack = 500 | |
19 | + | ||
20 | + | let totalRef = 10 | |
19 | 21 | ||
20 | 22 | let changeAddress = "3NAxsbHxS63azdAicVvLGsxjAQ9DsK6L4NL" | |
21 | 23 | ||
22 | 24 | let minWithdraw = 1000000 | |
23 | 25 | ||
24 | 26 | func getCallerByDelegate (i,function) = { | |
25 | 27 | let caller = toBase58String(i.caller.bytes) | |
26 | 28 | let callerPrefix = ("delegate_" + caller) | |
27 | 29 | if ((getBoolean(this, ((callerPrefix + "_") + function)) == true)) | |
28 | 30 | then match getString(this, (callerPrefix + "_address")) { | |
29 | 31 | case s: String => | |
30 | 32 | s | |
31 | 33 | case _ => | |
32 | 34 | caller | |
33 | 35 | } | |
34 | 36 | else caller | |
35 | 37 | } | |
36 | 38 | ||
37 | 39 | ||
38 | 40 | func checkFee (i) = if ((i.fee > maxFee)) | |
39 | 41 | then throw("unreasonable large fee") | |
40 | 42 | else if ((i.feeAssetId != unit)) | |
41 | 43 | then throw("fee must be in WAVES") | |
42 | 44 | else true | |
43 | 45 | ||
44 | 46 | ||
45 | 47 | func repayFee (i,ws,amount,recipient) = if (checkFee(i)) | |
46 | 48 | then if (if ((amount > 0)) | |
47 | 49 | then isDefined(recipient) | |
48 | 50 | else false) | |
49 | 51 | then ScriptResult(ws, TransferSet([ScriptTransfer(i.caller, i.fee, unit), ScriptTransfer(extract(recipient), amount, betAssetId)])) | |
50 | 52 | else ScriptResult(ws, TransferSet([ScriptTransfer(i.caller, i.fee, unit)])) | |
51 | 53 | else throw("error") | |
52 | 54 | ||
53 | 55 | ||
54 | 56 | func checkOwner (i,betid) = (getString(this, (betid + "_owner")) == toBase58String(i.caller.bytes)) | |
55 | 57 | ||
56 | 58 | ||
57 | 59 | func getUnspent (betid) = (extract(getInteger(this, (betid + "_amount"))) - extract(getInteger(this, (betid + "_spent")))) | |
58 | 60 | ||
59 | 61 | ||
60 | 62 | func isDefeated (betid) = { | |
61 | 63 | let defeatStatus = getInteger(this, (betid + "_defeat")) | |
62 | 64 | if ((defeatStatus == 1)) | |
63 | 65 | then true | |
64 | 66 | else (defeatStatus == 3) | |
65 | 67 | } | |
66 | 68 | ||
67 | 69 | ||
68 | 70 | func getReferer (user) = getString(this, (user + "_referer")) | |
69 | 71 | ||
70 | 72 | ||
71 | 73 | func balanceIncrement (address,inc) = { | |
72 | 74 | let balanceKey = (address + "_balance") | |
73 | 75 | DataEntry(balanceKey, (inc + match getInteger(this, balanceKey) { | |
74 | 76 | case b: Int => | |
75 | 77 | b | |
76 | 78 | case _ => | |
77 | 79 | 0 | |
78 | 80 | })) | |
79 | 81 | } | |
80 | 82 | ||
81 | 83 | ||
82 | 84 | func recordBalanceIncrement (address,owner,inc,level,txId,timestamp) = DataEntry(((("fund_" + address) + "_") + txId), ((((((owner + ":") + toString(inc)) + ":") + level) + ":") + timestamp)) | |
83 | 85 | ||
84 | 86 | ||
85 | 87 | @Callable(i) | |
86 | 88 | func bet (event,subevent,side,odds) = { | |
87 | 89 | let owner = toBase58String(i.caller.bytes) | |
88 | 90 | let payment = extract(i.payment) | |
89 | 91 | if ((payment.assetId != betAssetId)) | |
90 | 92 | then throw(("bet must be in asset " + toBase58String(betAssetId))) | |
91 | 93 | else if ((minBet > payment.amount)) | |
92 | 94 | then throw(("minimum allowed bet is " + toString(minBet))) | |
93 | 95 | else if (if ((side != "for")) | |
94 | 96 | then (side != "against") | |
95 | 97 | else false) | |
96 | 98 | then throw("unexpected side") | |
97 | 99 | else { | |
98 | 100 | let betid = (((((("bet_" + event) + "_") + toBase58String(i.caller.bytes)) + "_") + take(toBase58String(i.transactionId), 15)) + "_") | |
99 | 101 | let sequenceKey = ((("seq_" + event) + "_") + subevent) | |
100 | 102 | let sequence = match getInteger(this, sequenceKey) { | |
101 | 103 | case prevS: Int => | |
102 | 104 | (prevS + 1) | |
103 | 105 | case _ => | |
104 | 106 | 1 | |
105 | 107 | } | |
106 | 108 | 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) | |
107 | 109 | } | |
108 | 110 | } | |
109 | 111 | ||
110 | 112 | ||
111 | 113 | ||
112 | 114 | @Callable(i) | |
113 | 115 | func cancel (betid) = if ((getString(this, (betid + "_owner")) != getCallerByDelegate(i, "autocancel"))) | |
114 | 116 | then throw("must be owner or its delegate to cancel") | |
115 | 117 | else { | |
116 | 118 | let amount = extract(getInteger(this, (betid + "_amount"))) | |
117 | 119 | let spent = extract(getInteger(this, (betid + "_spent"))) | |
118 | 120 | let cancelAmount = (amount - spent) | |
119 | 121 | repayFee(i, WriteSet([DataEntry((betid + "_spent"), amount), DataEntry((betid + "_cancel_amount"), cancelAmount), DataEntry((betid + "_cancel_tx"), toBase58String(i.transactionId))]), cancelAmount, i.caller) | |
120 | 122 | } | |
121 | 123 | ||
122 | 124 | ||
123 | 125 | ||
124 | 126 | @Callable(i) | |
125 | 127 | func betMatch (betFor,betAgainst) = if ((getString(this, (betFor + "_event")) != getString(this, (betAgainst + "_event")))) | |
126 | 128 | then throw("event id must match") | |
127 | 129 | else if ((getString(this, (betFor + "_subevent")) != getString(this, (betAgainst + "_subevent")))) | |
128 | 130 | then throw("subevent id must match") | |
129 | 131 | else if ((getString(this, (betFor + "_side")) != "for")) | |
130 | 132 | then throw("invalid *for* bet") | |
131 | 133 | else if ((getString(this, (betAgainst + "_side")) != "against")) | |
132 | 134 | then throw("invalid *against* bet") | |
133 | 135 | else { | |
134 | 136 | let betForOwner = getStringValue(this, (betFor + "_owner")) | |
135 | 137 | let betAgainstOwner = getStringValue(this, (betAgainst + "_owner")) | |
136 | 138 | let eventid = extract(getString(this, (betFor + "_event"))) | |
137 | 139 | let matchid = (((((((("match_" + eventid) + "_") + takeRight(betForOwner, 10)) + "_") + takeRight(betAgainstOwner, 10)) + "_") + toBase58String(i.transactionId)) + "_") | |
138 | 140 | let odds = extract(getInteger(this, (betFor + "_odds"))) | |
139 | 141 | let unspentFor = getUnspent(betFor) | |
140 | 142 | let unspentAgainst = getUnspent(betAgainst) | |
141 | 143 | let maxForNominal = unspentFor | |
142 | 144 | let maxAgainstNominal = ((unspentAgainst * 100) / (odds - 100)) | |
143 | 145 | let matchNominal = if ((maxForNominal > maxAgainstNominal)) | |
144 | 146 | then maxAgainstNominal | |
145 | 147 | else maxForNominal | |
146 | 148 | if ((minMatchNominal > matchNominal)) | |
147 | 149 | then throw("match nominal too low") | |
148 | 150 | else { | |
149 | 151 | let spendFor = matchNominal | |
150 | 152 | let spendAgainst = ((matchNominal * (odds - 100)) / 100) | |
151 | 153 | let newSpentFor = (spendFor + extract(getInteger(this, (betFor + "_spent")))) | |
152 | 154 | let newSpentAgainst = (spendAgainst + extract(getInteger(this, (betAgainst + "_spent")))) | |
153 | 155 | if ((newSpentFor > extract(getInteger(this, (betFor + "_amount"))))) | |
154 | 156 | then throw("invalid match") | |
155 | 157 | else if ((newSpentAgainst > extract(getInteger(this, (betAgainst + "_amount"))))) | |
156 | 158 | then throw("invalid match") | |
157 | 159 | 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) | |
158 | 160 | } | |
159 | 161 | } | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | ||
163 | 165 | @Callable(i) | |
164 | 166 | func approveDefeat (betId,defeat) = if (if (isDefined(getInteger(this, (betId + "_defeat")))) | |
165 | 167 | then (defeat == 2) | |
166 | 168 | else false) | |
167 | 169 | then throw("can't dispute after approve") | |
168 | 170 | else if ((getString(this, (betId + "_owner")) != getCallerByDelegate(i, "autoapprove"))) | |
169 | 171 | then throw("must be owner or its delegate to approve") | |
170 | 172 | else repayFee(i, WriteSet([DataEntry((betId + "_defeat"), defeat)]), 0, unit) | |
171 | 173 | ||
172 | 174 | ||
173 | 175 | ||
174 | 176 | @Callable(i) | |
175 | 177 | func payWinner (matchId) = if (!(checkFee(i))) | |
176 | 178 | then throw("error") | |
177 | 179 | else if (isDefined(getInteger(this, (matchId + "_paid")))) | |
178 | 180 | then throw("already paid") | |
179 | 181 | else { | |
180 | 182 | let betForId = extract(getString(this, (matchId + "_for"))) | |
181 | 183 | let betAgainstId = extract(getString(this, (matchId + "_against"))) | |
182 | 184 | let betForDefeated = isDefeated(betForId) | |
183 | 185 | let betAgainstDefeated = isDefeated(betAgainstId) | |
184 | 186 | if (if (!(betForDefeated)) | |
185 | 187 | then !(betAgainstDefeated) | |
186 | 188 | else false) | |
187 | 189 | then throw("no side approved defeat") | |
188 | 190 | else { | |
189 | 191 | let winnerId = if (betForDefeated) | |
190 | 192 | then betAgainstId | |
191 | 193 | else betForId | |
192 | 194 | let winnerAddress = getStringValue(this, (winnerId + "_owner")) | |
193 | 195 | let amount = extract(getInteger(this, (matchId + "_amount"))) | |
194 | 196 | let txid = toBase58String(i.transactionId) | |
195 | 197 | let timestamp = toString(lastBlock.timestamp) | |
198 | + | let refAmount = ((amount * totalRef) / 1000) | |
196 | 199 | ScriptResult(WriteSet( match getReferer(winnerAddress) { | |
197 | 200 | case ref1: String => | |
198 | - | let incLevel1 = (( | |
199 | - | let incCashBack = (( | |
201 | + | let incLevel1 = ((refAmount * level1) / 1000) | |
202 | + | let incCashBack = ((refAmount * cashBack) / 1000) | |
200 | 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) { | |
201 | 204 | case ref2: String => | |
202 | - | let incLevel2 = (( | |
205 | + | let incLevel2 = ((refAmount * level2) / 1000) | |
203 | 206 | [balanceIncrement(ref2, incLevel2), recordBalanceIncrement(ref2, winnerAddress, incLevel2, "l2", txid, timestamp), match getReferer(ref2) { | |
204 | 207 | case ref3: String => | |
205 | - | let incLevel3 = (( | |
206 | - | [balanceIncrement(ref3, incLevel3), recordBalanceIncrement(ref3, winnerAddress, incLevel3, "l3", txid, timestamp), balanceIncrement(changeAddress, ((( | |
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)] | |
207 | 210 | case _ => | |
208 | - | [balanceIncrement(changeAddress, (( | |
211 | + | [balanceIncrement(changeAddress, ((refAmount - incLevel1) - incLevel2)), recordBalanceIncrement(changeAddress, winnerAddress, ((refAmount - incLevel1) - incLevel2), "change", txid, timestamp)] | |
209 | 212 | }] | |
210 | 213 | case _ => | |
211 | - | [balanceIncrement(changeAddress, ( | |
214 | + | [balanceIncrement(changeAddress, (refAmount - incLevel1)), recordBalanceIncrement(changeAddress, winnerAddress, (refAmount - incLevel1), "change", txid, timestamp)] | |
212 | 215 | }] | |
213 | 216 | case _ => | |
214 | - | [balanceIncrement(changeAddress, | |
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)])) | |
216 | 219 | } | |
217 | 220 | } | |
218 | 221 | ||
219 | 222 | ||
220 | 223 | ||
221 | 224 | @Callable(i) | |
222 | 225 | 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) | |
223 | 226 | ||
224 | 227 | ||
225 | 228 | ||
226 | 229 | @Callable(i) | |
227 | 230 | func withdraw () = if (!(checkFee(i))) | |
228 | 231 | then throw("error") | |
229 | 232 | else { | |
230 | 233 | let owner = toBase58String(i.caller.bytes) | |
231 | 234 | let txid = toBase58String(i.transactionId) | |
232 | 235 | let balanceKey = (owner + "_balance") | |
233 | 236 | let amount = match getInteger(this, balanceKey) { | |
234 | 237 | case b: Int => | |
235 | 238 | b | |
236 | 239 | case _ => | |
237 | 240 | 0 | |
238 | 241 | } | |
239 | 242 | if ((minWithdraw > amount)) | |
240 | 243 | then throw(("Min withdraw amount is" + toString(minWithdraw))) | |
241 | 244 | else ScriptResult(WriteSet([DataEntry(balanceKey, 0), DataEntry(((("withdraw_" + owner) + "_") + txid), ((toString(amount) + ":") + toString(lastBlock.timestamp)))]), TransferSet([ScriptTransfer(i.caller, (amount + i.fee), unit)])) | |
242 | 245 | } | |
243 | 246 | ||
244 | 247 | ||
245 | 248 | ||
246 | 249 | @Callable(i) | |
247 | 250 | func register (referer,salt) = if (!(checkFee(i))) | |
248 | 251 | then throw("error") | |
249 | 252 | else if ((take(toBase58String(i.transactionId), 3) != "123")) | |
250 | 253 | then throw("proof of work failed") | |
251 | 254 | else { | |
252 | 255 | let owner = toBase58String(i.caller.bytes) | |
253 | 256 | if (isDefined(getReferer(owner))) | |
254 | 257 | then throw("Already registered") | |
255 | 258 | else ScriptResult(WriteSet([DataEntry((owner + "_referer"), referer), DataEntry(((referer + "_referral_") + owner), owner)]), TransferSet([ScriptTransfer(i.caller, i.fee, unit)])) | |
256 | 259 | } | |
257 | 260 | ||
258 | 261 |
github/deemru/w8io/026f985 49.08 ms ◑