tx · 2eNFsajpy9ZE29pLkpUbXzRKaEmaDRBbS6tGEGLXTn6g 3N7txZA3RTLb1G7ugtwQgDsooQAoc5TjMTA: -0.01400000 Waves 2019.10.05 16:17 [706484] smart account 3N7txZA3RTLb1G7ugtwQgDsooQAoc5TjMTA > SELF 0.00000000 Waves
{ "type": 13, "id": "2eNFsajpy9ZE29pLkpUbXzRKaEmaDRBbS6tGEGLXTn6g", "fee": 1400000, "feeAssetId": null, "timestamp": 1570281433617, "version": 1, "sender": "3N7txZA3RTLb1G7ugtwQgDsooQAoc5TjMTA", "senderPublicKey": "7og2U7GTX5oBMRfgGsEYV2Qo6Ba67jPaFnzkXBXYWbH9", "proofs": [ "63W7N87UtFFdKFBBsaeqzVQVgEoKnGcBYsxkMbko6pUqbW1bzLb8qypYf2qfzgQepYTY6EgcbshWskWLD7af4xDQ" ], "script": "base64:AwQAAAADd0NXAQAAACB1Ci+qTXfGUuUXVGenri4rYl1my33vQbJ5RCCOwEBP6AQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGB/a5Osc=", "chainId": 84, "height": 706484, "spentComplexity": 0 } View: original | compacted Prev: 44xQZ1EwKAyj53Q2Zg9dj9KnYJnjboZbpTYPtJu9Jmjw Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | - | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | - | {-# CONTENT_TYPE DAPP #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
4 | 3 | let wCW = base58'8ssi9HJZ623Vqd2G7RJmKVsK2b3yCCUKxH7CNK5FbR99' | |
5 | - | ||
6 | - | @Callable(i) | |
7 | - | func deposit () = { | |
8 | - | let pmt = extract(i.payment) | |
9 | - | if ((pmt.assetId != wCW)) | |
10 | - | then throw("wCW - 8ssi9HJZ623Vqd2G7RJmKVsK2b3yCCUKxH7CNK5FbR99 tokens only at the moment") | |
11 | - | else { | |
12 | - | let currentKey = toBase58String(i.caller.bytes) | |
13 | - | let currentAmount = match getInteger(this, currentKey) { | |
14 | - | case a: Int => | |
15 | - | a | |
16 | - | case _ => | |
17 | - | 0 | |
18 | - | } | |
19 | - | let newAmount = (currentAmount + pmt.amount) | |
20 | - | WriteSet([DataEntry(currentKey, newAmount)]) | |
21 | - | } | |
22 | - | } | |
23 | - | ||
24 | - | ||
25 | - | ||
26 | - | @Callable(i) | |
27 | - | func withdraw (amount) = { | |
28 | - | let currentKey = toBase58String(i.caller.bytes) | |
29 | - | let currentAmount = match getInteger(this, currentKey) { | |
30 | - | case a: Int => | |
31 | - | a | |
32 | - | case _ => | |
33 | - | 0 | |
34 | - | } | |
35 | - | let newAmount = (currentAmount - amount) | |
36 | - | if ((0 > amount)) | |
37 | - | then throw("Can't withdraw negative amount") | |
38 | - | else if ((0 > newAmount)) | |
39 | - | then throw("Not enough balance") | |
40 | - | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, wCW)])) | |
41 | - | } | |
42 | - | ||
43 | - | ||
4 | + | match tx { | |
5 | + | case d: ExchangeTransaction => | |
6 | + | true | |
7 | + | case _ => | |
8 | + | false | |
9 | + | } |
github/deemru/w8io/169f3d6 30.15 ms ◑