tx · 3JH4TD113CaBykNknW6hzoL7r7zDubPN9Xs84f69XFMq

3MpVFGJWgiGyh5LmE1nxNLsjjtSL3Bgh9NV:  -0.01400000 Waves

2019.08.19 17:02 [638128] smart account 3MpVFGJWgiGyh5LmE1nxNLsjjtSL3Bgh9NV > SELF 0.00000000 Waves

{ "type": 13, "id": "3JH4TD113CaBykNknW6hzoL7r7zDubPN9Xs84f69XFMq", "fee": 1400000, "feeAssetId": null, "timestamp": 1566223346432, "version": 1, "sender": "3MpVFGJWgiGyh5LmE1nxNLsjjtSL3Bgh9NV", "senderPublicKey": "854p8BYzrj6yBPRPmfQur3oF1Rjc1AJ548qRp5FT5kDa", "proofs": [ "2Bc6ZFTMqj2WV65H58CQoJrQLPta4cYxbJHRgwsSp5EX6AuJoDk1oJ3RvnbDP6LSeETxGX5VetCwECcVtt2G68Bs" ], "script": "base64:AwQAAAAHUHViS2V5MQEAAAAgxdZo0U+54/N4p2tbVfMxgttAZf1a7Fe1Rn4XcP5f7z8JAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAdQdWJLZXkxYxU4kQ==", "chainId": 84, "height": 638128, "spentComplexity": 0 } View: original | compacted Prev: CDX9KYjmN7g1reFWuXq6CeJj7H1WvrCTTMeWtBnckchx Next: 9nnuqrZch7X3rHwBiNeRRxzhcpm6Cr8dxuDSaFtGKPSn Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let owner = base58'3NBmj1eEDJmrQ16GJkmVU1p31MTURgoV38r'
5-
6-let LiquidAssetId = base58'8ZDXPncY5ypuMoAY4Ec9hCH2eMbgVpSYtGXK7SzkzmQy'
7-
8-let WAVESID = unit
9-
10-let comission = 0
11-
12-@Callable(contextObj)
13-func exchanger (minTokenRecieve) = {
14- let wavesAmount = getIntegerValue(this, "wavesAmount")
15- let liquidAmount = getIntegerValue(this, "liquidAmount")
16- let payment = match contextObj.payment {
17- case p: AttachedPayment =>
18- p
19- case _ =>
20- throw("Payment not attached")
21- }
22- let assetIdReceived = payment.assetId
23- let tokenReceiveAmount = payment.amount
24- if ((assetIdReceived == unit))
25- then {
26- let tokenSendAmount = fraction(liquidAmount, tokenReceiveAmount, (tokenReceiveAmount + wavesAmount))
27- if ((minTokenRecieve > tokenSendAmount))
28- then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
29- else {
30- let assetIdSent = LiquidAssetId
31- ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount - tokenSendAmount)), DataEntry("wavesAmount", (wavesAmount + tokenReceiveAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
32- }
33- }
34- else if ((assetIdReceived == LiquidAssetId))
35- then {
36- let tokenSendAmount = fraction(wavesAmount, tokenReceiveAmount, (tokenReceiveAmount + liquidAmount))
37- if ((minTokenRecieve > tokenSendAmount))
38- then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
39- else {
40- let assetIdSent = unit
41- ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount + tokenReceiveAmount)), DataEntry("wavesAmount", (wavesAmount - tokenSendAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)]))
42- }
43- }
44- else throw("Asset is not allowed")
45- }
46-
47-
48-
49-@Callable(contextObj)
50-func withdraw () = {
51- let LiquidBalance = assetBalance(this, LiquidAssetId)
52- let WavesBalance = wavesBalance(this)
53- if ((contextObj.caller.bytes == owner))
54- then ScriptResult(WriteSet([DataEntry("liquidAmount", "withdrawn"), DataEntry("wavesAmount", "withdrawn")]), TransferSet([ScriptTransfer(contextObj.caller, LiquidBalance, LiquidAssetId), ScriptTransfer(contextObj.caller, WavesBalance, unit)]))
55- else throw("You are not exchanger's owner")
56- }
57-
58-
59-@Verifier(contextObj)
60-func verify () = true
61-
2+{-# CONTENT_TYPE EXPRESSION #-}
3+let PubKey1 = base58'EKGwbPjcrwuWgDm8Ed9HAGmxMviCRgqTkQDVt4rYbyre'
4+sigVerify(tx.bodyBytes, tx.proofs[0], PubKey1)

github/deemru/w8io/169f3d6 
32.25 ms