tx · FxvC6nSm2dhvMcRt6EE7SJX1y5sxrhwi2aDW3EaXgxaK

3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY:  -0.01400000 Waves

2020.10.06 19:03 [1208918] smart account 3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY > SELF 0.00000000 Waves

{ "type": 13, "id": "FxvC6nSm2dhvMcRt6EE7SJX1y5sxrhwi2aDW3EaXgxaK", "fee": 1400000, "feeAssetId": null, "timestamp": 1602000202552, "version": 2, "chainId": 84, "sender": "3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY", "senderPublicKey": "HhWoKsFPjXVx9nYfPydpV9BwLmuUdJyJ8ydtyVJVxg9Z", "proofs": [ "5M7j5H8VwEvkuJGPTAKndMvWMkX4aGPVkVm4qXtZAhEPKoJHUPL5dKpWArs3FnRcD5TgpC2VkwNQvL3QrPJesUoC" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAAC2Jsb2NrSGVpZ2h0CAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIGhvZGwgd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQkAAGgAAAACCQAAaQAAAAIIBQAAAANwbXQA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AAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAAaQAAAABBQAAAAluZXdBbW91bnQCAAAAAV8JAAGRAAAAAgUAAAAHb2xkRGF0YQAAAAAAAAAAAQIAAAABXwkAAaQAAAABBQAAAAtzdW1XaXRoZHJhdwIAAAABXwkAAaQAAAABCQAAZQAAAAIFAAAAD2Zyb3N0QmxvY2tDb3VudAkAAGkAAAACBQAAAAlvbGRBbW91bnQFAAAAD2Zyb3N0QmxvY2tDb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAx4RF/g==", "height": 1208918, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2qhDo49dzg19cZ5LQnmZoACCCb5uKZSb9yKEorEK6B1z Next: 2sCu9qqQGnuKkwUvFLx6mpRTCdPtJ8Ck88W8YTS3d6tT Diff:
OldNewDifferences
5454 let o = (parseIntValue(e[2]) + j)
5555 let p = if ((c >= n))
5656 then k
57- else ((n - c) * (i - (k / i)))
57+ else ((n - c) * (k / i))
5858 if ((0 > j))
5959 then throw("Can't withdraw negative amount")
6060 else if ((j > p))
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) * 120))) + "_") + toString(c)) + "_") + e[2]))])
2828 }
2929 }
3030 }
3131
3232
3333
3434 @Callable(a)
3535 func withdraw () = {
3636 let i = 100
3737 let b = extract(a.payment)
3838 let j = b.amount
3939 let d = toBase58String(a.caller.bytes)
4040 let e = split({
4141 let f = getString(this, d)
4242 if ($isInstanceOf(f, "String"))
4343 then {
4444 let g = f
4545 g
4646 }
4747 else throw("error")
4848 }, "_")
4949 let k = parseIntValue(e[0])
5050 let l = (k - j)
5151 let c = lastBlock.height
5252 let m = parseIntValue(e[1])
5353 let n = (m + i)
5454 let o = (parseIntValue(e[2]) + j)
5555 let p = if ((c >= n))
5656 then k
57- else ((n - c) * (i - (k / i)))
57+ else ((n - c) * (k / i))
5858 if ((0 > j))
5959 then throw("Can't withdraw negative amount")
6060 else if ((j > p))
6161 then throw((("Max sum: " + toString((p / 100000000))) + " Waves"))
6262 else if ((0 > l))
6363 then throw("Not enough balance")
6464 else ScriptResult(WriteSet([DataEntry(d, ((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_") + toString((i - (k / i)))))]), TransferSet([ScriptTransfer(a.caller, j, unit)]))
6565 }
6666
6767

github/deemru/w8io/169f3d6 
25.00 ms