tx · DRPS2GubMdKx99a7UaqyrzRstnZdCZaWWYjo4mSAyahm

3N1WYGqfoXEG9F7UvMfHqSEyphXEDuAMvDB:  -0.01400000 Waves

2019.07.05 19:58 [572467] smart account 3N1WYGqfoXEG9F7UvMfHqSEyphXEDuAMvDB > SELF 0.00000000 Waves

{ "type": 13, "id": "DRPS2GubMdKx99a7UaqyrzRstnZdCZaWWYjo4mSAyahm", "fee": 1400000, "feeAssetId": null, "timestamp": 1562345932147, "version": 1, "sender": "3N1WYGqfoXEG9F7UvMfHqSEyphXEDuAMvDB", "senderPublicKey": "3Vwh6XFkVS7FzMVfQLSNEUG48z7YumcE7bSNqmRo7k69", "proofs": [ "4gpotBpaLELmWXVLsU6xzwYjYX9StjYphGNCMUUzEyRWZPnQc2AKvCyjA4pXguB1HmfzTWXX7HkZMb7oWjCgvc5V" ], "script": "base64:AAIDAAAAAAAAAAAAAAAMAAAAAAZsZXZlbDEAAAAAAAAAAPoAAAAABmxldmVsMgAAAAAAAAAA+gAAAAAGbGV2ZWwzAAAAAAAAAAD6AAAAAAhjYXNoQmFjawAAAAAAAAAA+gAAAAAGbWF4RmVlAAAAAAAATEtAAAAAAAttaW5XaXRoZHJhdwAAAAAAAA9CQAAAAAAOY2hhbmdlT3duZXJLZXkCAAAALEFEMnZienBSM1pNWGlZMVpoQmRxNGlIMXd6NXc2dFVDSFB6MXZ2TmZ5Q3FFAQAAABBiYWxhbmNlSW5jcmVtZW50AAAAAgAAAAdhZGRyZXNzAAAAA2luYwQAAAAKYmFsYW5jZUtleQkAASwAAAACBQAAAAdhZGRyZXNzAgAAAAhfYmFsYW5jZQkBAAAACURhdGFFbnRyeQAAAAIFAAAACmJhbGFuY2VLZXkJAABkAAAAAgUAAAADaW5jBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmJhbGFuY2VLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAA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ZXRSZWZlcmVyAAAAAQUAAAAHcmVmZXJlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAhyZWZlcmVyMgUAAAAHJG1hdGNoMAkAASwAAAACCQABLAAAAAICAAAAASwFAAAACHJlZmVyZXIyBAAAAAckbWF0Y2gxCQEAAAAKZ2V0UmVmZXJlcgAAAAEFAAAACHJlZmVyZXIyAwkAAAEAAAACBQAAAAckbWF0Y2gxAgAAAAZTdHJpbmcEAAAACHJlZmVyZXIzBQAAAAckbWF0Y2gxCQABLAAAAAICAAAAASwFAAAACHJlZmVyZXIzAgAAAAACAAAAAAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAFb3duZXICAAAACF9yZWZlcmVyBQAAAAdyZWZlcmVyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAtyZWZlcmFsc0tleQUAAAAIcmVmZXJhbHMJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAFb3duZXICAAAADV9yZWZzdHJ1Y3R1cmUFAAAADHJlZlN0cnVjdHVyZQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcggFAAAAAWkAAAADZmVlBQAAAAR1bml0BQAAAANuaWwAAAAA/gqiWA==", "chainId": 84, "height": 572467, "spentComplexity": 0 } View: original | compacted Prev: Cc1ju72eztdrxq1cZ4KMGWKVnKMhtZW8bDU4QLyC5QjC Next: ExYYRLYjt31HtRiRe7ApstB5yJpowHFTPPCRTLmqaWVp Diff:
OldNewDifferences
2626 }
2727
2828
29-func recordBalanceIncrement (address,owner,inc,level,txId,timestamp) = DataEntry(("fund_" + txId), (((((((address + ":") + owner) + ":") + toString(inc)) + ":") + level) + ":"))
29+func recordBalanceIncrement (address,owner,inc,level,txId,timestamp) = DataEntry(((("fund_" + address) + "_") + txId), (((((((address + ":") + owner) + ":") + toString(inc)) + ":") + level) + ":"))
3030
3131
3232 func getReferer (user) = getString(this, (user + "_referer"))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let level1 = 250
55
66 let level2 = 250
77
88 let level3 = 250
99
1010 let cashBack = 250
1111
1212 let maxFee = 5000000
1313
1414 let minWithdraw = 1000000
1515
1616 let changeOwnerKey = "AD2vbzpR3ZMXiY1ZhBdq4iH1wz5w6tUCHPz1vvNfyCqE"
1717
1818 func balanceIncrement (address,inc) = {
1919 let balanceKey = (address + "_balance")
2020 DataEntry(balanceKey, (inc + match getInteger(this, balanceKey) {
2121 case b: Int =>
2222 b
2323 case _ =>
2424 0
2525 }))
2626 }
2727
2828
29-func recordBalanceIncrement (address,owner,inc,level,txId,timestamp) = DataEntry(("fund_" + txId), (((((((address + ":") + owner) + ":") + toString(inc)) + ":") + level) + ":"))
29+func recordBalanceIncrement (address,owner,inc,level,txId,timestamp) = DataEntry(((("fund_" + address) + "_") + txId), (((((((address + ":") + owner) + ":") + toString(inc)) + ":") + level) + ":"))
3030
3131
3232 func getReferer (user) = getString(this, (user + "_referer"))
3333
3434
3535 func checkFee (i) = if ((i.fee > maxFee))
3636 then throw("unreasonable large fee")
3737 else true
3838
3939
4040 func getTimestamp () = {
4141 let block = extract(blockInfoByHeight(height))
4242 toString(block.timestamp)
4343 }
4444
4545
4646 @Callable(i)
4747 func fund () = {
4848 let owner = toBase58String(i.caller.bytes)
4949 let txid = toBase58String(i.transactionId)
5050 let timestamp = getTimestamp()
5151 let amount = extract(i.payment).amount
5252 let cf = checkFee(i)
5353 ScriptResult(WriteSet( match getString(this, (owner + "_refstructure")) {
5454 case refListS: String =>
5555 let refList = split(refListS, ",")
5656 let refListSize = size(refList)
5757 let incLevel1 = ((amount * level1) / 1000)
5858 let incCashBack = ((amount * cashBack) / 1000)
5959 [balanceIncrement(owner, incCashBack), recordBalanceIncrement(owner, owner, incCashBack, "_txs_cashback", txid, timestamp), balanceIncrement(refList[0], incLevel1), recordBalanceIncrement(refList[0], owner, incLevel1, "_txs_l1", txid, timestamp), if ((refListSize >= 2))
6060 then {
6161 let incLevel2 = ((amount * level2) / 1000)
6262 [balanceIncrement(refList[1], incLevel2), recordBalanceIncrement(refList[1], owner, incLevel2, "_txs_l2", txid, timestamp), if ((refListSize >= 3))
6363 then {
6464 let incLevel3 = ((amount * level3) / 1000)
6565 [balanceIncrement(refList[2], incLevel3), recordBalanceIncrement(refList[2], owner, incLevel3, "_txs_l3", txid, timestamp), balanceIncrement(changeOwnerKey, (((amount - incLevel1) - incLevel2) - incLevel3)), recordBalanceIncrement(changeOwnerKey, owner, (((amount - incLevel1) - incLevel2) - incLevel3), "_txs_change", txid, timestamp)]
6666 }
6767 else [balanceIncrement(changeOwnerKey, ((amount - incLevel1) - incLevel2)), recordBalanceIncrement(changeOwnerKey, owner, ((amount - incLevel1) - incLevel2), "_txs_change", txid, timestamp)]]
6868 }
6969 else [balanceIncrement(changeOwnerKey, (amount - incLevel1)), recordBalanceIncrement(changeOwnerKey, owner, (amount - incLevel1), "_txs_change", txid, timestamp)]]
7070 case _ =>
7171 [balanceIncrement(changeOwnerKey, amount), recordBalanceIncrement(changeOwnerKey, owner, amount, "_txs_change", txid, timestamp)]
7272 }), TransferSet([ScriptTransfer(i.caller, i.fee, unit)]))
7373 }
7474
7575
7676
7777 @Callable(i)
7878 func withdraw () = {
7979 let cf = checkFee(i)
8080 let owner = toBase58String(i.caller.bytes)
8181 let balanceKey = (owner + "_balance")
8282 let amount = match getInteger(this, balanceKey) {
8383 case b: Int =>
8484 b
8585 case _ =>
8686 0
8787 }
8888 if ((minWithdraw > amount))
8989 then throw(("Min withdraw amount is" + toString(minWithdraw)))
9090 else {
9191 let withdrawTxKey = (owner + "_withdraw_txs")
9292 let record = ((((toString(amount) + ":") + toBase58String(i.transactionId)) + ":") + getTimestamp())
9393 let withdrawTxList = match getString(this, withdrawTxKey) {
9494 case prevTxs: String =>
9595 ((prevTxs + ",") + record)
9696 case _ =>
9797 record
9898 }
9999 ScriptResult(WriteSet([DataEntry(balanceKey, 0), DataEntry(withdrawTxKey, withdrawTxList)]), TransferSet([ScriptTransfer(i.caller, (amount + i.fee), unit)]))
100100 }
101101 }
102102
103103
104104
105105 @Callable(i)
106106 func register (referer,salt) = {
107107 let cf = checkFee(i)
108108 if ((take(toBase58String(i.transactionId), 3) != "123"))
109109 then throw("proof of work failed")
110110 else {
111111 let owner = toBase58String(i.caller.bytes)
112112 if (isDefined(getReferer(owner)))
113113 then throw("Already registered")
114114 else {
115115 let referalsKey = (referer + "_referrals")
116116 let referals = match getString(this, referalsKey) {
117117 case oldRefs: String =>
118118 ((oldRefs + ",") + owner)
119119 case _ =>
120120 owner
121121 }
122122 let refStructure = (referer + match getReferer(referer) {
123123 case referer2: String =>
124124 (("," + referer2) + match getReferer(referer2) {
125125 case referer3: String =>
126126 ("," + referer3)
127127 case _ =>
128128 ""
129129 })
130130 case _ =>
131131 ""
132132 })
133133 ScriptResult(WriteSet([DataEntry((owner + "_referer"), referer), DataEntry(referalsKey, referals), DataEntry((owner + "_refstructure"), refStructure)]), TransferSet([ScriptTransfer(i.caller, i.fee, unit)]))
134134 }
135135 }
136136 }
137137
138138

github/deemru/w8io/026f985 
29.14 ms