tx · D3kvAU2yc7xAoovQEq4iZd6FMgHBRMWjsPDbzo6REskx 3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX: -0.01400000 Waves 2019.07.01 13:23 [566190] smart account 3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX > SELF 0.00000000 Waves
{ "type": 13, "id": "D3kvAU2yc7xAoovQEq4iZd6FMgHBRMWjsPDbzo6REskx", "fee": 1400000, "feeAssetId": null, "timestamp": 1561976591940, "version": 1, "sender": "3N4w7wVkViML11XdFL5xNkPofVVg1nLWEmX", "senderPublicKey": "EKGwbPjcrwuWgDm8Ed9HAGmxMviCRgqTkQDVt4rYbyre", "proofs": [ "63TfSzpcL55SDYPqDfohd11XciB6U6VYkfTjAmDAMjdaJVFQFbW6Sm555oghp6jjhVbbALx2NG3hPfQJPy9jVwsR" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAApjb250ZXh0T2JqAQAAAAd1bmlzd2FwAAAAAAQAAAANTGlxdWlkQXNzZXRJZAEAAAAg6Sj/x9+sQXsLyMd4sb3avDnHYqUuSNW1qsm9UzCcO+sEAAAAC3dhdmVzQW1vdW50CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAAt3YXZlc0Ftb3VudAQAAAAMbGlxdWlkQW1vdW50CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAAxsaXF1aWRBbW91bnQEAAAAB3BheW1lbnQEAAAAByRtYXRjaDAIBQAAAApjb250ZXh0T2JqAAAAB3BheW1lbnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0F0dGFjaGVkUGF5bWVudAQAAAABcAUAAAAHJG1hdGNoMAUAAAABcAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAAPYXNzZXRJZFJlY2VpdmVkCAUAAAAHcGF5bWVudAAAAAdhc3NldElkBAAAABJ0b2tlblJlY2VpdmVBbW91bnQIBQAAAAd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WRBbW91bnQJAABkAAAAAgUAAAAMbGlxdWlkQW1vdW50BQAAABJ0b2tlblJlY2VpdmVBbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAC3dhdmVzQW1vdW50CQAAZQAAAAIFAAAAC3dhdmVzQW1vdW50BQAAAA90b2tlblNlbmRBbW91bnQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIFAAAAD3Rva2VuU2VuZEFtb3VudAUAAAALYXNzZXRJZFNlbnQFAAAAA25pbAkAAAIAAAABAgAAABRBc3NldCBpcyBub3QgYWxsb3dlZAAAAABXDxZZ", "chainId": 84, "height": 566190, "spentComplexity": 0 } View: original | compacted Prev: 8JRpR7WaVdsK45YPQpW9bicQfXL27GcTg6r63Z8WWcCz Next: BMXPWUrZNuz1rf9srKZvyfhnD3ShTL7cREM2DvXSpgCU Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | else if ((assetIdReceived == LiquidAssetId)) | |
26 | 26 | then { | |
27 | 27 | let tokenSendAmount = fraction(wavesAmount, tokenReceiveAmount, (tokenReceiveAmount + liquidAmount)) | |
28 | - | let assetIdSent = | |
29 | - | ScriptResult(WriteSet([DataEntry(" | |
28 | + | let assetIdSent = unit | |
29 | + | ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount + tokenReceiveAmount)), DataEntry("wavesAmount", (wavesAmount - tokenSendAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)])) | |
30 | 30 | } | |
31 | 31 | else throw("Asset is not allowed") | |
32 | 32 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(contextObj) | |
7 | 7 | func uniswap () = { | |
8 | 8 | let LiquidAssetId = base58'GhAFhXzwCYfvcXQ3GHFaQFnCzAuYCT156qFqiYyzfkzv' | |
9 | 9 | let wavesAmount = getIntegerValue(this, "wavesAmount") | |
10 | 10 | let liquidAmount = getIntegerValue(this, "liquidAmount") | |
11 | 11 | let payment = match contextObj.payment { | |
12 | 12 | case p: AttachedPayment => | |
13 | 13 | p | |
14 | 14 | case _ => | |
15 | 15 | throw("Payment not attached") | |
16 | 16 | } | |
17 | 17 | let assetIdReceived = payment.assetId | |
18 | 18 | let tokenReceiveAmount = payment.amount | |
19 | 19 | if ((assetIdReceived == unit)) | |
20 | 20 | then { | |
21 | 21 | let tokenSendAmount = fraction(liquidAmount, tokenReceiveAmount, (tokenReceiveAmount + wavesAmount)) | |
22 | 22 | let assetIdSent = LiquidAssetId | |
23 | 23 | ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount - tokenSendAmount)), DataEntry("wavesAmount", (wavesAmount + tokenReceiveAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)])) | |
24 | 24 | } | |
25 | 25 | else if ((assetIdReceived == LiquidAssetId)) | |
26 | 26 | then { | |
27 | 27 | let tokenSendAmount = fraction(wavesAmount, tokenReceiveAmount, (tokenReceiveAmount + liquidAmount)) | |
28 | - | let assetIdSent = | |
29 | - | ScriptResult(WriteSet([DataEntry(" | |
28 | + | let assetIdSent = unit | |
29 | + | ScriptResult(WriteSet([DataEntry("liquidAmount", (liquidAmount + tokenReceiveAmount)), DataEntry("wavesAmount", (wavesAmount - tokenSendAmount))]), TransferSet([ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)])) | |
30 | 30 | } | |
31 | 31 | else throw("Asset is not allowed") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 |
github/deemru/w8io/026f985 21.98 ms ◑