tx · 7f1Pq4yXqoxPoecpZChA3DZKTBvQYSWWYyqWLZQXfpru

3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY:  -0.01400000 Waves

2020.10.06 19:37 [1208954] smart account 3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY > SELF 0.00000000 Waves

{ "type": 13, "id": "7f1Pq4yXqoxPoecpZChA3DZKTBvQYSWWYyqWLZQXfpru", "fee": 1400000, "feeAssetId": null, "timestamp": 1602002301566, "version": 2, "chainId": 84, "sender": "3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY", "senderPublicKey": "HhWoKsFPjXVx9nYfPydpV9BwLmuUdJyJ8ydtyVJVxg9Z", "proofs": [ "657DkvRGfpuBFCpHHJk7Lp42CaMvtMyhsGsKkwYgRZwH82Y9TXNuvnDm8y6xJx68umGnYRSztDeXB7Bx5MVGGsw3" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAAC2Jsb2NrSGVpZ2h0CAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIGhvZGwgd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQkAAGgAAAACCQAAaQAAAAIIBQAAAANwbXQA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AAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQUAAAAJbmV3QW1vdW50AgAAAAFfCQABkQAAAAIFAAAAB29sZERhdGEAAAAAAAAAAAECAAAAAV8JAAGkAAAAAQUAAAALc3VtV2l0aGRyYXcCAAAAJV94eHh4eHh4eHh4eHhfZnJvbS10ZXN0KG1heFdpdGhkcmF3KToJAAGkAAAAAQUAAAALbWF4V2l0aGRyYXcCAAAAE19mcm9tLXRlc3QoYW1vdW50KToJAAGkAAAAAQUAAAAGYW1vdW50AgAAACBfZnJvbS10ZXN0KGJsb2NrLWFmdGVyLWRlcG9zaXQpOgkAAaQAAAABCQAAZQAAAAIFAAAAD2Zyb3N0QmxvY2tDb3VudAkAAGUAAAACBQAAABJkZWZyb3N0QmxvY2tIZWlnaHQFAAAAC2Jsb2NrSGVpZ2h0AgAAABpfZnJvbS10ZXN0KHN1bS1mb3ItYmxvY2spOgkAAaQAAAABCQAAaQAAAAIFAAAACW9sZEFtb3VudAUAAAAPZnJvc3RCbG9ja0NvdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAACkNLcg", "height": 1208954, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BCFdp41PNuLxpN8ysjKYA3fMmMkYx1gaZdonzi5JYnWc Next: BaQuEuyBRetmGkUu4NAs9ze2gtcKycVDeaYGeg45jBRA Diff:
OldNewDifferences
5959 then throw(("Max sum: " + toString(p)))
6060 else if ((0 > l))
6161 then throw("Not enough balance")
62- else ScriptResult(WriteSet([DataEntry(d, ((((((((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_from-test(maxWithdraw):") + toString(p)) + "_||||||||||||||||||||_from-test(amount):") + toString(i)) + "_from-test(block-after-deposit):") + toString((j - (n - c)))) + "_from-test(sum-for-block):") + toString((k / j))))]), TransferSet([ScriptTransfer(a.caller, i, unit)]))
62+ else ScriptResult(WriteSet([DataEntry(d, ((((((((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_xxxxxxxxxxxx_from-test(maxWithdraw):") + toString(p)) + "_from-test(amount):") + toString(i)) + "_from-test(block-after-deposit):") + toString((j - (n - c)))) + "_from-test(sum-for-block):") + toString((k / j))))]), TransferSet([ScriptTransfer(a.caller, i, unit)]))
6363 }
6464
6565
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
77 func deposit () = {
88 let b = extract(a.payment)
99 let c = lastBlock.height
1010 if (isDefined(b.assetId))
1111 then throw("can hodl waves only at the moment")
1212 else {
1313 let d = toBase58String(a.caller.bytes)
1414 if (!(isDefined(getString(this, d))))
1515 then WriteSet([DataEntry(d, (((toString(((b.amount / 100) * 120)) + "_") + toString(c)) + "_0"))])
1616 else {
1717 let e = split({
1818 let f = getString(this, d)
1919 if ($isInstanceOf(f, "String"))
2020 then {
2121 let g = f
2222 g
2323 }
2424 else throw("error")
2525 }, "_")
2626 let h = parseIntValue(e[0])
2727 WriteSet([DataEntry(d, ((((toString((h + ((b.amount / 100) * 12000))) + "_") + toString(c)) + "_") + e[2]))])
2828 }
2929 }
3030 }
3131
3232
3333
3434 @Callable(a)
3535 func withdraw (i) = {
3636 let j = 1
3737 let d = toBase58String(a.caller.bytes)
3838 let e = split({
3939 let f = getString(this, d)
4040 if ($isInstanceOf(f, "String"))
4141 then {
4242 let g = f
4343 g
4444 }
4545 else throw("error")
4646 }, "_")
4747 let k = parseIntValue(e[0])
4848 let l = (k - i)
4949 let c = lastBlock.height
5050 let m = parseIntValue(e[1])
5151 let n = (m + j)
5252 let o = (parseIntValue(e[2]) + i)
5353 let p = if ((c >= n))
5454 then k
5555 else ((j - (n - c)) * (k / j))
5656 if ((0 > i))
5757 then throw("Can't withdraw negative amount")
5858 else if ((i > p))
5959 then throw(("Max sum: " + toString(p)))
6060 else if ((0 > l))
6161 then throw("Not enough balance")
62- else ScriptResult(WriteSet([DataEntry(d, ((((((((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_from-test(maxWithdraw):") + toString(p)) + "_||||||||||||||||||||_from-test(amount):") + toString(i)) + "_from-test(block-after-deposit):") + toString((j - (n - c)))) + "_from-test(sum-for-block):") + toString((k / j))))]), TransferSet([ScriptTransfer(a.caller, i, unit)]))
62+ else ScriptResult(WriteSet([DataEntry(d, ((((((((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_xxxxxxxxxxxx_from-test(maxWithdraw):") + toString(p)) + "_from-test(amount):") + toString(i)) + "_from-test(block-after-deposit):") + toString((j - (n - c)))) + "_from-test(sum-for-block):") + toString((k / j))))]), TransferSet([ScriptTransfer(a.caller, i, unit)]))
6363 }
6464
6565

github/deemru/w8io/026f985 
30.34 ms