tx · 36Q47PEuZK1PQMENhJJToAGjJjtToysMLFeYZsUP5qbh 3N4Ux3PBYL7G3CxLz1trx7se9xaSZiKyiWz: -0.01000000 Waves 2022.12.18 15:13 [2365720] smart account 3N4Ux3PBYL7G3CxLz1trx7se9xaSZiKyiWz > SELF 0.00000000 Waves
{ "type": 13, "id": "36Q47PEuZK1PQMENhJJToAGjJjtToysMLFeYZsUP5qbh", "fee": 1000000, "feeAssetId": null, "timestamp": 1671365729896, "version": 2, "chainId": 84, "sender": "3N4Ux3PBYL7G3CxLz1trx7se9xaSZiKyiWz", "senderPublicKey": "GyVshojyNKdnR3NVsHttiwRDYmcodrtCj7V9sFbNAuxF", "proofs": [ "3nD2KfqKLRxRZ8Hjj3agV1mKU6vnQTUfk4X8y26TjjmyvxxEM88FDSBpSzcmzvBZag4WfDmgxpAnK6yX5TVnv2Up" ], "script": "base64:BgIJCAISABIDCgEBAQAPb3BlcmF0b3JBZGRyZXNzASAOG3x9G+NPWhjnhgPt5jQyo6kTNMUApxsG0dvTDxrODwIBaQEHZGVwb3NpdAAEA3BtdAkBBXZhbHVlAQkAkQMCCAUBaQhwYXltZW50cwAAAwkBCWlzRGVmaW5lZAEIBQNwbXQHYXNzZXRJZAkAAgECIWNhbiBob2RsIHdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAQKY3VycmVudEtleQkA2AQBCAgFAWkGY2FsbGVyBWJ5dGVzBA1jdXJyZW50QW1vdW50BAckbWF0Y2gwCQCaCAIFBHRoaXMFCmN1cnJlbnRLZXkDCQABAgUHJG1hdGNoMAIDSW50BAFhBQckbWF0Y2gwBQFhAAAECW5ld0Ftb3VudAkAZAIFDWN1cnJlbnRBbW91bnQIBQNwbXQGYW1vdW50CQDMCAIJAQxJbnRlZ2VyRW50cnkCBQpjdXJyZW50S2V5BQluZXdBbW91bnQFA25pbAFpAQh3aXRoZHJhdwEGYW1vdW50BApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQJbmV3QW1vdW50CQBlAgUNY3VycmVudEFtb3VudAUGYW1vdW50AwkAZgIAAAUGYW1vdW50CQACAQIeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAZgIAAAUJbmV3QW1vdW50CQACAQISTm90IGVub3VnaCBiYWxhbmNlCQDMCAIJAQxJbnRlZ2VyRW50cnkCBQpjdXJyZW50S2V5BQluZXdBbW91bnQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQZhbW91bnQFBHVuaXQFA25pbAECdHgBBnZlcmlmeQAEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACFFNldFNjcmlwdFRyYW5zYWN0aW9uBAFkBQckbWF0Y2gwCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAAASAOG3x9G+NPWhjnhgPt5jQyo6kTNMUApxsG0dvTDxrODwdBcyUg", "height": 2365720, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let operatorAddress = base58'x51ySWMyhE8G2AqJqmDpe3qoQM2aBwmieiJzZLK33JW' | |
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func deposit () = { | |
8 | + | let pmt = value(i.payments[0]) | |
9 | + | if (isDefined(pmt.assetId)) | |
10 | + | then throw("can hodl waves only at the moment") | |
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 withdraw (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 negative amount") | |
38 | + | else if ((0 > newAmount)) | |
39 | + | then throw("Not enough balance") | |
40 | + | else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)] | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | @Verifier(tx) | |
45 | + | func verify () = match tx { | |
46 | + | case d: SetScriptTransaction => | |
47 | + | sigVerify(tx.bodyBytes, tx.proofs[0], base58'x51ySWMyhE8G2AqJqmDpe3qoQM2aBwmieiJzZLK33JW') | |
48 | + | case _ => | |
49 | + | false | |
50 | + | } | |
51 | + |
github/deemru/w8io/169f3d6 31.45 ms ◑