Skip to content

Commit

Permalink
Merge pull request #33 from codingknite/burnt-fees-fix
Browse files Browse the repository at this point in the history
burnt-fees
  • Loading branch information
codingknite authored Oct 24, 2024
2 parents 5c320a7 + a2de5ce commit db3d446
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 128 deletions.
4 changes: 2 additions & 2 deletions lib/hooks/useWvmArchiver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const wvmNetworks = [
wvm_rpc: 'https://testnet-rpc.wvm.dev',
},
{
archive_pool_address: '0xa2A0D977847805fE224B789D8C4d3D711ab251e7',
archiver_address: '0x197f818c1313DC58b32D88078ecdfB40EA822614',
archive_pool_address: '0x0000000000000000000000000000000000000000',
archiver_address: '0xd730fF10Ab359Fc4C0853DF9d108b7E646e645f4',
backfill_address: '0x123463a4B065722E99115D6c222f267d9cABb524',
block_time: 9.0,
name: 'Metis',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"node": ">=20.11.0",
"npm": "10.2.4"
},
"license":"MIT",
"license": "MIT",
"scripts": {
"dev": "./tools/scripts/dev.sh",
"dev:preset": "./tools/scripts/dev.preset.sh",
Expand Down Expand Up @@ -99,6 +99,7 @@
"react-dom": "18.2.0",
"react-google-recaptcha": "^2.1.0",
"react-hook-form": "^7.33.1",
"react-icons": "^5.3.0",
"react-identicons": "^1.2.5",
"react-intersection-observer": "^9.5.2",
"react-jazzicon": "^1.0.4",
Expand Down
5 changes: 0 additions & 5 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
}, []);

const getLayout = Component.getLayout ?? ((page) => <Layout>{ page }</Layout>);
// const isUnderMaintenance = true;

// if (isUnderMaintenance) {
// return <div>Under Maintenance</div>;
// }

return (
<ChakraProvider cookies={ pageProps.cookies }>
Expand Down
124 changes: 7 additions & 117 deletions ui/block/BlockDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import BigNumber from 'bignumber.js';
import capitalize from 'lodash/capitalize';
import { useRouter } from 'next/router';
import React from 'react';
import { TbCoins } from 'react-icons/tb';
import { RotatingLines } from 'react-loader-spinner';
import { scroller, Element } from 'react-scroll';

Expand Down Expand Up @@ -954,132 +955,21 @@ const BlockDetails = ({ query }: Props) => {
<DetailsInfoItem.Label
hint={ `Amount of ${
config.chain.currency.symbol || 'native token'
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
} burned from transactions included in the block.
Equals Block Base Fee per Gas * Gas Used` }
isLoading={ isPlaceholderData }
>
Burnt fees
Network revenue
</DetailsInfoItem.Label>
<DetailsInfoItem.Value>
<IconSvg
name="flame"
boxSize={ 5 }
color="gray.500"
isLoading={ isPlaceholderData }
/>
<Skeleton isLoaded={ !isPlaceholderData } display="inline-block">
<TbCoins size={ 20 } color="gray.500"/>
</Skeleton>
<Skeleton isLoaded={ !isPlaceholderData } ml={ 2 }>
{ burntFees.dividedBy(WEI).toFixed() } { currencyUnits.ether }
</Skeleton>
{ !txFees.isEqualTo(ZERO) && (
<Tooltip label="Burnt fees / Txn fees * 100%">
<Tooltip label="Network revenue / Txn fees * 100%">
<Box>
<Utilization
ml={ 4 }
Expand Down
1 change: 1 addition & 0 deletions ui/snippets/networkMenu/NetworkLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const LogoFallback = ({
name={ isSmall ? `${ iconPath }` : `${ logoPath }` }
width="auto"
height="100%"
color={ colorMode === 'dark' ? 'whiteAlpha.400' : 'blackAlpha.400' }
display={ display }
/>
);
Expand Down
9 changes: 6 additions & 3 deletions ui/tx/details/TxDetailsBurntFees.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Skeleton } from '@chakra-ui/react';
import BigNumber from 'bignumber.js';
import React from 'react';
import { TbCoins } from 'react-icons/tb';

import type { Transaction } from 'types/api/transaction';

Expand All @@ -8,7 +10,6 @@ import { ZERO } from 'lib/consts';
import { currencyUnits } from 'lib/units';
import CurrencyValue from 'ui/shared/CurrencyValue';
import * as DetailsInfoItem from 'ui/shared/DetailsInfoItem';
import IconSvg from 'ui/shared/IconSvg';

const rollupFeature = config.features.rollup;

Expand Down Expand Up @@ -38,10 +39,12 @@ const TxDetailsBurntFees = ({ data, isLoading }: Props) => {
` }
isLoading={ isLoading }
>
Burnt fees
Network revenue
</DetailsInfoItem.Label>
<DetailsInfoItem.Value>
<IconSvg name="flame" boxSize={ 5 } color="gray.500" isLoading={ isLoading }/>
<Skeleton isLoaded={ !isLoading } display="inline-block">
<TbCoins size={ 20 } color="gray.500"/>
</Skeleton>
<CurrencyValue
value={ value.toString() }
currency={ currencyUnits.ether }
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14084,6 +14084,11 @@ react-hook-form@^7.33.1:
resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.37.0.tgz#4d1738f092d3d8a3ade34ee892d97350b1032b19"
integrity sha512-6NFTxsnw+EXSpNNvLr5nFMjPdYKRryQcelTHg7zwBB6vAzfPIcZq4AExP4heVlwdzntepQgwiOQW4z7Mr99Lsg==

react-icons@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-5.3.0.tgz#ccad07a30aebd40a89f8cfa7d82e466019203f1c"
integrity sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==

react-identicons@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/react-identicons/-/react-identicons-1.2.5.tgz#3502249e49d88f4e3500092694410a984bb102fa"
Expand Down

0 comments on commit db3d446

Please sign in to comment.