tx · GLRY6F4ZQhCYBThEXFtPCAnKmk3Mu6PfDgB1zYNJyyfg

3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX:  -0.01400000 Waves

2019.07.11 12:07 [580829] smart account 3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX > SELF 0.00000000 Waves

{ "type": 13, "id": "GLRY6F4ZQhCYBThEXFtPCAnKmk3Mu6PfDgB1zYNJyyfg", "fee": 1400000, "feeAssetId": null, "timestamp": 1562836009376, "version": 1, "sender": "3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX", "senderPublicKey": "EKGwbPjcrwuWgDm8Ed9HAGmxMviCRgqTkQDVt4rYbyre", "proofs": [ "4UbHRq7nurtWBfYdryRuYevr5ryconDwUPpVJpmD3ct5MKc7AEWFgSv2CQKtcVm8WmkAkfVk6Um21idYoSskaJrn" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAAVvd25lcgEAAAAaAVTvvhtsl5a8uJsx9lmVjj72aCuw5r86MC8AAAAADUxpcXVpZEFzc2V0SWQBAAAAIOko/8ffrEF7C8jHeLG92rw5x2KlLkjVtarJvVMwnDvrAAAAAAdXQVZFU0lEBQAAAAR1bml0AAAAAgAAAApjb250ZXh0T2JqAQAAAAd1bmlzd2FwAAAAAAQAAAALd2F2ZXNBbW91bnQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAC3dhdmVzQW1vdW50BAAAAAxsaXF1aWRBbW91bnQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADGxpcXVpZEFtb3VudAQAAAAHcGF5bWVudAQAAAAHJG1hdGNoMAgFAAAACmNvbnRleHRPYmoAAAAHcGF5bWVudAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQXR0YWNoZWRQYXltZW50BAAAAAFwBQAAAAckbWF0Y2gwBQAAAAFwCQAAAgAAAAECAAAAFFBheW1lbnQgbm90IGF0dGFjaGVkBAAAA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ANTGlxdWlkQmFsYW5jZQUAAAANTGlxdWlkQXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIFAAAADFdhdmVzQmFsYW5jZQUAAAAEdW5pdAUAAAADbmlsCQAAAgAAAAECAAAAHVlvdSBhcmUgbm90IGV4Y2hhbmdlcidzIG93bmVyAAAAAQAAAApjb250ZXh0T2JqAQAAAAZ2ZXJpZnkAAAAABh+WEQw=", "chainId": 84, "height": 580829, "spentComplexity": 0 } View: original | compacted Prev: C6BfHa54RubtNkmR6dyt5DTofdEp34i7eBQ2nDi2tWvY Next: 9dHemJ7qqoVPEzfhWYsbpMZ9Upjib3fZGUvRjMi7LwP5 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let owner = base58'3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r'
55
66 let LiquidAssetId = base58'GhAFhXzwCYfvcXQ3GHFaQFnCzAuYCT156qFqiYyzfkzv'
77
88 let WAVESID = unit
99
1010 @Callable(contextObj)
1111 func uniswap () = {
1212 let wavesAmount = getIntegerValue(this, "wavesAmount")
1313 let liquidAmount = getIntegerValue(this, "liquidAmount")
1414 let payment = match contextObj.payment {
1515 case p: AttachedPayment =>
1616 p
1717 case _ =>
1818 throw("Payment not attached")
1919 }
2020 let assetIdReceived = payment.assetId
2121 let tokenReceiveAmount = payment.amount
2222 if ((assetIdReceived == unit))
2323 then {
2424 let tokenSendAmount = fraction(liquidAmount, tokenReceiveAmount, (tokenReceiveAmount + wavesAmount))
2525 let assetIdSent = LiquidAssetId
2626 ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount - tokenSendAmount)), DataEntry("wavesAmount", (wavesAmount + tokenReceiveAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
2727 }
2828 else if ((assetIdReceived == LiquidAssetId))
2929 then {
3030 let tokenSendAmount = fraction(wavesAmount, tokenReceiveAmount, (tokenReceiveAmount + liquidAmount))
3131 let assetIdSent = unit
3232 ScriptResult(WriteSet([DataEntry("liquidAmofunt", (liquidAmount + tokenReceiveAmount)), DataEntry("wavesAmount", (wavesAmount - tokenSendAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
3333 }
3434 else throw("Asset is not allowed")
3535 }
3636
3737
3838
3939 @Callable(contextObj)
4040 func withdraw () = {
4141 let LiquidBalance = assetBalance(this, LiquidAssetId)
4242 let WavesBalance = wavesBalance(this)
4343 if ((contextObj.caller.bytes == owner))
4444 then ScriptResult(WriteSet([DataEntry("liquidAmount", "withdrawn"), DataEntry("wavesAmount", "withdrawn")]), TransferSet([ScriptTransfer(contextObj.caller, LiquidBalance, LiquidAssetId), ScriptTransfer(contextObj.caller, WavesBalance, unit)]))
4545 else throw("You are not exchanger's owner")
4646 }
4747
4848
4949 @Verifier(contextObj)
5050 func verify () = true
5151

github/deemru/w8io/026f985 
24.41 ms