tx · 2bwD2KnrNsav44RxUnFY79o5PxJoGe3annjqpiDDmamy

3N4Lz2iWoYPd82cxU6vMMa8cZ9BCcPCaaXu:  -0.00100000 Waves

2022.07.21 05:10 [2148900] smart account 3N4Lz2iWoYPd82cxU6vMMa8cZ9BCcPCaaXu > SELF 0.00000000 Waves

{ "type": 13, "id": "2bwD2KnrNsav44RxUnFY79o5PxJoGe3annjqpiDDmamy", "fee": 100000, "feeAssetId": null, "timestamp": 1658369508967, "version": 1, "sender": "3N4Lz2iWoYPd82cxU6vMMa8cZ9BCcPCaaXu", "senderPublicKey": "5sUTyr8zPCCZHgVwgBgFhQA8Q26w2V1dnitx3izrEJ1B", "proofs": [ "2FpcihprJyVFkS4pkgAuUwneALsHaHDd7SsTV6MeSRFh96DF5ybCqVCAkehnU3j42EmeLSuoqvcwkRR69TkoxiZr" ], "script": null, "chainId": 84, "height": 2148900, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Csua48LfL5d1Ye9uUTJps4WrQb2Bbq5Wd63RNdnnkJLr Next: B2kbjLdziDLTFkkXWzhjvAnAnjYnwq2gN48gQzip34ei Full:
OldNewDifferences
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("3N4Lz2iWoYPd82cxU6vMMa8cZ9BCcPCaaXu")
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- let benificaryAmt = fraction(minedAmt, benificaryPart, MULT6)
39- let protocolAmt = (minedAmt - benificaryAmt)
40-[ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt, unit)]
41- }
42- }
43-
44-
1+# no script

github/deemru/w8io/026f985 
26.19 ms