tx · 73TcpmZVNJktrLB4FPQ2ogLjJYLW3X4XtcvdFuaE4Gwu 3NBvMDsmunMZC1s4ZyYL574a3b1Lxd7KBp2: -0.00100000 Waves 2022.12.07 14:30 [2349870] smart account 3NBvMDsmunMZC1s4ZyYL574a3b1Lxd7KBp2 > SELF 0.00000000 Waves
{ "type": 13, "id": "73TcpmZVNJktrLB4FPQ2ogLjJYLW3X4XtcvdFuaE4Gwu", "fee": 100000, "feeAssetId": null, "timestamp": 1670412732137, "version": 2, "chainId": 84, "sender": "3NBvMDsmunMZC1s4ZyYL574a3b1Lxd7KBp2", "senderPublicKey": "AsTgeKybMQykzvzHnaFHJv7QfxQcqxsK1f5kWsFf5Jkw", "proofs": [ "2nryoBunLThgZtMNK1ATTzrWX2RsAL38kgLphxS667aaNpUTQ1gCvqwSifERRW6cAFmRLzL31JooDNumsY9BHkRt" ], "script": "base64:BgIJCAISABIDCgEBAAIBaQEHZGVwb3NpdAAEB3BheW1lbnQJAQV2YWx1ZQEIBQFpCHBheW1lbnRzAwMJAGYCCQCQAwEFB3BheW1lbnQAAQYJAQlpc0RlZmluZWQBCAkAkQMCBQdwYXltZW50AAAHYXNzZXRJZAkAAgECKFlvdSBjYW4gb25seSBvbmUgV0FWRVMgZGVwb3NpdCBhdCBhIHRpbWUECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZAIFDWN1cnJlbnRBbW91bnQICQCRAwIFB3BheW1lbnQAAAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAUDbmlsAWkBCHdpdGhkcmF3AQZhbW91bnQECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZQIFDWN1cnJlbnRBbW91bnQFBmFtb3VudAMJAGYCAAAFBmFtb3VudAkAAgECH0Nhbm5vdCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQBmAgAABQluZXdBbW91bnQJAAIBAhJOb3QgZW5vdWdoIGJhbGFuY2UJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUEdW5pdAUDbmlsAEqjwzc=", "height": 2349870, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 9KYjPx62rQJRLYRpvfRFqZe1HJE9bdmiH1ThYCZoA2E2 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func deposit () = { | |
8 | + | let payment = value(i.payments) | |
9 | + | if (if ((size(payment) > 1)) | |
10 | + | then true | |
11 | + | else isDefined(payment[0].assetId)) | |
12 | + | then throw("You can only one WAVES deposit at a time") | |
13 | + | else { | |
14 | + | let currentKey = toBase58String(i.caller.bytes) | |
15 | + | let currentAmount = valueOrElse(getInteger(this, currentKey), 0) | |
16 | + | let newAmount = (currentAmount + payment[0].amount) | |
17 | + | [IntegerEntry(currentKey, newAmount)] | |
18 | + | } | |
19 | + | } | |
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | @Callable(i) | |
24 | + | func withdraw (amount) = { | |
25 | + | let currentKey = toBase58String(i.caller.bytes) | |
26 | + | let currentAmount = valueOrElse(getInteger(this, currentKey), 0) | |
27 | + | let newAmount = (currentAmount - amount) | |
28 | + | if ((0 > amount)) | |
29 | + | then throw("Cannot withdraw negative amount") | |
30 | + | else if ((0 > newAmount)) | |
31 | + | then throw("Not enough balance") | |
32 | + | else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)] | |
33 | + | } | |
34 | + | ||
35 | + |
github/deemru/w8io/169f3d6 15.75 ms ◑