|
|
|
@ -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 || {}} /> |
|
|
|
|