tx · DkrKPqYaFFC7zUqZfT5HtXrw9w38as7xXkaYS2xuepVY

3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r:  -0.01400000 Waves

2019.08.19 15:20 [638019] smart account 3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r > SELF 0.00000000 Waves

{ "type": 13, "id": "DkrKPqYaFFC7zUqZfT5HtXrw9w38as7xXkaYS2xuepVY", "fee": 1400000, "feeAssetId": null, "timestamp": 1566217195106, "version": 1, "sender": "3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r", "senderPublicKey": "DKGFPozLrsiR8NM4NJzqQaBYC8NyGYjuw2hDYicQVjco", "proofs": [ "24Kg7C3H2tDDyJKuRPEKzwStqwbjz4gJ5rfrrLyw6Quwfq4PoHXqE9YWbN5zFSrdf5rqGjDBKpfTNF4WsFZSq43J" ], "script": "base64:AwQAAAAGUHViS2V5AQAAABoBVO++G2yXlry4mzH2WZWOPvZoK7DmvzowLwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAABlB1YktleTD4Qf8=", "chainId": 84, "height": 638019, "spentComplexity": 0 } View: original | compacted Prev: 619mTNxUP8EngJdzyUt4T7BfqGaZyJWYVEwDjZWrQGjP 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 (comission,minTokenRecieve) = if (if ((0 > comission))
12- then true
13- else (comission > 100))
14- then throw("incorrect comission value")
15- else {
16- let wavesAmount = getIntegerValue(this, "wavesAmount")
17- let liquidAmount = getIntegerValue(this, "liquidAmount")
18- let payment = match contextObj.payment {
19- case p: AttachedPayment =>
20- p
21- case _ =>
22- throw("Payment not attached")
23- }
24- let assetIdReceived = payment.assetId
25- let tokenReceiveAmount = payment.amount
26- if ((assetIdReceived == unit))
27- then {
28- let tokenSendAmount = ((fraction(liquidAmount, tokenReceiveAmount, (tokenReceiveAmount + wavesAmount)) * (100 - comission)) / 100)
29- if ((minTokenRecieve > tokenSendAmount))
30- then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
31- else {
32- let assetIdSent = LiquidAssetId
33- ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount - tokenSendAmount)), DataEntry("wavesAmount", (wavesAmount + tokenReceiveAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
34- }
35- }
36- else if ((assetIdReceived == LiquidAssetId))
37- then {
38- let tokenSendAmount = ((fraction(wavesAmount, tokenReceiveAmount, (tokenReceiveAmount + liquidAmount)) * (100 - comission)) / 100)
39- if ((minTokenRecieve > tokenSendAmount))
40- then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
41- else {
42- let assetIdSent = unit
43- ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount + tokenReceiveAmount)), DataEntry("wavesAmount", (wavesAmount - tokenSendAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
44- }
45- }
46- else throw("Asset is not allowed")
47- }
48-
49-
50-
51-@Callable(contextObj)
52-func withdraw () = {
53- let LiquidBalance = assetBalance(this, LiquidAssetId)
54- let WavesBalance = wavesBalance(this)
55- if ((contextObj.caller.bytes == owner))
56- then ScriptResult(WriteSet([DataEntry("liquidAmount", "withdrawn"), DataEntry("wavesAmount", "withdrawn")]), TransferSet([ScriptTransfer(contextObj.caller, LiquidBalance, LiquidAssetId), ScriptTransfer(contextObj.caller, WavesBalance, unit)]))
57- else throw("You are not exchanger's owner")
58- }
59-
60-
61-@Verifier(contextObj)
62-func verify () = true
63-
2+{-# CONTENT_TYPE EXPRESSION #-}
3+let PubKey = base58'3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r'
4+sigVerify(tx.bodyBytes, tx.proofs[0], PubKey)

github/deemru/w8io/6500d08 
23.28 ms