tx · F2gj39eNHREmp1ywYh4J8YUj4fAuHsUnuLnu1yeHvMHo 3Mztw7BQPWhCXDxHESrBoX2DKk12yNAGK5E: -0.01400000 Waves 2019.06.28 15:29 [561971] smart account 3Mztw7BQPWhCXDxHESrBoX2DKk12yNAGK5E > SELF 0.00000000 Waves
{ "type": 13, "id": "F2gj39eNHREmp1ywYh4J8YUj4fAuHsUnuLnu1yeHvMHo", "fee": 1400000, "feeAssetId": null, "timestamp": 1561724999662, "version": 1, "sender": "3Mztw7BQPWhCXDxHESrBoX2DKk12yNAGK5E", "senderPublicKey": "BG7Fy2R6zh7x23ssfb44qii1ivXk7oLoc7s83p9tt3uB", "proofs": [ "6Qxds6WF9edi4WyPS5kA1qpq7xNEUfoCSkMFcZTdpsd4pJBwGho3JakP93D3RZ4oGxyU1P2S5fwZKbfGurX4X6x" ], "script": "base64:AgQAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAACjBzQOgYK1aOY+IEAAAAB2Fzc2V0SWQBAAAACJ+kNIQu6TK4BAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAACZXgFAAAAByRtYXRjaDAEAAAABHBhaXIJAQAAAAlBc3NldFBhaXIAAAACBQAAAAdhc3NldElkBQAAAAR1bml0BAAAAARyYXRlCQEAAAAHZXh0cmFjdAAAAAEJAAQaAAAAAgUAAAAGaXNzdWVyAgAAAAxleGNoYW5nZVJhdGUEAAAACHJhdGVEaWZmCQAAZQAAAAIFAAAABHJhdGUJAABrAAAAAwAAAAAABfXhAAgFAAAAAmV4AAAABXByaWNlCAUAAAACZXgAAAAGYW1vdW50AwMJAAAAAAAAAggIBQAAAAJleAAAAAhidXlPcmRlcgAAAAlhc3NldFBhaXIFAAAABHBhaXIJAABmAAAAAgUAAAAIcmF0ZURpZmYA/////////5wHCQAAZgAAAAIAAAAAAAAAAGQFAAAACHJhdGVEaWZmBwapx/KN", "chainId": 84, "height": 561971, "spentComplexity": 0 } View: original | compacted Prev: 2ybgCRPWBrhphAyvxSEqMetLiZd9p7JRgdHcQx8nmMfU Next: HR93NHXq8GggLLxkfjdmi1GNFcbfsxaSDvtdi2veDSoW Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION 3 #-} | |
2 | - | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | - | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = base58'8kKP8hCaoSa3vNN4e2e3bboKfnw3arz7kLhQeCBWauQH' | |
5 | - | ||
6 | - | @Callable(b) | |
7 | - | func deposit () = { | |
8 | - | let c = extract(b.payment) | |
9 | - | if ((c.assetId != a)) | |
10 | - | then throw("wEUR - 8kKP8hCaoSa3vNN4e2e3bboKfnw3arz7kLhQeCBWauQH only tokens") | |
11 | - | else { | |
12 | - | let d = toBase58String(b.caller.bytes) | |
13 | - | let e = { | |
14 | - | let f = getInteger(this, d) | |
15 | - | if ($isInstanceOf(f, "Int")) | |
16 | - | then { | |
17 | - | let g = f | |
18 | - | g | |
19 | - | } | |
20 | - | else 0 | |
21 | - | } | |
22 | - | let h = (e + c.amount) | |
23 | - | WriteSet([DataEntry(d, h)]) | |
24 | - | } | |
25 | - | } | |
26 | - | ||
27 | - | ||
28 | - | ||
29 | - | @Callable(b) | |
30 | - | func withdraw (i) = { | |
31 | - | let d = toBase58String(b.caller.bytes) | |
32 | - | let e = { | |
33 | - | let f = getInteger(this, d) | |
34 | - | if ($isInstanceOf(f, "Int")) | |
35 | - | then { | |
36 | - | let g = f | |
37 | - | g | |
38 | - | } | |
39 | - | else 0 | |
40 | - | } | |
41 | - | let h = (e - i) | |
42 | - | if ((0 > i)) | |
43 | - | then throw("Can't withdraw negative amount") | |
44 | - | else if ((0 > h)) | |
45 | - | then throw("Not enough balance") | |
46 | - | else ScriptResult(WriteSet([DataEntry(d, h)]), TransferSet([ScriptTransfer(b.caller, i, a)])) | |
47 | - | } | |
48 | - | ||
49 | - | ||
1 | + | {-# STDLIB_VERSION 2 #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let issuer = Address(base58'3issuerAddress') | |
4 | + | let assetId = base58'ThisAsset1d' | |
5 | + | match tx { | |
6 | + | case ex: ExchangeTransaction => | |
7 | + | let pair = AssetPair(assetId, unit) | |
8 | + | let rate = extract(getInteger(issuer, "exchangeRate")) | |
9 | + | let rateDiff = (rate - fraction(100000000, ex.price, ex.amount)) | |
10 | + | if (if ((ex.buyOrder.assetPair == pair)) | |
11 | + | then (rateDiff > -100) | |
12 | + | else false) | |
13 | + | then (100 > rateDiff) | |
14 | + | else false | |
15 | + | case _ => | |
16 | + | true | |
17 | + | } |
github/deemru/w8io/026f985 19.24 ms ◑