tx · 9dHemJ7qqoVPEzfhWYsbpMZ9Upjib3fZGUvRjMi7LwP5

3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX:  -0.01400000 Waves

2019.08.19 16:53 [638120] smart account 3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX > SELF 0.00000000 Waves

{ "type": 13, "id": "9dHemJ7qqoVPEzfhWYsbpMZ9Upjib3fZGUvRjMi7LwP5", "fee": 1400000, "feeAssetId": null, "timestamp": 1566222860417, "version": 1, "sender": "3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX", "senderPublicKey": "EKGwbPjcrwuWgDm8Ed9HAGmxMviCRgqTkQDVt4rYbyre", "proofs": [ "5PRUbgiKiP2xJE5t9r5KDsaNXzguCHosCGjhX869WCt3zbdsgSWF7KtRr3MiNKDJaqYtUTZzqa4ebAYwKbybVgPE" ], "script": "base64:AwQAAAAGUHViS2V5AQAAABoBVO++G2yXlry4mzH2WZWOPvZoK7DmvzowLwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAABlB1YktleTD4Qf8=", "chainId": 84, "height": 638120, "spentComplexity": 0 } View: original | compacted Prev: GLRY6F4ZQhCYBThEXFtPCAnKmk3Mu6PfDgB1zYNJyyfg Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let owner = base58'3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r'
5-
6-let LiquidAssetId = base58'GhAFhXzwCYfvcXQ3GHFaQFnCzAuYCT156qFqiYyzfkzv'
7-
8-let WAVESID = unit
9-
10-@Callable(contextObj)
11-func uniswap () = {
12- let wavesAmount = getIntegerValue(this, "wavesAmount")
13- let liquidAmount = getIntegerValue(this, "liquidAmount")
14- let payment = match contextObj.payment {
15- case p: AttachedPayment =>
16- p
17- case _ =>
18- throw("Payment not attached")
19- }
20- let assetIdReceived = payment.assetId
21- let tokenReceiveAmount = payment.amount
22- if ((assetIdReceived == unit))
23- then {
24- let tokenSendAmount = fraction(liquidAmount, tokenReceiveAmount, (tokenReceiveAmount + wavesAmount))
25- let assetIdSent = LiquidAssetId
26- ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount - tokenSendAmount)), DataEntry("wavesAmount", (wavesAmount + tokenReceiveAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
27- }
28- else if ((assetIdReceived == LiquidAssetId))
29- then {
30- let tokenSendAmount = fraction(wavesAmount, tokenReceiveAmount, (tokenReceiveAmount + liquidAmount))
31- let assetIdSent = unit
32- ScriptResult(WriteSet([DataEntry("liquidAmofunt", (liquidAmount + tokenReceiveAmount)), DataEntry("wavesAmount", (wavesAmount - tokenSendAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
33- }
34- else throw("Asset is not allowed")
35- }
36-
37-
38-
39-@Callable(contextObj)
40-func withdraw () = {
41- let LiquidBalance = assetBalance(this, LiquidAssetId)
42- let WavesBalance = wavesBalance(this)
43- if ((contextObj.caller.bytes == owner))
44- then ScriptResult(WriteSet([DataEntry("liquidAmount", "withdrawn"), DataEntry("wavesAmount", "withdrawn")]), TransferSet([ScriptTransfer(contextObj.caller, LiquidBalance, LiquidAssetId), ScriptTransfer(contextObj.caller, WavesBalance, unit)]))
45- else throw("You are not exchanger's owner")
46- }
47-
48-
49-@Verifier(contextObj)
50-func verify () = true
51-
2+{-# CONTENT_TYPE EXPRESSION #-}
3+let PubKey = base58'3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r'
4+sigVerify(tx.bodyBytes, tx.proofs[0], PubKey)

github/deemru/w8io/026f985 
35.28 ms