Skip to content

Commit

Permalink
Enable 1559 on xDAI (#4249)
Browse files Browse the repository at this point in the history
* Enable 1559 for xDAI

* Change trigger for showing fee fiat value slightly
  • Loading branch information
FrederikBolding committed Jan 6, 2022
1 parent f97c4ad commit 85db86b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/components/TransactionFeeEIP1559.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const TransactionFeeEIP1559 = ({
avgFeeFiat,
maxFee,
maxFeeFiat,
hasFiatValue
hasSignificantFiatValue
} = calculateMinMaxFee({ baseFee, baseAssetRate, maxFeePerGas, maxPriorityFeePerGas, gasLimit });

return (
Expand Down Expand Up @@ -162,7 +162,7 @@ export const TransactionFeeEIP1559 = ({
<Box variant="rowAlign" justifyContent="space-between">
<Box>
<Body mb="0" fontWeight="bold" color="GREYISH_BROWN" fontSize="3">
{hasFiatValue ? (
{hasSignificantFiatValue ? (
<Currency
bold={true}
amount={avgFeeFiat.toString(10)}
Expand All @@ -181,18 +181,18 @@ export const TransactionFeeEIP1559 = ({
</Body>
<Body mt="1" mb="0" color="BLUE_GREY">
{translateRaw('CUSTOMIZED_TOTAL_FEE')}{' '}
{hasFiatValue && `(${avgFee.toFixed(6)} ${baseAsset.ticker})`}
{hasSignificantFiatValue && `(${avgFee.toFixed(6)} ${baseAsset.ticker})`}
</Body>
</Box>
<Box>
<Body mb="0" fontWeight="bold" color="GREYISH_BROWN" textAlign="right" fontSize="2">
{hasFiatValue ? (
{hasSignificantFiatValue ? (
<Currency bold={true} amount={minFeeFiat.toString(10)} decimals={2} />
) : (
<Currency bold={true} amount={minFee.toString(10)} />
)}
{' - '}
{hasFiatValue ? (
{hasSignificantFiatValue ? (
<Currency
bold={true}
amount={maxFeeFiat.toString(10)}
Expand Down
3 changes: 2 additions & 1 deletion src/database/data/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,8 @@ export const NETWORKS_CONFIG: NetworkConfig = {
max: 30,
initial: 1
},
shouldEstimateGasPrice: false
shouldEstimateGasPrice: false,
supportsEIP1559: true
},
SmartChain: {
id: 'SmartChain',
Expand Down
5 changes: 3 additions & 2 deletions src/utils/eip1559.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const calculateMinMaxFee = ({

const maxFee = gasStringsToMaxGasNumber(maxFeePerGas, gasLimit);
const maxFeeFiat = maxFee.multipliedBy(baseAssetRate);
const hasFiatValue = maxFeeFiat.gt(0);
// Changed this from >0 to >=0.01 because 0.01 is the lowest fiat value we show in the UI
const hasSignificantFiatValue = maxFeeFiat.gte(0.01);

const minMaxFee =
viewableBaseFee &&
Expand All @@ -45,7 +46,7 @@ export const calculateMinMaxFee = ({
avgFeeFiat,
maxFee,
maxFeeFiat,
hasFiatValue,
hasSignificantFiatValue,
viewableBaseFee
};
};

0 comments on commit 85db86b

Please sign in to comment.