tx · 8bwq8FdCd7WLjzR7LavyAy8jvmsyZLq8jRBvQi9HGH9F 3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp: -0.01000000 Waves 2021.07.16 16:31 [1616224] smart account 3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp > SELF 0.00000000 Waves
{ "type": 13, "id": "8bwq8FdCd7WLjzR7LavyAy8jvmsyZLq8jRBvQi9HGH9F", "fee": 1000000, "feeAssetId": null, "timestamp": 1626442320055, "version": 2, "chainId": 84, "sender": "3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp", "senderPublicKey": "85gydchvWB9gMPFCKM6kfLPWFSATbtGog2Y6rUjhtQKT", "proofs": [ "PFZpuepWenv6sGkQqQBFpMXxPMQVfP2NF2MX9mzMCnnEcN99miPCLCu6z766rtStvFCBcwnsx4EJGmpdeNdv4F6" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAAJc3dhcFRva2VuAQAAACBvje/AxUXc2eIfb1BtN6afnbACpt3QImOf1zkflBhsKAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIWNhbiBob2RsIHdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZAAAAAIFAAAADWN1cnJlbnRBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50CQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAJbmV3QW1vdW50BQAAAAlzd2FwVG9rZW4FAAAAA25pbAAAAAFpAQAAAAh3aXRoZHJhdwAAAAEAAAAGYW1vdW50BAAAAAlzd2FwVG9rZW4BAAAAGgFUpuGHDWW6ayML/sFv6HpdBDFFJLgYCuBFBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAUAAAAGYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAZhbW91bnQJAAACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAKY3VycmVudEtleQUAAAAJbmV3QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAACXN3YXBUb2tlbgUAAAADbmlsAAAAAE/74rg=", "height": 1616224, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FrVvPTCtnqpJUSNCojefZuno4FbUdRoMNqhbj6Y1iX9j Next: 4kgLm4Z8B3qDrdytaQSYq1e7KtpmWFaGGguBaUjxAWfJ Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func deposit () = { | |
8 | - | let swapToken = base58' | |
8 | + | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' | |
9 | 9 | let pmt = extract(i.payment) | |
10 | 10 | if (isDefined(pmt.assetId)) | |
11 | 11 | then throw("can hodl waves only at the moment") |
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(i) | |
7 | 7 | func deposit () = { | |
8 | - | let swapToken = base58' | |
8 | + | let swapToken = base58'8WTnTr8QxFYKhMo7tkjLigfw2zAFFQYzjpoNdSFruTL3' | |
9 | 9 | let pmt = extract(i.payment) | |
10 | 10 | if (isDefined(pmt.assetId)) | |
11 | 11 | then throw("can hodl waves only at the moment") | |
12 | 12 | else { | |
13 | 13 | let currentKey = toBase58String(i.caller.bytes) | |
14 | 14 | let currentAmount = match getInteger(this, currentKey) { | |
15 | 15 | case a: Int => | |
16 | 16 | a | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | let newAmount = (currentAmount + pmt.amount) | |
21 | 21 | TransferSet([ScriptTransfer(i.caller, newAmount, swapToken)]) | |
22 | 22 | } | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(i) | |
28 | 28 | func withdraw (amount) = { | |
29 | 29 | let swapToken = base58'3N58U7hA1kzMTCUqHiJGdcPdjxAKspMgGNp' | |
30 | 30 | let currentKey = toBase58String(i.caller.bytes) | |
31 | 31 | let currentAmount = match getInteger(this, currentKey) { | |
32 | 32 | case a: Int => | |
33 | 33 | a | |
34 | 34 | case _ => | |
35 | 35 | 0 | |
36 | 36 | } | |
37 | 37 | let newAmount = (currentAmount - amount) | |
38 | 38 | if ((0 > amount)) | |
39 | 39 | then throw("Can't withdraw negative amount") | |
40 | 40 | else if ((0 > newAmount)) | |
41 | 41 | then throw("Not enough balance") | |
42 | 42 | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, swapToken)])) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 |
github/deemru/w8io/026f985 29.67 ms ◑