tx · 8iWHavz3BRQY5VXrNiLAf197u3BnyTbs6grEwpHKyuAm 3MwJL2DqwKdgVQ2Aw5ov1rTEmGTKEkK1wET: -0.00100000 Waves 2023.05.15 14:01 [2578981] smart account 3MwJL2DqwKdgVQ2Aw5ov1rTEmGTKEkK1wET > SELF 0.00000000 Waves
{ "type": 13, "id": "8iWHavz3BRQY5VXrNiLAf197u3BnyTbs6grEwpHKyuAm", "fee": 100000, "feeAssetId": null, "timestamp": 1684148486516, "version": 2, "chainId": 84, "sender": "3MwJL2DqwKdgVQ2Aw5ov1rTEmGTKEkK1wET", "senderPublicKey": "ACNdxdXUS5uLiYS4LMdrApJBVCQj8FDMHEknQkNYCUaK", "proofs": [ "4HtXJ6xiRJ7LhqC2aBPwRujneq2TrKSHLkctRoseeNJBWv3H7f9hTk34kYswUHELKjNQbQDef8RaiRD9cCPpcukQ" ], "script": "base64:BgIPCAISABIDCgEBEgQKAgEIAAMBaQEHZGVwb3NpdAAEB3BheW1lbnQJAQV2YWx1ZQEIBQFpCHBheW1lbnRzAwMJAGYCCQCQAwEFB3BheW1lbnQAAQYJAQlpc0RlZmluZWQBCAkAkQMCBQdwYXltZW50AAAHYXNzZXRJZAkAAgECKFlvdSBjYW4gb25seSBvbmUgV0FWRVMgZGVwb3NpdCBhdCBhIHRpbWUECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZAIFDWN1cnJlbnRBbW91bnQICQCRAwIFB3BheW1lbnQAAAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAUDbmlsAWkBCHdpdGhkcmF3AQZhbW91bnQECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQpjdXJyZW50S2V5AAAECW5ld0Ftb3VudAkAZQIFDWN1cnJlbnRBbW91bnQFBmFtb3VudAMJAGYCAAAFBmFtb3VudAkAAgECH0Nhbm5vdCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQBmAgAABQluZXdBbW91bnQJAAIBAhJOb3QgZW5vdWdoIGJhbGFuY2UJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUEdW5pdAUDbmlsAWkBCWRlcFN3YXZlcwIGYW1vdW50DWFkZHJlc3NTd2F2ZXMECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQHYWRkcmVzcwkApggBBQ1hZGRyZXNzU3dhdmVzBA1jdXJyZW50QW1vdW50BQZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFDWN1cnJlbnRBbW91bnQFA25pbAECdHgBBnZlcmlmeQAEByRtYXRjaDAFAnR4CQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5b6TWXw==", "height": 2578981, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 3yx3LVRJ798vX5wWjsxQgXFfyUwQevu9XDnXqAJ2ADrt 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 | + | ||
36 | + | ||
37 | + | @Callable(i) | |
38 | + | func depSwaves (amount,addressSwaves) = { | |
39 | + | let currentKey = toBase58String(i.caller.bytes) | |
40 | + | let address = addressFromString(addressSwaves) | |
41 | + | let currentAmount = amount | |
42 | + | [IntegerEntry(currentKey, currentAmount)] | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | @Verifier(tx) | |
47 | + | func verify () = match tx { | |
48 | + | case _ => | |
49 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
50 | + | } | |
51 | + |
github/deemru/w8io/169f3d6 15.48 ms ◑