diff --git a/src/transaction/RewardSplit.tsx b/src/transaction/RewardSplit.tsx index 7ff4a57..23c527d 100644 --- a/src/transaction/RewardSplit.tsx +++ b/src/transaction/RewardSplit.tsx @@ -10,11 +10,13 @@ type RewardSplitProps = { }; const RewardSplit: React.FC = ({ txData }) => { + const paidFees = txData.gasPrice.mul(txData.gasUsed); const burntFees = txData.blockBaseFeePerGas!.mul(txData.gasUsed); - const minerReward = txData.gasPrice.mul(txData.gasUsed).sub(burntFees); + + const minerReward = paidFees.sub(burntFees); const burntPerc = - burntFees.mul(10000).div(txData.gasPrice.mul(txData.gasUsed)).toNumber() / - 100; + Math.round(burntFees.mul(10000).div(paidFees).toNumber()) / 100; + const minerPerc = Math.round((100 - burntPerc) * 100) / 100; return (
@@ -39,7 +41,7 @@ const RewardSplit: React.FC = ({ txData }) => {