tx · FZP72VRUQTDTFsMEcka1Gqjh57mTSnjxkADJpjSFGyvC 3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW: -0.01400000 Waves 2019.12.22 08:28 [819754] smart account 3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW > SELF 0.00000000 Waves
{ "type": 13, "id": "FZP72VRUQTDTFsMEcka1Gqjh57mTSnjxkADJpjSFGyvC", "fee": 1400000, "feeAssetId": null, "timestamp": 1576992453691, "version": 1, "sender": "3MyV9Fm9cwW9W68VCGfPvejLujx7xVpJiKW", "senderPublicKey": "8zVjiVAuhkkAyQsSHHvjkNNoN8WDKJAEBV5nSpiyyYWr", "proofs": [ "5w5h29SuRsLNo1kJH27SPLaLwSsihNwBGeaz49i7FQnCPRPu6mgohwAbMsh2EFWXaffWyQEEEir5kV3BWdxrkMTe" ], "script": "base64:AAIDAAAAAAAAABcIARIAEgMKAQESABIDCgEBEgASAwoBAQAAAAIAAAAABnBhcjdJZAEAAAAgzlhA/ZjitMWTd+McxVJoK0GcLLGrEdV8aco355LpR4wAAAAABWJ0Y0lkAQAAACC55z+qjxAm26PduiiTGHV+rQKiANia4ToJ1sVRNwsbjQAAAAYAAAABaQEAAAALcGFyN2RlcG9zaXQAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAGcGFyN0lkCQAAAgAAAAECAAAAF1BBUjcgb25seSBhdCB0aGUgbW9tZW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZX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AAAAAAQAAAAJbmV3QW1vdW50CQAAZQAAAAIFAAAADWN1cnJlbnRBbW91bnQFAAAABmFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAGYW1vdW50CQAAAgAAAAECAAAAHkNhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIGFtb3VudAMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAVidGNJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmTs4EI", "chainId": 84, "height": 819754, "spentComplexity": 0 } View: original | compacted Prev: Nd8Uof2JkmGtcqYcmaYeQU8xi4DbWYQSTfa1sbhLnuL Next: EprzdgqwojEiyWHBfK7PRkZz8pzkeurExq8jAmuN8NLm Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let par7Id = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
5 | - | ||
6 | - | let wavesId = base58'WAVES' | |
7 | 5 | ||
8 | 6 | let btcId = base58'DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn' | |
9 | 7 | ||
49 | 47 | @Callable(i) | |
50 | 48 | func wavesdeposit () = { | |
51 | 49 | let pmt = extract(i.payment) | |
52 | - | if ((pmt.assetId | |
53 | - | then throw(" | |
50 | + | if (isDefined(pmt.assetId)) | |
51 | + | then throw("WAVES only at the moment") | |
54 | 52 | else { | |
55 | 53 | let currentKey = toBase58String(i.caller.bytes) | |
56 | 54 | let currentAmount = match getInteger(this, currentKey) { | |
80 | 78 | then throw("Can't withdraw negative amount") | |
81 | 79 | else if ((0 > newAmount)) | |
82 | 80 | then throw("Not enough balance") | |
83 | - | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, | |
81 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
84 | 82 | } | |
85 | 83 | ||
86 | 84 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let par7Id = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
5 | - | ||
6 | - | let wavesId = base58'WAVES' | |
7 | 5 | ||
8 | 6 | let btcId = base58'DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn' | |
9 | 7 | ||
10 | 8 | @Callable(i) | |
11 | 9 | func par7deposit () = { | |
12 | 10 | let pmt = extract(i.payment) | |
13 | 11 | if ((pmt.assetId != par7Id)) | |
14 | 12 | then throw("PAR7 only at the moment") | |
15 | 13 | else { | |
16 | 14 | let currentKey = toBase58String(i.caller.bytes) | |
17 | 15 | let currentAmount = match getInteger(this, currentKey) { | |
18 | 16 | case a: Int => | |
19 | 17 | a | |
20 | 18 | case _ => | |
21 | 19 | 0 | |
22 | 20 | } | |
23 | 21 | let newAmount = (currentAmount + pmt.amount) | |
24 | 22 | WriteSet([DataEntry(currentKey, newAmount)]) | |
25 | 23 | } | |
26 | 24 | } | |
27 | 25 | ||
28 | 26 | ||
29 | 27 | ||
30 | 28 | @Callable(i) | |
31 | 29 | func par7withdraw (amount) = { | |
32 | 30 | let currentKey = toBase58String(i.caller.bytes) | |
33 | 31 | let currentAmount = match getInteger(this, currentKey) { | |
34 | 32 | case a: Int => | |
35 | 33 | a | |
36 | 34 | case _ => | |
37 | 35 | 0 | |
38 | 36 | } | |
39 | 37 | let newAmount = (currentAmount - amount) | |
40 | 38 | if ((0 > amount)) | |
41 | 39 | then throw("Can't withdraw negative amount") | |
42 | 40 | else if ((0 > newAmount)) | |
43 | 41 | then throw("Not enough balance") | |
44 | 42 | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, par7Id)])) | |
45 | 43 | } | |
46 | 44 | ||
47 | 45 | ||
48 | 46 | ||
49 | 47 | @Callable(i) | |
50 | 48 | func wavesdeposit () = { | |
51 | 49 | let pmt = extract(i.payment) | |
52 | - | if ((pmt.assetId | |
53 | - | then throw(" | |
50 | + | if (isDefined(pmt.assetId)) | |
51 | + | then throw("WAVES only at the moment") | |
54 | 52 | else { | |
55 | 53 | let currentKey = toBase58String(i.caller.bytes) | |
56 | 54 | let currentAmount = match getInteger(this, currentKey) { | |
57 | 55 | case a: Int => | |
58 | 56 | a | |
59 | 57 | case _ => | |
60 | 58 | 0 | |
61 | 59 | } | |
62 | 60 | let newAmount = (currentAmount + pmt.amount) | |
63 | 61 | WriteSet([DataEntry(currentKey, newAmount)]) | |
64 | 62 | } | |
65 | 63 | } | |
66 | 64 | ||
67 | 65 | ||
68 | 66 | ||
69 | 67 | @Callable(i) | |
70 | 68 | func waveswithdraw (amount) = { | |
71 | 69 | let currentKey = toBase58String(i.caller.bytes) | |
72 | 70 | let currentAmount = match getInteger(this, currentKey) { | |
73 | 71 | case a: Int => | |
74 | 72 | a | |
75 | 73 | case _ => | |
76 | 74 | 0 | |
77 | 75 | } | |
78 | 76 | let newAmount = (currentAmount - amount) | |
79 | 77 | if ((0 > amount)) | |
80 | 78 | then throw("Can't withdraw negative amount") | |
81 | 79 | else if ((0 > newAmount)) | |
82 | 80 | then throw("Not enough balance") | |
83 | - | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, | |
81 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
84 | 82 | } | |
85 | 83 | ||
86 | 84 | ||
87 | 85 | ||
88 | 86 | @Callable(i) | |
89 | 87 | func btcdeposit () = { | |
90 | 88 | let pmt = extract(i.payment) | |
91 | 89 | if ((pmt.assetId != btcId)) | |
92 | 90 | then throw("btc only at the moment") | |
93 | 91 | else { | |
94 | 92 | let currentKey = toBase58String(i.caller.bytes) | |
95 | 93 | let currentAmount = match getInteger(this, currentKey) { | |
96 | 94 | case a: Int => | |
97 | 95 | a | |
98 | 96 | case _ => | |
99 | 97 | 0 | |
100 | 98 | } | |
101 | 99 | let newAmount = (currentAmount + pmt.amount) | |
102 | 100 | WriteSet([DataEntry(currentKey, newAmount)]) | |
103 | 101 | } | |
104 | 102 | } | |
105 | 103 | ||
106 | 104 | ||
107 | 105 | ||
108 | 106 | @Callable(i) | |
109 | 107 | func btcwithdraw (amount) = { | |
110 | 108 | let currentKey = toBase58String(i.caller.bytes) | |
111 | 109 | let currentAmount = match getInteger(this, currentKey) { | |
112 | 110 | case a: Int => | |
113 | 111 | a | |
114 | 112 | case _ => | |
115 | 113 | 0 | |
116 | 114 | } | |
117 | 115 | let newAmount = (currentAmount - amount) | |
118 | 116 | if ((0 > amount)) | |
119 | 117 | then throw("Can't withdraw negative amount") | |
120 | 118 | else if ((0 > newAmount)) | |
121 | 119 | then throw("Not enough balance") | |
122 | 120 | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, btcId)])) | |
123 | 121 | } | |
124 | 122 | ||
125 | 123 | ||
126 | 124 | @Verifier(tx) | |
127 | 125 | func verify () = match tx { | |
128 | 126 | case d: InvokeScriptTransaction => | |
129 | 127 | true | |
130 | 128 | case _ => | |
131 | 129 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
132 | 130 | } | |
133 | 131 |
github/deemru/w8io/169f3d6 42.85 ms ◑