tx · 7g9zk8EgE11znA85kuAvSCARcyqp3usvFBU4aBRuwDko

3N3giqcqo68bVfkcJt2q7zaaWE7iAJAcKcb:  -0.01000010 Waves

2021.07.08 12:28 [1604445] smart account 3N3giqcqo68bVfkcJt2q7zaaWE7iAJAcKcb > SELF 0.00000000 Waves

{ "type": 13, "id": "7g9zk8EgE11znA85kuAvSCARcyqp3usvFBU4aBRuwDko", "fee": 1000010, "feeAssetId": null, "timestamp": 1625736523312, "version": 2, "chainId": 84, "sender": "3N3giqcqo68bVfkcJt2q7zaaWE7iAJAcKcb", "senderPublicKey": "DjiSdNEMrwCK2ABBPRVSzf8xNRsUAy1if8qvaRtPrWkJ", "proofs": [ "3JwE2zaPcVSeH5cRhEzTHhqEsTovzAJEY8oDjXK3JoDVfhecJcfeahZijFLc77RnkzCZ2FxSo3v9wtsgYPrkerJx" ], "script": "base64:AAIFAAAAAAAAAIcIAhIAEgMKAQEaCgoCYTESBHdFVVIaBwoCYTISAWkaCQoCYTMSA3BtdBoQCgJhNBIKY3VycmVudEtleRoTCgJhNRINY3VycmVudEFtb3VudBoNCgJhNhIHJG1hdGNoMBoHCgJhNxIBYRoPCgJhOBIJbmV3QW1vdW50GgwKAmE5EgZhbW91bnQAAAABAAAAAAJhMQEAAAAAAAAAAgAAAAJhMgEAAAAHZGVwb3NpdAAAAAAEAAAAAmEzCQABkQAAAAIIBQAAAAJhMgAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAIhPQAAAAIIBQAAAAJhMwAAAAdhc3NldElkBQAAAAJhMQkAAAIAAAABAgAAABp3RVVSIC0gJ3RlbiBzYW0gY28gd3nFvGVqJwQAAAACYTQJAAJYAAAAAQgIBQAAAAJhMgAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAAmE1BAAAAAJhNgkABBoAAAACBQAAAAR0aGlzBQAAAAJhNAMJAAABAAAAAgUAAAACYTYCAAAAA0ludAQAAAACYTcFAAAAAmE2BQAAAAJhNwAAAAAAAAAAAAQAAAACYTgJAABkAAAAAgUAAAACYTUIBQAAAAJhMwAAAAZhbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAAmE0BQAAAAJhOAUAAAADbmlsAAAAAmEyAQAAAAd3aXRkcmF3AAAAAQAAAAJhOQQAAAACYTQJAAJYAAAAAQgIBQAAAAJhMgAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAAmE1BAAAAAJhNgkABBoAAAACBQAAAAR0aGlzBQAAAAJhNAMJAAABAAAAAgUAAAACYTYCAAAAA0ludAQAAAACYTcFAAAAAmE2BQAAAAJhNwAAAAAAAAAAAAQAAAACYTgJAABlAAAAAgUAAAACYTUFAAAAAmE5AwkAAGYAAAACAAAAAAAAAAAABQAAAAJhOQkAAAIAAAABAgAAAB9jYW4ndCB3aXRoZHJhdyBuZWdhdGl2ZXMgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAJhOAkAAAIAAAABAgAAABJOb3QgZW5vdWdoIGJhbGFuY2UJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAAmE0BQAAAAJhOAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAACYTIAAAAGY2FsbGVyBQAAAAJhOQUAAAACYTEFAAAAA25pbAAAAAB62jm0", "height": 1604445, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 4UX9GT7eJdxnddVYeSW7w4YpQrQdees4GKWicyjFcXwM Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let wEUR = base58''
5+
6+@Callable(i)
7+func deposit () = {
8+ let pmt = i.payments[0]
9+ if ((pmt.assetId != wEUR))
10+ then throw("wEUR - 'ten sam co wyżej'")
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+[IntegerEntry(currentKey, newAmount)]
21+ }
22+ }
23+
24+
25+
26+@Callable(i)
27+func witdraw (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 negatives amount")
38+ else if ((0 > newAmount))
39+ then throw("Not enough balance")
40+ else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, wEUR)]
41+ }
42+
43+

github/deemru/w8io/169f3d6 
18.39 ms