tx · 3rspKqb9kjzZRZXCWoqZyWUgM9yRF4xje3fMjnEcBhQc 3N4Lz2iWoYPd82cxU6vMMa8cZ9BCcPCaaXu: -0.00200000 Waves 2022.07.21 01:01 [2148654] smart account 3N4Lz2iWoYPd82cxU6vMMa8cZ9BCcPCaaXu > SELF 0.00000000 Waves
{ "type": 13, "id": "3rspKqb9kjzZRZXCWoqZyWUgM9yRF4xje3fMjnEcBhQc", "fee": 200000, "feeAssetId": null, "timestamp": 1658354471026, "version": 2, "chainId": 84, "sender": "3N4Lz2iWoYPd82cxU6vMMa8cZ9BCcPCaaXu", "senderPublicKey": "5sUTyr8zPCCZHgVwgBgFhQA8Q26w2V1dnitx3izrEJ1B", "proofs": [ "4dFSzi3bhNUA8Ze43x3qNvhgDbVZ2BTeWH2LByHF9jzTRAG4b8xB2mSn6vnsENCKLYQ5GVBqkFLSeUNh3nEfAdbb" ], "script": "base64:AAIDAAAAAAAAAFcIARIAEgMKAQEiAWkiA3BtdCIKY3VycmVudEtleSINY3VycmVudEFtb3VudCIHJG1hdGNoMCIBYSIJbmV3QW1vdW50IgZhbW91bnQiAnR4IgZ2ZXJpZnkAAAAAAAAAAgAAAAFhAQAAABVkaXN0cmlidXRlTWluZXJSZXdhcmQAAAAABAAAAAFiCQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFhAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAAWIAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAAWMJAAJYAAAAAQgIBQAAAAFhAAAABmNhbGxlcgAAAAVieXRlcwQAAAABZAQAAAABZQkABBoAAAACBQAAAAR0aGlzBQAAAAFjAwkAAAEAAAACBQAAAAFlAgAAAANJbnQEAAAAAWYFAAAAAWUFAAAAAWYAAAAAAAAAAAAEAAAAAWcJAABkAAAAAgUAAAABZAgFAAAAAWIAAAAGYW1vdW50CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAFjBQAAAAFnBQAAAANuaWwAAAABYQEAAAAId2l0aGRyYXcAAAABAAAAAWgEAAAAAWMJAAJYAAAAAQgIBQAAAAFhAAAABmNhbGxlcgAAAAVieXRlcwQAAAABZAQAAAABZQkABBoAAAACBQAAAAR0aGlzBQAAAAFjAwkAAAEAAAACBQAAAAFlAgAAAANJbnQEAAAAAWYFAAAAAWUFAAAAAWYAAAAAAAAAAAAEAAAAAWcJAABlAAAAAgUAAAABZAUAAAABaAMJAABmAAAAAgAAAAAAAAAAAAUAAAABaAkAAAIAAAABAgAAAB5DYW4ndCB3aXRoZHJhdyBuZWdhdGl2ZSBhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAAAWcJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAABYwUAAAABZwUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFhAAAABmNhbGxlcgUAAAABaAUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAFpAQAAAAFqAAAAAAkAAfQAAAADCAUAAAABaQAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAWkAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAABaQAAAA9zZW5kZXJQdWJsaWNLZXnl9iOS", "height": 2148654, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: HPdgpUHczLMJjQhsCJGcRBywR2kzjaWvz5LqeKhNeAyg Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func distributeMinerReward () = { | |
8 | + | let pmt = extract(i.payment) | |
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 | + | WriteSet([DataEntry(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 ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | @Verifier(tx) | |
45 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
46 | + |
github/deemru/w8io/026f985 20.09 ms ◑