tx · 6RfHKzS6MuMML4XmMgHgVQJRFSegKtaZqzkzLDSN7KWq 3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg: -0.01000000 Waves 2021.07.18 05:03 [1618424] smart account 3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg > SELF 0.00000000 Waves
{ "type": 13, "id": "6RfHKzS6MuMML4XmMgHgVQJRFSegKtaZqzkzLDSN7KWq", "fee": 1000000, "feeAssetId": null, "timestamp": 1626573855923, "version": 2, "chainId": 84, "sender": "3N7hBLNCFEhtWwSWkk7Pbd5qoCdYhABdAPg", "senderPublicKey": "3dgMH7dCr1W2HyMSf2t3ZvDFstt6YnTvHtvZKUt6Cwgx", "proofs": [ "25CUJP3PSWYtYEuzMYeJhWX6oSysqf4aRdwH36NB4CpY3xLzsw7R5yhnQQfxoQgN1geKZ9iPX1u4UKCEnPefXSNM" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAAAAAAAgAAAAFpAQAAAA5XYXZlc1N3YXBUb2tlbgAAAAAEAAAACmN1cnJlbnRLZXkJAAEsAAAAAgIAAAANdG90YWxEZXBvc2l0XwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAlzd2FwVG9rZW4BAAAAIOcOzrhZ7nmACRz71uIBzDdZQS4CHzCdrSwGyoWA1CnEBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAQAAAAGYW1vdW50CAUAAAADcG10AAAABmFtb3VudAQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACW5ld0Ftb3VudAkAAGQAAAACBQAAAA1jdXJyZW50QW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAlpc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AAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAAdq86aQ==", "height": 1618424, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: HFeUrGFcGj2bF6X3btp1tGBJ56xMdymwqEjvjQKLn3fe Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(a) | |
7 | + | func WavesSwapToken () = { | |
8 | + | let b = ("totalDeposit_" + toBase58String(a.caller.bytes)) | |
9 | + | let c = base58'GYxGtmuBa72BShwGRLyf8wNDEzJt7zngMLCRTnuSuhMm' | |
10 | + | let d = extract(a.payment) | |
11 | + | let e = d.amount | |
12 | + | let f = { | |
13 | + | let g = getInteger(this, b) | |
14 | + | if ($isInstanceOf(g, "Int")) | |
15 | + | then { | |
16 | + | let h = g | |
17 | + | h | |
18 | + | } | |
19 | + | else 0 | |
20 | + | } | |
21 | + | let i = (f + d.amount) | |
22 | + | if (isDefined(d.assetId)) | |
23 | + | then throw("can hodl waves only at the moment") | |
24 | + | else ScriptResult(WriteSet([DataEntry(b, i)]), TransferSet([ScriptTransfer(a.caller, e, c)])) | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | @Callable(a) | |
30 | + | func TokenSwapWaves () = { | |
31 | + | let c = base58'GYxGtmuBa72BShwGRLyf8wNDEzJt7zngMLCRTnuSuhMm' | |
32 | + | let b = ("totalWithdrawInWaves_" + toBase58String(a.caller.bytes)) | |
33 | + | let d = extract(a.payment) | |
34 | + | let e = d.amount | |
35 | + | let f = { | |
36 | + | let g = getInteger(this, b) | |
37 | + | if ($isInstanceOf(g, "Int")) | |
38 | + | then { | |
39 | + | let h = g | |
40 | + | h | |
41 | + | } | |
42 | + | else 0 | |
43 | + | } | |
44 | + | let i = (f + e) | |
45 | + | if ((d.assetId != c)) | |
46 | + | then throw("can hodl Swap Token only.") | |
47 | + | else if ((0 > e)) | |
48 | + | then throw("Can't withdraw negative amount") | |
49 | + | else if ((0 > i)) | |
50 | + | then throw("Not enough balance") | |
51 | + | else ScriptResult(WriteSet([DataEntry(b, i)]), TransferSet([ScriptTransfer(a.caller, e, unit)])) | |
52 | + | } | |
53 | + | ||
54 | + |
github/deemru/w8io/169f3d6 20.95 ms ◑