tx · CswZ794yi2t8uYJiN16y42qgGTTAuY31DvPLmWCiTAP7 3N9avaPFJNarr2zD1KfagE6q8nWnYePF9Dj: -0.01400000 Waves 2022.05.27 13:24 [2069957] smart account 3N9avaPFJNarr2zD1KfagE6q8nWnYePF9Dj > SELF 0.00000000 Waves
{ "type": 13, "id": "CswZ794yi2t8uYJiN16y42qgGTTAuY31DvPLmWCiTAP7", "fee": 1400000, "feeAssetId": null, "timestamp": 1653647060535, "version": 2, "chainId": 84, "sender": "3N9avaPFJNarr2zD1KfagE6q8nWnYePF9Dj", "senderPublicKey": "4jLaQSAvCrA4hSd5XXnwq5w2XhjLTkgTHMyPHK6sx5YU", "proofs": [ "3PRmXjRGVF1TaTYQiNgCe8GTHVTWaKhBLKUXw81iA45jmBMdhkw4wBWtDH8zRjtokEC5b2qmJhEQevbhNspbTPbd" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAABQAAAAADU0VQAgAAAAJfXwAAAAAFTVVMVDYAAAAAAAAPQkAAAAAABU1VTFQ4AAAAAAAF9eEAAAAAAApXQVZFU0lEU1RSAgAAAAVXQVZFUwAAAAAHV0FWRVNJRAkAAlkAAAABBQAAAApXQVZFU0lEU1RSAAAAAQAAAAFpAQAAABVkaXN0cmlidXRlTWluZXJSZXdhcmQAAAABAAAAFGJlbmlmaWNhcnlBZGRyZXNzU3RyAwkBAAAAAiE9AAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAAIAAAABAgAAACBleGFjdCAxIHBheW1lbnQgbXVzdCBiZSBhdHRhY2hlZAMJAQAAAAIhPQAAAAIIBQAAAAFpAAAABmNhbGxlcggFAAAAAWkAAAAMb3JpZ2luQ2FsbGVyCQAAAgAAAAECAAAAImRhcHAgdG8gZGFwcCBjYWxscyBhcmUgbm90IGFsbG93ZWQEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIbWluZWRBbXQIBQAAA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2YWlsYWJsZUJhbGFuY2UAAAAAAAAAAAAJAAACAAAAAQkAASwAAAACCQABLAAAAAICAAAABGFsbCAJAAGkAAAAAQUAAAAQYXZhaWxhYmxlQmFsYW5jZQIAAABBIFdhdmVsZXRzIGZyb20gdGhlIE5vZGUgYmFsYW5jZSBtdXN0IGJlIGF0dGFjaGVkIGludG8gdGhlIHBheW1lbnQEAAAADWJlbmlmaWNhcnlBbXQJAABrAAAAAwUAAAAIbWluZWRBbXQFAAAADmJlbmlmaWNhcnlQYXJ0BQAAAAVNVUxUNgQAAAALcHJvdG9jb2xBbXQJAABlAAAAAgUAAAAIbWluZWRBbXQFAAAADWJlbmlmaWNhcnlBbXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAARYmVuaWZpY2FyeUFkZHJlc3MFAAAADWJlbmlmaWNhcnlBbXQFAAAABHVuaXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAPbmV1dHJpbm9BZGRyZXNzBQAAAAtwcm90b2NvbEFtdAUAAAAEdW5pdAUAAAADbmlsAAAAAEAn614=", "height": 2069957, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEP = "__" | |
5 | + | ||
6 | + | let MULT6 = 1000000 | |
7 | + | ||
8 | + | let MULT8 = 100000000 | |
9 | + | ||
10 | + | let WAVESIDSTR = "WAVES" | |
11 | + | ||
12 | + | let WAVESID = fromBase58String(WAVESIDSTR) | |
13 | + | ||
14 | + | @Callable(i) | |
15 | + | func distributeMinerReward (benificaryAddressStr) = if ((size(i.payments) != 1)) | |
16 | + | then throw("exact 1 payment must be attached") | |
17 | + | else if ((i.caller != i.originCaller)) | |
18 | + | then throw("dapp to dapp calls are not allowed") | |
19 | + | else { | |
20 | + | let pmt = i.payments[0] | |
21 | + | let minedAmt = pmt.amount | |
22 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
23 | + | let feeAmt = i.fee | |
24 | + | let feeAssetId = valueOrElse(i.feeAssetId, WAVESID) | |
25 | + | if ((pmtAssetId != WAVESID)) | |
26 | + | then throw("only Waves can be used in payment") | |
27 | + | else if ((feeAssetId != WAVESID)) | |
28 | + | then throw("only Waves can be used in fees") | |
29 | + | else if ((feeAmt != ((5 * MULT8) / 1000))) | |
30 | + | then throw("fee amount couldn't exceed 0.005") | |
31 | + | else { | |
32 | + | let neutrinoAddress = addressFromStringValue("3NBU8TThHH5YUSk26iGEGU1jHM7vSR3ZTPx") | |
33 | + | let minerAddress = i.caller | |
34 | + | let benificaryAddress = addressFromStringValue(benificaryAddressStr) | |
35 | + | let protocolPart = 950000 | |
36 | + | let benificaryPart = 50000 | |
37 | + | let availableBalance = (wavesBalance(minerAddress).available - feeAmt) | |
38 | + | if ((availableBalance != 0)) | |
39 | + | then throw((("all " + toString(availableBalance)) + " Wavelets from the Node balance must be attached into the payment")) | |
40 | + | else { | |
41 | + | let benificaryAmt = fraction(minedAmt, benificaryPart, MULT6) | |
42 | + | let protocolAmt = (minedAmt - benificaryAmt) | |
43 | + | [ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt, unit)] | |
44 | + | } | |
45 | + | } | |
46 | + | } | |
47 | + | ||
48 | + |
github/deemru/w8io/026f985 28.64 ms ◑