tx · GLeDxDMS2wpK87ZNQw1rHEt8qTsUPBFn3soQ2JbpXc55

3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg:  -0.01000000 Waves

2021.07.18 10:00 [1618725] smart account 3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg > SELF 0.00000000 Waves

{ "type": 13, "id": "GLeDxDMS2wpK87ZNQw1rHEt8qTsUPBFn3soQ2JbpXc55", "fee": 1000000, "feeAssetId": null, "timestamp": 1626591660591, "version": 2, "chainId": 84, "sender": "3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg", "senderPublicKey": "3dgMH7dCr1W2HyMSf2t3ZvDFstt6YnTvHtvZKUt6Cwgx", "proofs": [ "2E8HHqyfe36t99sRqdUu83Ez3FpibxHqwG7CtYM1XNcWvWtUyztounwf1b6ab1qCmjNwhYyoLREg5bDVN3wuPo3k" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAAAAAAAgAAAAFpAQAAAA5XYXZlc1N3YXBUb2tlbgAAAAAEAAAACmN1cnJlbnRLZXkJAAEsAAAAAgIAAAANdG90YWxEZXBvc2l0XwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAlzd2FwVG9rZW4BAAAAIOcOzrhZ7nmACRz71uIBzDdZQS4CHzCdrSwGyoWA1CnEBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAQAAAAGYW1vdW50CAUAAAADcG10AAAABmFtb3VudAQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACW5ld0Ftb3VudAkAAGQAAAACBQAAAA1jdXJyZW50QW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAlpc0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V2l0aGRyYXcJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAWbmV3QW1vdW50VG90YWxXaXRoZHJhdwUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAZdG90YWxBdXRob3JpemVkV2l0aGRyYXdhbAUAAAAEdW5pdAUAAAADbmlsAAAAAPPNA6c=", "height": 1618725, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8MNA6Vtxz72GpeWqD698TU3sKU3oVc4SFHhp1SYMVVyz Next: GRcr4zbYc1uy5BcinzLRD5yJCqRwqWzxWUtppxMoLfLR Diff:
OldNewDifferences
4343 }
4444 else 0
4545 }
46- let m = ((l / k) * 100)
46+ let m = (l / k)
4747 let n = {
4848 let g = getInteger(this, b)
4949 if ($isInstanceOf(g, "Int"))
6868 if ((d.assetId != c))
6969 then throw("can hodl Swap Token only.")
7070 else if ((q >= e))
71- then throw(toString(q))
71+ then throw(toString(m))
7272 else if ((0 > e))
7373 then throw("Can't withdraw negative amount")
7474 else if ((0 > r))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
77 func WavesSwapToken () = {
88 let b = ("totalDeposit_" + toBase58String(a.caller.bytes))
99 let c = base58'GYxGtmuBa72BShwGRLyf8wNDEzJt7zngMLCRTnuSuhMm'
1010 let d = extract(a.payment)
1111 let e = d.amount
1212 let f = {
1313 let g = getInteger(this, b)
1414 if ($isInstanceOf(g, "Int"))
1515 then {
1616 let h = g
1717 h
1818 }
1919 else 0
2020 }
2121 let i = (f + d.amount)
2222 if (isDefined(d.assetId))
2323 then throw("can hodl waves only at the moment")
2424 else ScriptResult(WriteSet([DataEntry(b, i)]), TransferSet([ScriptTransfer(a.caller, e, c)]))
2525 }
2626
2727
2828
2929 @Callable(a)
3030 func TokenSwapWaves () = {
3131 let c = base58'GYxGtmuBa72BShwGRLyf8wNDEzJt7zngMLCRTnuSuhMm'
3232 let b = ("totalWithdrawInWaves_" + toBase58String(a.caller.bytes))
3333 let j = ("totalDeposit_" + toBase58String(a.caller.bytes))
3434 let k = 100
3535 let d = extract(a.payment)
3636 let e = d.amount
3737 let l = {
3838 let g = getInteger(this, j)
3939 if ($isInstanceOf(g, "Int"))
4040 then {
4141 let h = g
4242 h
4343 }
4444 else 0
4545 }
46- let m = ((l / k) * 100)
46+ let m = (l / k)
4747 let n = {
4848 let g = getInteger(this, b)
4949 if ($isInstanceOf(g, "Int"))
5050 then {
5151 let h = g
5252 h
5353 }
5454 else 0
5555 }
5656 let o = {
5757 let g = getInteger(this, "currentProfit")
5858 if ($isInstanceOf(g, "Int"))
5959 then {
6060 let h = g
6161 h
6262 }
6363 else 0
6464 }
6565 let p = (o * m)
6666 let q = (p - n)
6767 let r = (n + e)
6868 if ((d.assetId != c))
6969 then throw("can hodl Swap Token only.")
7070 else if ((q >= e))
71- then throw(toString(q))
71+ then throw(toString(m))
7272 else if ((0 > e))
7373 then throw("Can't withdraw negative amount")
7474 else if ((0 > r))
7575 then throw("Not enough balance")
7676 else ScriptResult(WriteSet([DataEntry(b, r)]), TransferSet([ScriptTransfer(a.caller, q, unit)]))
7777 }
7878
7979

github/deemru/w8io/169f3d6 
68.62 ms