tx · DBVmyjxE3bDnoFEQtALQCrZmDB5ZpVko1ohphE3mD5S5 3MuXabUqfEm4PTf1bmXKGcHVZd3MHb2uhZv: -0.01000000 Waves 2020.11.15 14:34 [1266427] smart account 3MuXabUqfEm4PTf1bmXKGcHVZd3MHb2uhZv > SELF 0.00000000 Waves
{ "type": 13, "id": "DBVmyjxE3bDnoFEQtALQCrZmDB5ZpVko1ohphE3mD5S5", "fee": 1000000, "feeAssetId": null, "timestamp": 1605440111657, "version": 2, "chainId": 84, "sender": "3MuXabUqfEm4PTf1bmXKGcHVZd3MHb2uhZv", "senderPublicKey": "44wybv3E5YPGdGKFkk4ytKoCFF5mgp4hjyKKVnPsMJ4A", "proofs": [ "38batA7kPDsGGDxPN1VaChnjjWmLFcoWSSWTF21UovBcXVPnwaTKcScnUGYNVh1xYWmpEJYSQzNoUoJnB8SLNGh7" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAABAAAAAAdhc3NldGlkAQAAACCCgonXMMJ0Jf3ZydiNkrIRxmBbLNOoIthDrjYHZlh6KQAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABkAAAAAgUAAAANY3VycmVudEFtb3VudAgFAAAAA3BtdAAAAAZhbW91bnQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsAAAAAWkBAAAACHdpdGhkcmF3AAAAAQAAAAZhbW91bnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACW5ld0Ftb3VudAkAAGUAAAACBQAAAA1jdXJyZW50QW1vdW50BQAAAAZhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAABmFtb3VudAkAAAIAAAABAgAAAB5DYW4ndCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAACW5ld0Ftb3VudAkAAAIAAAABAgAAABJOb3QgZW5vdWdoIGJhbGFuY2UJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAApjdXJyZW50S2V5BQAAAAluZXdBbW91bnQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAHYXNzZXRpZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAaNcSup", "height": 1266427, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 9HjMGdiwUkg8RGzLMPHoJ14WzaecNmycAdkEsVPiMCyL Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let assetid = base58'9nTT5Ltef5gPid6qHkvWRYjpcmKiYPgjhFHSGYjGvrsz' | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func deposit () = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | let currentKey = toBase58String(i.caller.bytes) | |
10 | + | let currentAmount = match getInteger(this, currentKey) { | |
11 | + | case a: Int => | |
12 | + | a | |
13 | + | case _ => | |
14 | + | 0 | |
15 | + | } | |
16 | + | let newAmount = (currentAmount + pmt.amount) | |
17 | + | WriteSet([DataEntry(currentKey, newAmount)]) | |
18 | + | } | |
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | @Callable(i) | |
23 | + | func withdraw (amount) = { | |
24 | + | let currentKey = toBase58String(i.caller.bytes) | |
25 | + | let currentAmount = match getInteger(this, currentKey) { | |
26 | + | case a: Int => | |
27 | + | a | |
28 | + | case _ => | |
29 | + | 0 | |
30 | + | } | |
31 | + | let newAmount = (currentAmount - amount) | |
32 | + | if ((0 > amount)) | |
33 | + | then throw("Can't withdraw negative amount") | |
34 | + | else if ((0 > newAmount)) | |
35 | + | then throw("Not enough balance") | |
36 | + | else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, assetid)])) | |
37 | + | } | |
38 | + | ||
39 | + | ||
40 | + | @Verifier(tx) | |
41 | + | func verify () = true | |
42 | + |
github/deemru/w8io/169f3d6 23.67 ms ◑