adding block.basefee only if there us baseFeePerGas available

pull/1540/head
lianahus 3 years ago committed by Aniket
parent 4631d6e55d
commit b2eebb1bb8
  1. 4
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx

@ -5,7 +5,6 @@ import { BN } from 'ethereumjs-util'
export const GlobalVariables = ({ block, receipt, tx }) => {
// see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties
const globals = {
'block.basefee': (new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})`,
'block.chainid': tx.chainId,
'block.coinbase': block.miner,
'block.difficulty': block.difficulty,
@ -17,6 +16,9 @@ export const GlobalVariables = ({ block, receipt, tx }) => {
'msg.value': tx.value + ' Wei',
'tx.origin': tx.from
}
if (block.baseFeePerGas)
globals['block.basefee'] = (new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})`
return (
<div id='globalvariable' data-id='globalvariable'>
<DropdownPanel hexHighlight={false} bodyStyle={{ fontFamily: 'monospace' }} dropdownName='Global Variables' calldata={globals || {}} />

Loading…
Cancel
Save