hardhat 2.11.0-dev.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builtin-tasks/clean.js +2 -1
- package/builtin-tasks/clean.js.map +1 -1
- package/builtin-tasks/compile.js +52 -95
- package/builtin-tasks/compile.js.map +1 -1
- package/builtin-tasks/flatten.js +2 -21
- package/builtin-tasks/flatten.js.map +1 -1
- package/builtin-tasks/node.js +1 -1
- package/builtin-tasks/node.js.map +1 -1
- package/builtin-tasks/test.js +3 -3
- package/builtin-tasks/test.js.map +1 -1
- package/builtin-tasks/utils/solidity-files-cache.d.ts.map +1 -1
- package/builtin-tasks/utils/solidity-files-cache.js +5 -6
- package/builtin-tasks/utils/solidity-files-cache.js.map +1 -1
- package/internal/artifacts.d.ts +3 -11
- package/internal/artifacts.d.ts.map +1 -1
- package/internal/artifacts.js +266 -133
- package/internal/artifacts.js.map +1 -1
- package/internal/cli/cli.js +26 -12
- package/internal/cli/cli.js.map +1 -1
- package/internal/core/config/config-loading.js +2 -2
- package/internal/core/config/config-loading.js.map +1 -1
- package/internal/core/config/config-resolution.d.ts.map +1 -1
- package/internal/core/config/config-resolution.js +11 -31
- package/internal/core/config/config-resolution.js.map +1 -1
- package/internal/core/config/default-config.js +1 -1
- package/internal/core/config/default-config.js.map +1 -1
- package/internal/core/errors-list.d.ts +7 -0
- package/internal/core/errors-list.d.ts.map +1 -1
- package/internal/core/errors-list.js +28 -11
- package/internal/core/errors-list.js.map +1 -1
- package/internal/core/errors.d.ts +2 -1
- package/internal/core/errors.d.ts.map +1 -1
- package/internal/core/errors.js +5 -1
- package/internal/core/errors.js.map +1 -1
- package/internal/core/execution-mode.d.ts.map +1 -1
- package/internal/core/execution-mode.js +2 -21
- package/internal/core/execution-mode.js.map +1 -1
- package/internal/core/flamegraph.d.ts +4 -0
- package/internal/core/flamegraph.d.ts.map +1 -1
- package/internal/core/flamegraph.js +13 -3
- package/internal/core/flamegraph.js.map +1 -1
- package/internal/core/jsonrpc/types/base-types.d.ts.map +1 -1
- package/internal/core/jsonrpc/types/base-types.js +12 -12
- package/internal/core/jsonrpc/types/base-types.js.map +1 -1
- package/internal/core/params/hardhat-params.d.ts.map +1 -1
- package/internal/core/params/hardhat-params.js +18 -0
- package/internal/core/params/hardhat-params.js.map +1 -1
- package/internal/core/providers/accounts.js +9 -9
- package/internal/core/providers/accounts.js.map +1 -1
- package/internal/core/providers/construction.d.ts.map +1 -1
- package/internal/core/providers/construction.js +5 -6
- package/internal/core/providers/construction.js.map +1 -1
- package/internal/core/providers/gas-providers.d.ts +2 -2
- package/internal/core/providers/util.js +1 -1
- package/internal/core/providers/util.js.map +1 -1
- package/internal/core/runtime-environment.d.ts +6 -0
- package/internal/core/runtime-environment.d.ts.map +1 -1
- package/internal/core/runtime-environment.js +72 -6
- package/internal/core/runtime-environment.js.map +1 -1
- package/internal/core/typescript-support.d.ts +1 -1
- package/internal/core/typescript-support.d.ts.map +1 -1
- package/internal/core/typescript-support.js +6 -2
- package/internal/core/typescript-support.js.map +1 -1
- package/internal/hardhat-network/jsonrpc/client.d.ts +1 -1
- package/internal/hardhat-network/jsonrpc/client.d.ts.map +1 -1
- package/internal/hardhat-network/jsonrpc/client.js +10 -10
- package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
- package/internal/hardhat-network/provider/BlockchainBase.d.ts +4 -4
- package/internal/hardhat-network/provider/BlockchainBase.d.ts.map +1 -1
- package/internal/hardhat-network/provider/BlockchainBase.js +31 -12
- package/internal/hardhat-network/provider/BlockchainBase.js.map +1 -1
- package/internal/hardhat-network/provider/BlockchainData.d.ts +3 -3
- package/internal/hardhat-network/provider/BlockchainData.d.ts.map +1 -1
- package/internal/hardhat-network/provider/BlockchainData.js +15 -15
- package/internal/hardhat-network/provider/BlockchainData.js.map +1 -1
- package/internal/hardhat-network/provider/HardhatBlockchain.d.ts +3 -3
- package/internal/hardhat-network/provider/HardhatBlockchain.d.ts.map +1 -1
- package/internal/hardhat-network/provider/HardhatBlockchain.js +2 -2
- package/internal/hardhat-network/provider/HardhatBlockchain.js.map +1 -1
- package/internal/hardhat-network/provider/PoolState.d.ts +1 -1
- package/internal/hardhat-network/provider/PoolState.d.ts.map +1 -1
- package/internal/hardhat-network/provider/PoolState.js +21 -2
- package/internal/hardhat-network/provider/PoolState.js.map +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.d.ts +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.d.ts.map +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.js +22 -3
- package/internal/hardhat-network/provider/TransactionQueue.js.map +1 -1
- package/internal/hardhat-network/provider/TxPool.d.ts +4 -4
- package/internal/hardhat-network/provider/TxPool.d.ts.map +1 -1
- package/internal/hardhat-network/provider/TxPool.js +35 -16
- package/internal/hardhat-network/provider/TxPool.js.map +1 -1
- package/internal/hardhat-network/provider/ethereumjs-workarounds.js +4 -4
- package/internal/hardhat-network/provider/ethereumjs-workarounds.js.map +1 -1
- package/internal/hardhat-network/provider/filter.d.ts +1 -1
- package/internal/hardhat-network/provider/filter.d.ts.map +1 -1
- package/internal/hardhat-network/provider/filter.js +3 -3
- package/internal/hardhat-network/provider/filter.js.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts +3 -3
- package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkBlockchain.js +13 -12
- package/internal/hardhat-network/provider/fork/ForkBlockchain.js.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts +3 -5
- package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkStateManager.js +36 -40
- package/internal/hardhat-network/provider/fork/ForkStateManager.js.map +1 -1
- package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts +1 -1
- package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts +2 -2
- package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/rpcToTxData.js.map +1 -1
- package/internal/hardhat-network/provider/modules/eth.d.ts +1 -1
- package/internal/hardhat-network/provider/modules/eth.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/eth.js +22 -22
- package/internal/hardhat-network/provider/modules/eth.js.map +1 -1
- package/internal/hardhat-network/provider/modules/hardhat.d.ts +2 -0
- package/internal/hardhat-network/provider/modules/hardhat.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/hardhat.js +20 -6
- package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -1
- package/internal/hardhat-network/provider/modules/logger.d.ts +2 -2
- package/internal/hardhat-network/provider/modules/logger.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/logger.js +14 -14
- package/internal/hardhat-network/provider/modules/logger.js.map +1 -1
- package/internal/hardhat-network/provider/modules/net.d.ts +1 -1
- package/internal/hardhat-network/provider/modules/net.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/personal.js +3 -3
- package/internal/hardhat-network/provider/modules/personal.js.map +1 -1
- package/internal/hardhat-network/provider/modules/web3.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/web3.js +4 -5
- package/internal/hardhat-network/provider/modules/web3.js.map +1 -1
- package/internal/hardhat-network/provider/node-types.d.ts +4 -4
- package/internal/hardhat-network/provider/node-types.d.ts.map +1 -1
- package/internal/hardhat-network/provider/node.d.ts +5 -4
- package/internal/hardhat-network/provider/node.d.ts.map +1 -1
- package/internal/hardhat-network/provider/node.js +71 -49
- package/internal/hardhat-network/provider/node.js.map +1 -1
- package/internal/hardhat-network/provider/output.d.ts +4 -4
- package/internal/hardhat-network/provider/output.d.ts.map +1 -1
- package/internal/hardhat-network/provider/output.js +24 -5
- package/internal/hardhat-network/provider/output.js.map +1 -1
- package/internal/hardhat-network/provider/provider.d.ts +2 -2
- package/internal/hardhat-network/provider/provider.d.ts.map +1 -1
- package/internal/hardhat-network/provider/provider.js +3 -3
- package/internal/hardhat-network/provider/provider.js.map +1 -1
- package/internal/hardhat-network/provider/return-data.d.ts +1 -1
- package/internal/hardhat-network/provider/return-data.d.ts.map +1 -1
- package/internal/hardhat-network/provider/return-data.js +5 -4
- package/internal/hardhat-network/provider/return-data.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts +4 -4
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js +8 -8
- package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js +8 -8
- package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js +5 -5
- package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts +4 -4
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js +25 -6
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js +25 -6
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts +3 -3
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts.map +1 -1
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js +2 -2
- package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js.map +1 -1
- package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts +2 -2
- package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeAccount.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/makeAccount.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeAccount.js +4 -4
- package/internal/hardhat-network/provider/utils/makeAccount.js.map +1 -1
- package/internal/hardhat-network/provider/utils/makeCommon.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/makeCommon.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeCommon.js +2 -2
- package/internal/hardhat-network/provider/utils/makeCommon.js.map +1 -1
- package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/makeStateTrie.js +4 -4
- package/internal/hardhat-network/provider/utils/makeStateTrie.js.map +1 -1
- package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts +3 -3
- package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/putGenesisBlock.js +4 -4
- package/internal/hardhat-network/provider/utils/putGenesisBlock.js.map +1 -1
- package/internal/hardhat-network/provider/utils/random.d.ts +2 -1
- package/internal/hardhat-network/provider/utils/random.d.ts.map +1 -1
- package/internal/hardhat-network/provider/utils/random.js +10 -9
- package/internal/hardhat-network/provider/utils/random.js.map +1 -1
- package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js +21 -2
- package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js.map +1 -1
- package/internal/hardhat-network/provider/utils/txMapToArray.d.ts +1 -1
- package/internal/hardhat-network/provider/utils/txMapToArray.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/consoleLogger.js +45 -45
- package/internal/hardhat-network/stack-traces/consoleLogger.js.map +1 -1
- package/internal/hardhat-network/stack-traces/constants.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/constants.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/constants.js +1 -1
- package/internal/hardhat-network/stack-traces/constants.js.map +1 -1
- package/internal/hardhat-network/stack-traces/contracts-identifier.js +2 -2
- package/internal/hardhat-network/stack-traces/contracts-identifier.js.map +1 -1
- package/internal/hardhat-network/stack-traces/debug.js +13 -13
- package/internal/hardhat-network/stack-traces/debug.js.map +1 -1
- package/internal/hardhat-network/stack-traces/error-inferrer.js +2 -2
- package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
- package/internal/hardhat-network/stack-traces/message-trace.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/message-trace.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/model.js +6 -6
- package/internal/hardhat-network/stack-traces/model.js.map +1 -1
- package/internal/hardhat-network/stack-traces/panic-errors.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/panic-errors.js +9 -9
- package/internal/hardhat-network/stack-traces/panic-errors.js.map +1 -1
- package/internal/hardhat-network/stack-traces/solidity-errors.js +3 -3
- package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
- package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/solidityTracer.d.ts +0 -2
- package/internal/hardhat-network/stack-traces/solidityTracer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/solidityTracer.js +2 -4
- package/internal/hardhat-network/stack-traces/solidityTracer.js.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +27 -25
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-tracer.d.ts +2 -2
- package/internal/hardhat-network/stack-traces/vm-tracer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-tracer.js +15 -12
- package/internal/hardhat-network/stack-traces/vm-tracer.js.map +1 -1
- package/internal/lib/hardhat-lib.d.ts.map +1 -1
- package/internal/lib/hardhat-lib.js +0 -2
- package/internal/lib/hardhat-lib.js.map +1 -1
- package/internal/solidity/compilation-job.d.ts.map +1 -1
- package/internal/solidity/compilation-job.js +6 -7
- package/internal/solidity/compilation-job.js.map +1 -1
- package/internal/solidity/compiler/downloader.d.ts +66 -40
- package/internal/solidity/compiler/downloader.d.ts.map +1 -1
- package/internal/solidity/compiler/downloader.js +180 -154
- package/internal/solidity/compiler/downloader.js.map +1 -1
- package/internal/solidity/compiler/index.d.ts +8 -4
- package/internal/solidity/compiler/index.d.ts.map +1 -1
- package/internal/solidity/compiler/index.js +1 -1
- package/internal/solidity/compiler/index.js.map +1 -1
- package/internal/solidity/dependencyGraph.d.ts.map +1 -1
- package/internal/solidity/dependencyGraph.js +3 -5
- package/internal/solidity/dependencyGraph.js.map +1 -1
- package/internal/solidity/parse.d.ts.map +1 -1
- package/internal/solidity/parse.js +2 -58
- package/internal/solidity/parse.js.map +1 -1
- package/internal/solidity/resolver.d.ts +1 -0
- package/internal/solidity/resolver.d.ts.map +1 -1
- package/internal/solidity/resolver.js +33 -8
- package/internal/solidity/resolver.js.map +1 -1
- package/internal/util/bigint.d.ts +13 -24
- package/internal/util/bigint.d.ts.map +1 -1
- package/internal/util/bigint.js +22 -29
- package/internal/util/bigint.js.map +1 -1
- package/internal/util/download.d.ts.map +1 -1
- package/internal/util/download.js +1 -1
- package/internal/util/download.js.map +1 -1
- package/internal/util/fs-utils.d.ts +26 -9
- package/internal/util/fs-utils.d.ts.map +1 -1
- package/internal/util/fs-utils.js +111 -68
- package/internal/util/fs-utils.js.map +1 -1
- package/internal/util/glob.d.ts +13 -0
- package/internal/util/glob.d.ts.map +1 -1
- package/internal/util/glob.js +13 -0
- package/internal/util/glob.js.map +1 -1
- package/internal/util/keccak.d.ts +3 -0
- package/internal/util/keccak.d.ts.map +1 -0
- package/internal/util/keccak.js +12 -0
- package/internal/util/keccak.js.map +1 -0
- package/internal/util/scripts-runner.d.ts.map +1 -1
- package/internal/util/scripts-runner.js +7 -4
- package/internal/util/scripts-runner.js.map +1 -1
- package/package.json +15 -15
- package/register.js +1 -3
- package/register.js.map +1 -1
- package/sample-projects/javascript/contracts/Lock.sol +3 -3
- package/sample-projects/typescript/contracts/Lock.sol +3 -3
- package/src/builtin-tasks/clean.ts +9 -6
- package/src/builtin-tasks/compile.ts +96 -128
- package/src/builtin-tasks/flatten.ts +2 -3
- package/src/builtin-tasks/node.ts +2 -2
- package/src/builtin-tasks/test.ts +7 -3
- package/src/builtin-tasks/utils/solidity-files-cache.ts +9 -8
- package/src/internal/artifacts.ts +392 -182
- package/src/internal/cli/cli.ts +43 -17
- package/src/internal/core/config/config-loading.ts +1 -1
- package/src/internal/core/config/config-resolution.ts +12 -24
- package/src/internal/core/config/default-config.ts +1 -1
- package/src/internal/core/errors-list.ts +29 -13
- package/src/internal/core/errors.ts +10 -2
- package/src/internal/core/execution-mode.ts +2 -3
- package/src/internal/core/flamegraph.ts +270 -0
- package/src/internal/core/jsonrpc/types/base-types.ts +7 -3
- package/src/internal/core/params/hardhat-params.ts +18 -0
- package/src/internal/core/providers/accounts.ts +8 -8
- package/src/internal/core/providers/construction.ts +10 -8
- package/src/internal/core/providers/gas-providers.ts +2 -2
- package/src/internal/core/providers/util.ts +1 -1
- package/src/internal/core/runtime-environment.ts +103 -10
- package/src/internal/core/task-profiling.ts +56 -0
- package/src/internal/core/typescript-support.ts +11 -2
- package/src/internal/hardhat-network/jsonrpc/client.ts +1 -1
- package/src/internal/hardhat-network/provider/BlockchainBase.ts +6 -6
- package/src/internal/hardhat-network/provider/BlockchainData.ts +5 -5
- package/src/internal/hardhat-network/provider/HardhatBlockchain.ts +4 -4
- package/src/internal/hardhat-network/provider/PoolState.ts +2 -2
- package/src/internal/hardhat-network/provider/TransactionQueue.ts +2 -2
- package/src/internal/hardhat-network/provider/TxPool.ts +12 -5
- package/src/internal/hardhat-network/provider/ethereumjs-workarounds.ts +3 -3
- package/src/internal/hardhat-network/provider/filter.ts +2 -2
- package/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts +10 -10
- package/src/internal/hardhat-network/provider/fork/ForkStateManager.ts +12 -18
- package/src/internal/hardhat-network/provider/fork/rpcToBlockData.ts +1 -1
- package/src/internal/hardhat-network/provider/fork/rpcToTxData.ts +5 -2
- package/src/internal/hardhat-network/provider/modules/eth.ts +10 -6
- package/src/internal/hardhat-network/provider/modules/hardhat.ts +25 -1
- package/src/internal/hardhat-network/provider/modules/logger.ts +3 -3
- package/src/internal/hardhat-network/provider/modules/net.ts +1 -1
- package/src/internal/hardhat-network/provider/modules/personal.ts +1 -1
- package/src/internal/hardhat-network/provider/modules/web3.ts +4 -6
- package/src/internal/hardhat-network/provider/node-types.ts +6 -6
- package/src/internal/hardhat-network/provider/node.ts +25 -12
- package/src/internal/hardhat-network/provider/output.ts +6 -6
- package/src/internal/hardhat-network/provider/provider.ts +7 -6
- package/src/internal/hardhat-network/provider/return-data.ts +9 -5
- package/src/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.ts +9 -5
- package/src/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.ts +8 -4
- package/src/internal/hardhat-network/provider/transactions/FakeSenderTransaction.ts +4 -4
- package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.ts +8 -5
- package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.ts +4 -4
- package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.ts +3 -3
- package/src/internal/hardhat-network/provider/types/HardhatBlockchainInterface.ts +2 -2
- package/src/internal/hardhat-network/provider/utils/makeAccount.ts +6 -1
- package/src/internal/hardhat-network/provider/utils/makeCommon.ts +1 -1
- package/src/internal/hardhat-network/provider/utils/makeStateTrie.ts +7 -3
- package/src/internal/hardhat-network/provider/utils/putGenesisBlock.ts +6 -6
- package/src/internal/hardhat-network/provider/utils/random.ts +17 -14
- package/src/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/consoleLogger.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/constants.ts +2 -0
- package/src/internal/hardhat-network/stack-traces/contracts-identifier.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/debug.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +3 -3
- package/src/internal/hardhat-network/stack-traces/message-trace.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/model.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/panic-errors.ts +11 -11
- package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/solidity-stack-trace.ts +1 -1
- package/src/internal/hardhat-network/stack-traces/solidityTracer.ts +1 -4
- package/src/internal/hardhat-network/stack-traces/vm-debug-tracer.ts +31 -17
- package/src/internal/hardhat-network/stack-traces/vm-tracer.ts +29 -14
- package/src/internal/lib/hardhat-lib.ts +0 -3
- package/src/internal/solidity/compilation-job.ts +11 -11
- package/src/internal/solidity/compiler/downloader.ts +271 -243
- package/src/internal/solidity/compiler/index.ts +13 -7
- package/src/internal/solidity/dependencyGraph.ts +12 -8
- package/src/internal/solidity/parse.ts +4 -70
- package/src/internal/solidity/resolver.ts +36 -8
- package/src/internal/util/bigint.ts +25 -43
- package/src/internal/util/download.ts +2 -2
- package/src/internal/util/fs-utils.ts +223 -0
- package/src/internal/util/glob.ts +13 -0
- package/src/internal/util/keccak.ts +5 -0
- package/src/internal/util/scripts-runner.ts +13 -4
- package/src/internal/util/wei-values.ts +1 -1
- package/src/internal/{hardhat-network/vendor → vendor}/await-semaphore/index.ts +0 -0
- package/src/profiling.ts +37 -0
- package/src/register.ts +1 -4
- package/src/types/artifacts.ts +21 -0
- package/src/types/config.ts +7 -7
- package/src/types/runtime.ts +2 -0
- package/src/utils/source-names.ts +36 -26
- package/types/artifacts.d.ts +19 -0
- package/types/artifacts.d.ts.map +1 -1
- package/types/config.d.ts +7 -7
- package/types/runtime.d.ts +2 -0
- package/types/runtime.d.ts.map +1 -1
- package/utils/source-names.d.ts.map +1 -1
- package/utils/source-names.js +25 -36
- package/utils/source-names.js.map +1 -1
- package/internal/hardhat-network/provider/fork/random.d.ts +0 -7
- package/internal/hardhat-network/provider/fork/random.d.ts.map +0 -1
- package/internal/hardhat-network/provider/fork/random.js +0 -32
- package/internal/hardhat-network/provider/fork/random.js.map +0 -1
- package/internal/hardhat-network/provider/utils/bnToHex.d.ts +0 -3
- package/internal/hardhat-network/provider/utils/bnToHex.d.ts.map +0 -1
- package/internal/hardhat-network/provider/utils/bnToHex.js +0 -9
- package/internal/hardhat-network/provider/utils/bnToHex.js.map +0 -1
- package/internal/hardhat-network/provider/utils/makeForkCommon.d.ts +0 -4
- package/internal/hardhat-network/provider/utils/makeForkCommon.d.ts.map +0 -1
- package/internal/hardhat-network/provider/utils/makeForkCommon.js +0 -16
- package/internal/hardhat-network/provider/utils/makeForkCommon.js.map +0 -1
- package/internal/hardhat-network/vendor/await-semaphore/index.d.ts +0 -12
- package/internal/hardhat-network/vendor/await-semaphore/index.d.ts.map +0 -1
- package/internal/hardhat-network/vendor/await-semaphore/index.js +0 -64
- package/internal/hardhat-network/vendor/await-semaphore/index.js.map +0 -1
- package/internal/util/antlr-prototype-pollution-workaround.d.ts +0 -16
- package/internal/util/antlr-prototype-pollution-workaround.d.ts.map +0 -1
- package/internal/util/antlr-prototype-pollution-workaround.js +0 -22
- package/internal/util/antlr-prototype-pollution-workaround.js.map +0 -1
- package/src/internal/util/antlr-prototype-pollution-workaround.ts +0 -17
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AccessListEIP2930TxData,
|
|
3
|
+
TxData,
|
|
4
|
+
} from "@nomicfoundation/ethereumjs-tx";
|
|
2
5
|
|
|
3
|
-
import { FeeMarketEIP1559TxData } from "@
|
|
6
|
+
import { FeeMarketEIP1559TxData } from "@nomicfoundation/ethereumjs-tx/dist/types";
|
|
4
7
|
import { RpcTransaction } from "../../../core/jsonrpc/types/output/transaction";
|
|
5
8
|
|
|
6
9
|
export function rpcToTxData(
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { Block } from "@
|
|
2
|
-
import { Common } from "@
|
|
3
|
-
import {
|
|
1
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
3
|
+
import {
|
|
4
|
+
Transaction,
|
|
5
|
+
TransactionFactory,
|
|
6
|
+
TypedTransaction,
|
|
7
|
+
} from "@nomicfoundation/ethereumjs-tx";
|
|
4
8
|
import {
|
|
5
9
|
Address,
|
|
6
10
|
bufferToHex,
|
|
7
11
|
toBuffer,
|
|
8
12
|
toRpcSig,
|
|
9
13
|
zeroAddress,
|
|
10
|
-
} from "@
|
|
14
|
+
} from "@nomicfoundation/ethereumjs-util";
|
|
11
15
|
import * as t from "io-ts";
|
|
12
16
|
import cloneDeep from "lodash/cloneDeep";
|
|
13
17
|
|
|
@@ -81,7 +85,7 @@ import {
|
|
|
81
85
|
|
|
82
86
|
import { assertHardhatNetworkInvariant } from "../utils/assertions";
|
|
83
87
|
import { optional } from "../../../util/io-ts";
|
|
84
|
-
import
|
|
88
|
+
import * as BigIntUtils from "../../../util/bigint";
|
|
85
89
|
import { ModulesLogger } from "./logger";
|
|
86
90
|
|
|
87
91
|
const EIP1559_MIN_HARDFORK = "london";
|
|
@@ -963,7 +967,7 @@ export class EthModule {
|
|
|
963
967
|
// Please keep it updated.
|
|
964
968
|
|
|
965
969
|
if (error instanceof Error) {
|
|
966
|
-
if (error.message === "invalid remainder") {
|
|
970
|
+
if (error.message === "invalid RLP: remainder must be zero") {
|
|
967
971
|
throw new InvalidArgumentsError("Invalid transaction", error);
|
|
968
972
|
}
|
|
969
973
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address } from "@
|
|
1
|
+
import { Address } from "@nomicfoundation/ethereumjs-util";
|
|
2
2
|
import * as t from "io-ts";
|
|
3
3
|
|
|
4
4
|
import {
|
|
@@ -115,6 +115,11 @@ export class HardhatModule {
|
|
|
115
115
|
|
|
116
116
|
case "hardhat_mine":
|
|
117
117
|
return this._hardhatMineAction(...this._hardhatMineParams(params));
|
|
118
|
+
|
|
119
|
+
case "hardhat_setPrevRandao":
|
|
120
|
+
return this._hardhatSetPrevRandaoAction(
|
|
121
|
+
...this._hardhatSetPrevRandaoParams(params)
|
|
122
|
+
);
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
throw new MethodNotFoundError(`Method ${method} not found`);
|
|
@@ -387,6 +392,25 @@ export class HardhatModule {
|
|
|
387
392
|
return validateParams(params, optional(rpcQuantity), optional(rpcQuantity));
|
|
388
393
|
}
|
|
389
394
|
|
|
395
|
+
// hardhat_setPrevRandao
|
|
396
|
+
|
|
397
|
+
private _hardhatSetPrevRandaoParams(params: any[]): [Buffer] {
|
|
398
|
+
// using rpcHash because it's also 32 bytes long
|
|
399
|
+
return validateParams(params, rpcHash);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
private async _hardhatSetPrevRandaoAction(prevRandao: Buffer) {
|
|
403
|
+
if (!this._node.isPostMergeHardfork()) {
|
|
404
|
+
throw new InvalidInputError(
|
|
405
|
+
`hardhat_setPrevRandao is only available in post-merge hardforks, the current hardfork is ${this._node.hardfork}`
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
this._node.setPrevRandao(prevRandao);
|
|
410
|
+
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
|
|
390
414
|
private async _logBlock(
|
|
391
415
|
result: MineBlockResult,
|
|
392
416
|
{ isIntervalMined }: { isIntervalMined: boolean }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Block } from "@
|
|
2
|
-
import { TypedTransaction } from "@
|
|
3
|
-
import { bufferToHex } from "@
|
|
1
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
3
|
+
import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
|
|
4
4
|
import ansiEscapes from "ansi-escapes";
|
|
5
5
|
import chalk, { Chalk } from "chalk";
|
|
6
6
|
import util from "util";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, toRpcSig } from "@
|
|
1
|
+
import { Address, toRpcSig } from "@nomicfoundation/ethereumjs-util";
|
|
2
2
|
|
|
3
3
|
import { rpcAddress, rpcData } from "../../../core/jsonrpc/types/base-types";
|
|
4
4
|
import { validateParams } from "../../../core/jsonrpc/types/input/validation";
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { arrToBufArr, bufArrToArr } from "@ignored/util";
|
|
2
|
-
import { keccak256 } from "ethereum-cryptography/keccak";
|
|
3
|
-
|
|
4
1
|
import {
|
|
5
2
|
bufferToRpcData,
|
|
6
3
|
rpcData,
|
|
7
4
|
} from "../../../core/jsonrpc/types/base-types";
|
|
8
5
|
import { validateParams } from "../../../core/jsonrpc/types/input/validation";
|
|
9
6
|
import { MethodNotFoundError } from "../../../core/providers/errors";
|
|
7
|
+
import { keccak256 } from "../../../util/keccak";
|
|
10
8
|
import { getPackageJson } from "../../../util/packageInfo";
|
|
11
9
|
|
|
12
10
|
/* eslint-disable @nomiclabs/hardhat-internal-rules/only-hardhat-error */
|
|
@@ -35,8 +33,8 @@ export class Web3Module {
|
|
|
35
33
|
|
|
36
34
|
private async _clientVersionAction(): Promise<string> {
|
|
37
35
|
const hardhatPackage = await getPackageJson();
|
|
38
|
-
const ethereumjsVMPackage = require("@
|
|
39
|
-
return `HardhatNetwork/${hardhatPackage.version}/@
|
|
36
|
+
const ethereumjsVMPackage = require("@nomicfoundation/ethereumjs-vm/package.json");
|
|
37
|
+
return `HardhatNetwork/${hardhatPackage.version}/@nomicfoundation/ethereumjs-vm/${ethereumjsVMPackage.version}`;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
// web3_sha3
|
|
@@ -46,6 +44,6 @@ export class Web3Module {
|
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
private async _sha3Action(buffer: Buffer): Promise<string> {
|
|
49
|
-
return bufferToRpcData(
|
|
47
|
+
return bufferToRpcData(keccak256(buffer));
|
|
50
48
|
}
|
|
51
49
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReturnData } from "./return-data";
|
|
2
2
|
|
|
3
|
-
import { Block } from "@
|
|
4
|
-
import { RunBlockResult } from "@
|
|
3
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
4
|
+
import { RunBlockResult } from "@nomicfoundation/ethereumjs-vm";
|
|
5
5
|
|
|
6
6
|
import { HARDHAT_MEMPOOL_SUPPORTED_ORDERS } from "../../constants";
|
|
7
7
|
import { BuildInfo, HardhatNetworkChainsConfig } from "../../../types";
|
|
@@ -18,7 +18,7 @@ export function isForkedNodeConfig(
|
|
|
18
18
|
|
|
19
19
|
interface CommonConfig {
|
|
20
20
|
automine: boolean;
|
|
21
|
-
blockGasLimit:
|
|
21
|
+
blockGasLimit: number;
|
|
22
22
|
chainId: number;
|
|
23
23
|
genesisAccounts: GenesisAccount[];
|
|
24
24
|
hardfork: string;
|
|
@@ -28,7 +28,7 @@ interface CommonConfig {
|
|
|
28
28
|
allowUnlimitedContractSize?: boolean;
|
|
29
29
|
initialDate?: Date;
|
|
30
30
|
tracingConfig?: TracingConfig;
|
|
31
|
-
initialBaseFeePerGas?:
|
|
31
|
+
initialBaseFeePerGas?: number;
|
|
32
32
|
mempoolOrder: MempoolOrder;
|
|
33
33
|
coinbase: string;
|
|
34
34
|
chains: HardhatNetworkChainsConfig;
|
|
@@ -68,7 +68,7 @@ export interface CallParams {
|
|
|
68
68
|
gasLimit: bigint;
|
|
69
69
|
value: bigint;
|
|
70
70
|
data: Buffer;
|
|
71
|
-
// We use this access list format because @
|
|
71
|
+
// We use this access list format because @nomicfoundation/ethereumjs-tx access list data
|
|
72
72
|
// forces us to use it or stringify them
|
|
73
73
|
accessList?: AccessListBufferItem[];
|
|
74
74
|
// Fee params
|
|
@@ -98,7 +98,7 @@ export interface LegacyTransactionParams extends BaseTransactionParams {
|
|
|
98
98
|
|
|
99
99
|
export interface AccessListTransactionParams extends BaseTransactionParams {
|
|
100
100
|
gasPrice: bigint;
|
|
101
|
-
// We use this access list format because @
|
|
101
|
+
// We use this access list format because @nomicfoundation/ethereumjs-tx access list data
|
|
102
102
|
// forces us to use it or stringify them
|
|
103
103
|
accessList: AccessListBufferItem[];
|
|
104
104
|
// We don't include chainId as it's not necessary, the node
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Block, HeaderData } from "@
|
|
2
|
-
import { Common } from "@
|
|
1
|
+
import { Block, HeaderData } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
3
3
|
import {
|
|
4
4
|
AccessListEIP2930Transaction,
|
|
5
5
|
FeeMarketEIP1559Transaction,
|
|
6
6
|
Transaction,
|
|
7
7
|
TypedTransaction,
|
|
8
|
-
} from "@
|
|
8
|
+
} from "@nomicfoundation/ethereumjs-tx";
|
|
9
9
|
import {
|
|
10
10
|
Address,
|
|
11
11
|
ECDSASignature,
|
|
@@ -16,17 +16,26 @@ import {
|
|
|
16
16
|
privateToAddress,
|
|
17
17
|
setLengthLeft,
|
|
18
18
|
toBuffer,
|
|
19
|
-
} from "@
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
} from "@nomicfoundation/ethereumjs-util";
|
|
20
|
+
import {
|
|
21
|
+
Bloom,
|
|
22
|
+
EEI,
|
|
23
|
+
RunBlockResult,
|
|
24
|
+
RunTxResult,
|
|
25
|
+
VM,
|
|
26
|
+
} from "@nomicfoundation/ethereumjs-vm";
|
|
27
|
+
import { EVM, EVMResult } from "@nomicfoundation/ethereumjs-evm";
|
|
28
|
+
import { ERROR } from "@nomicfoundation/ethereumjs-evm/dist/exceptions";
|
|
29
|
+
import {
|
|
30
|
+
DefaultStateManager,
|
|
31
|
+
StateManager,
|
|
32
|
+
} from "@nomicfoundation/ethereumjs-statemanager";
|
|
24
33
|
import { SignTypedDataVersion, signTypedData } from "@metamask/eth-sig-util";
|
|
25
34
|
import chalk from "chalk";
|
|
26
35
|
import debug from "debug";
|
|
27
36
|
import EventEmitter from "events";
|
|
28
37
|
|
|
29
|
-
import
|
|
38
|
+
import * as BigIntUtils from "../../util/bigint";
|
|
30
39
|
import { CompilerInput, CompilerOutput } from "../../../types";
|
|
31
40
|
import { HardforkHistoryConfig } from "../../../types/config";
|
|
32
41
|
import { HARDHAT_NETWORK_SUPPORTED_HARDFORKS } from "../../constants";
|
|
@@ -169,7 +178,7 @@ export class HardhatNode extends EventEmitter {
|
|
|
169
178
|
forkBlockNum = forkBlockNumber;
|
|
170
179
|
|
|
171
180
|
this._validateHardforks(
|
|
172
|
-
|
|
181
|
+
config.forkConfig.blockNumber,
|
|
173
182
|
common,
|
|
174
183
|
forkNetworkId
|
|
175
184
|
);
|
|
@@ -288,7 +297,7 @@ export class HardhatNode extends EventEmitter {
|
|
|
288
297
|
}
|
|
289
298
|
|
|
290
299
|
private static _validateHardforks(
|
|
291
|
-
forkBlockNumber:
|
|
300
|
+
forkBlockNumber: number | undefined,
|
|
292
301
|
common: Common,
|
|
293
302
|
remoteChainId: number
|
|
294
303
|
): void {
|
|
@@ -2348,7 +2357,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
2348
2357
|
// know anything about the txs in the current block
|
|
2349
2358
|
}
|
|
2350
2359
|
|
|
2351
|
-
// NOTE: This is a workaround of both an @
|
|
2360
|
+
// NOTE: This is a workaround of both an @nomicfoundation/ethereumjs-vm limitation, and
|
|
2352
2361
|
// a bug in Hardhat Network.
|
|
2353
2362
|
//
|
|
2354
2363
|
// See: https://github.com/nomiclabs/hardhat/issues/1666
|
|
@@ -2512,6 +2521,10 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
2512
2521
|
return hardforkGte(this.hardfork, HardforkName.MERGE);
|
|
2513
2522
|
}
|
|
2514
2523
|
|
|
2524
|
+
public setPrevRandao(prevRandao: Buffer): void {
|
|
2525
|
+
this._mixHashGenerator.setNext(prevRandao);
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2515
2528
|
private _getNextMixHash(): Buffer {
|
|
2516
2529
|
return this._mixHashGenerator.next();
|
|
2517
2530
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Block } from "@
|
|
2
|
-
import { Common } from "@
|
|
3
|
-
import { TypedTransaction } from "@
|
|
4
|
-
import { bufferToHex } from "@
|
|
5
|
-
import { RunBlockResult } from "@
|
|
1
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
3
|
+
import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
|
|
4
|
+
import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
|
|
5
|
+
import { RunBlockResult } from "@nomicfoundation/ethereumjs-vm";
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import * as BigIntUtils from "../../util/bigint";
|
|
8
8
|
import { assertHardhatInvariant } from "../../core/errors";
|
|
9
9
|
import {
|
|
10
10
|
bufferToRpcData,
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
RequestArguments,
|
|
8
8
|
} from "../../../types";
|
|
9
9
|
|
|
10
|
-
import { Common } from "@
|
|
10
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
11
11
|
import chalk from "chalk";
|
|
12
12
|
import debug from "debug";
|
|
13
13
|
import { EventEmitter } from "events";
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
MethodNotSupportedError,
|
|
25
25
|
ProviderError,
|
|
26
26
|
} from "../../core/providers/errors";
|
|
27
|
-
import {
|
|
28
|
-
import { Mutex } from "../vendor/await-semaphore";
|
|
27
|
+
import { Mutex } from "../../vendor/await-semaphore";
|
|
29
28
|
|
|
29
|
+
import { FIRST_SOLC_VERSION_SUPPORTED } from "../stack-traces/constants";
|
|
30
30
|
import { MiningTimer } from "./MiningTimer";
|
|
31
31
|
import { DebugModule } from "./modules/debug";
|
|
32
32
|
import { EthModule } from "./modules/eth";
|
|
@@ -62,7 +62,6 @@ export class HardhatNetworkProvider
|
|
|
62
62
|
extends EventEmitter
|
|
63
63
|
implements EIP1193Provider
|
|
64
64
|
{
|
|
65
|
-
private _common?: Common;
|
|
66
65
|
private _node?: HardhatNode;
|
|
67
66
|
private _ethModule?: EthModule;
|
|
68
67
|
private _netModule?: NetModule;
|
|
@@ -72,14 +71,16 @@ export class HardhatNetworkProvider
|
|
|
72
71
|
private _debugModule?: DebugModule;
|
|
73
72
|
private _personalModule?: PersonalModule;
|
|
74
73
|
private readonly _mutex = new Mutex();
|
|
74
|
+
// this field is not used here but it's used in the tests
|
|
75
|
+
private _common?: Common;
|
|
75
76
|
|
|
76
77
|
constructor(
|
|
77
78
|
private readonly _hardfork: string,
|
|
78
79
|
private readonly _networkName: string,
|
|
79
80
|
private readonly _chainId: number,
|
|
80
81
|
private readonly _networkId: number,
|
|
81
|
-
private readonly _blockGasLimit:
|
|
82
|
-
private readonly _initialBaseFeePerGas:
|
|
82
|
+
private readonly _blockGasLimit: number,
|
|
83
|
+
private readonly _initialBaseFeePerGas: number | undefined,
|
|
83
84
|
private readonly _minGasPrice: bigint,
|
|
84
85
|
private readonly _throwOnTransactionFailures: boolean,
|
|
85
86
|
private readonly _throwOnCallFailures: boolean,
|
|
@@ -49,19 +49,23 @@ export class ReturnData {
|
|
|
49
49
|
"Expected return data to be a Error(string)"
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
const
|
|
53
|
-
|
|
52
|
+
const [decodedError] = rawDecode(["string"], this.value.slice(4)) as [
|
|
53
|
+
string
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
return decodedError;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
public decodePanic():
|
|
59
|
+
public decodePanic(): bigint {
|
|
57
60
|
assertHardhatInvariant(
|
|
58
61
|
this._selector === PANIC_SELECTOR,
|
|
59
62
|
"Expected return data to be a Panic(uint256)"
|
|
60
63
|
);
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
// we are assuming that panic codes are smaller than Number.MAX_SAFE_INTEGER
|
|
66
|
+
const errorCode = BigInt(`0x${this.value.slice(4).toString("hex")}`);
|
|
63
67
|
|
|
64
|
-
return errorCode
|
|
68
|
+
return errorCode;
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
public getSelector(): string | undefined {
|
package/src/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { Common } from "@
|
|
2
|
-
import * as rlp from "@
|
|
3
|
-
import { AccessListEIP2930Transaction } from "@
|
|
1
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
2
|
+
import * as rlp from "@nomicfoundation/ethereumjs-rlp";
|
|
3
|
+
import { AccessListEIP2930Transaction } from "@nomicfoundation/ethereumjs-tx";
|
|
4
4
|
import {
|
|
5
5
|
AccessListEIP2930TxData,
|
|
6
6
|
AccessListEIP2930ValuesArray,
|
|
7
7
|
TxOptions,
|
|
8
|
-
} from "@
|
|
9
|
-
import {
|
|
8
|
+
} from "@nomicfoundation/ethereumjs-tx/dist/types";
|
|
9
|
+
import {
|
|
10
|
+
Address,
|
|
11
|
+
arrToBufArr,
|
|
12
|
+
bufferToInt,
|
|
13
|
+
} from "@nomicfoundation/ethereumjs-util";
|
|
10
14
|
|
|
11
15
|
import {
|
|
12
16
|
InternalError,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import * as rlp from "@
|
|
2
|
-
import { FeeMarketEIP1559Transaction } from "@
|
|
1
|
+
import * as rlp from "@nomicfoundation/ethereumjs-rlp";
|
|
2
|
+
import { FeeMarketEIP1559Transaction } from "@nomicfoundation/ethereumjs-tx";
|
|
3
3
|
import {
|
|
4
4
|
FeeMarketEIP1559TxData,
|
|
5
5
|
FeeMarketEIP1559ValuesArray,
|
|
6
6
|
TxOptions,
|
|
7
|
-
} from "@
|
|
8
|
-
import {
|
|
7
|
+
} from "@nomicfoundation/ethereumjs-tx/dist/types";
|
|
8
|
+
import {
|
|
9
|
+
Address,
|
|
10
|
+
arrToBufArr,
|
|
11
|
+
bufferToInt,
|
|
12
|
+
} from "@nomicfoundation/ethereumjs-util";
|
|
9
13
|
|
|
10
14
|
import {
|
|
11
15
|
InternalError,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Common } from "@
|
|
2
|
-
import * as rlp from "@
|
|
3
|
-
import { Transaction, TxData, TxOptions } from "@
|
|
4
|
-
import { Address, arrToBufArr } from "@
|
|
1
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
2
|
+
import * as rlp from "@nomicfoundation/ethereumjs-rlp";
|
|
3
|
+
import { Transaction, TxData, TxOptions } from "@nomicfoundation/ethereumjs-tx";
|
|
4
|
+
import { Address, arrToBufArr } from "@nomicfoundation/ethereumjs-util";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
InternalError,
|
package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { Common } from "@
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
2
|
+
import {
|
|
3
|
+
FeeMarketEIP1559Transaction,
|
|
4
|
+
TxOptions,
|
|
5
|
+
} from "@nomicfoundation/ethereumjs-tx";
|
|
6
|
+
import { Address } from "@nomicfoundation/ethereumjs-util";
|
|
4
7
|
|
|
5
8
|
import {
|
|
6
9
|
FeeMarketEIP1559TxData,
|
|
7
10
|
FeeMarketEIP1559ValuesArray,
|
|
8
|
-
} from "@
|
|
11
|
+
} from "@nomicfoundation/ethereumjs-tx/src/types";
|
|
9
12
|
import { InternalError } from "../../../core/providers/errors";
|
|
10
|
-
import
|
|
13
|
+
import * as BigIntUtils from "../../../util/bigint";
|
|
11
14
|
|
|
12
15
|
/* eslint-disable @nomiclabs/hardhat-internal-rules/only-hardhat-error */
|
|
13
16
|
|
package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Common } from "@
|
|
1
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
2
2
|
import {
|
|
3
3
|
AccessListEIP2930Transaction,
|
|
4
4
|
AccessListEIP2930TxData,
|
|
5
5
|
AccessListEIP2930ValuesArray,
|
|
6
6
|
TxOptions,
|
|
7
|
-
} from "@
|
|
8
|
-
import { Address } from "@
|
|
7
|
+
} from "@nomicfoundation/ethereumjs-tx";
|
|
8
|
+
import { Address } from "@nomicfoundation/ethereumjs-util";
|
|
9
9
|
|
|
10
10
|
import { InternalError } from "../../../core/providers/errors";
|
|
11
|
-
import
|
|
11
|
+
import * as BigIntUtils from "../../../util/bigint";
|
|
12
12
|
|
|
13
13
|
/* eslint-disable @nomiclabs/hardhat-internal-rules/only-hardhat-error */
|
|
14
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Common } from "@
|
|
2
|
-
import { Transaction, TxData, TxOptions } from "@
|
|
3
|
-
import { Address } from "@
|
|
1
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
2
|
+
import { Transaction, TxData, TxOptions } from "@nomicfoundation/ethereumjs-tx";
|
|
3
|
+
import { Address } from "@nomicfoundation/ethereumjs-util";
|
|
4
4
|
|
|
5
5
|
import { InternalError } from "../../../core/providers/errors";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Block } from "@
|
|
2
|
-
import { BlockchainInterface } from "@
|
|
1
|
+
import { Block } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { BlockchainInterface } from "@nomicfoundation/ethereumjs-blockchain";
|
|
3
3
|
|
|
4
4
|
import { FilterParams } from "../node-types";
|
|
5
5
|
import { RpcLogOutput, RpcReceiptOutput } from "../output";
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Trie } from "@nomicfoundation/ethereumjs-trie";
|
|
2
|
+
import {
|
|
3
|
+
Account,
|
|
4
|
+
intToBuffer,
|
|
5
|
+
setLengthLeft,
|
|
6
|
+
} from "@nomicfoundation/ethereumjs-util";
|
|
3
7
|
|
|
4
8
|
import { GenesisAccount } from "../node-types";
|
|
5
9
|
|
|
6
10
|
import { makeAccount } from "./makeAccount";
|
|
7
11
|
|
|
8
12
|
export async function makeStateTrie(genesisAccounts: GenesisAccount[]) {
|
|
9
|
-
const stateTrie = new Trie();
|
|
13
|
+
const stateTrie = new Trie({ useKeyHashing: true });
|
|
10
14
|
|
|
11
15
|
for (const acc of genesisAccounts) {
|
|
12
16
|
const { address, account } = makeAccount(acc);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Block, HeaderData } from "@
|
|
2
|
-
import { Common } from "@
|
|
3
|
-
import {
|
|
4
|
-
import { bufferToHex } from "@
|
|
1
|
+
import { Block, HeaderData } from "@nomicfoundation/ethereumjs-block";
|
|
2
|
+
import { Common } from "@nomicfoundation/ethereumjs-common";
|
|
3
|
+
import { Trie } from "@nomicfoundation/ethereumjs-trie";
|
|
4
|
+
import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
|
|
5
5
|
|
|
6
6
|
import { dateToTimestampSeconds } from "../../../util/date";
|
|
7
7
|
import { hardforkGte, HardforkName } from "../../../util/hardforks";
|
|
@@ -13,7 +13,7 @@ export async function putGenesisBlock(
|
|
|
13
13
|
blockchain: HardhatBlockchain,
|
|
14
14
|
common: Common,
|
|
15
15
|
{ initialDate, blockGasLimit }: LocalNodeConfig,
|
|
16
|
-
stateTrie:
|
|
16
|
+
stateTrie: Trie,
|
|
17
17
|
hardfork: HardforkName,
|
|
18
18
|
initialMixHash: Buffer,
|
|
19
19
|
initialBaseFee?: bigint
|
|
@@ -31,7 +31,7 @@ export async function putGenesisBlock(
|
|
|
31
31
|
difficulty: isPostMerge ? 0 : 1,
|
|
32
32
|
nonce: isPostMerge ? "0x0000000000000000" : "0x0000000000000042",
|
|
33
33
|
extraData: "0x1234",
|
|
34
|
-
stateRoot: bufferToHex(stateTrie.root),
|
|
34
|
+
stateRoot: bufferToHex(stateTrie.root()),
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
if (isPostMerge) {
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import type EthereumjsUtilT from "@
|
|
2
|
-
import type
|
|
1
|
+
import type EthereumjsUtilT from "@nomicfoundation/ethereumjs-util";
|
|
2
|
+
import type * as UtilKeccakT from "../../../util/keccak";
|
|
3
3
|
|
|
4
4
|
export class RandomBufferGenerator {
|
|
5
|
-
private constructor(private _nextValue:
|
|
5
|
+
private constructor(private _nextValue: Buffer) {}
|
|
6
6
|
|
|
7
7
|
public static create(seed: string): RandomBufferGenerator {
|
|
8
|
-
const {
|
|
9
|
-
const { keccak256 } =
|
|
10
|
-
require("ethereum-cryptography/keccak") as typeof EthereumCryptographyKeccakT;
|
|
8
|
+
const { keccak256 } = require("../../../util/keccak") as typeof UtilKeccakT;
|
|
11
9
|
|
|
12
|
-
const nextValue = keccak256(
|
|
10
|
+
const nextValue = keccak256(Buffer.from(seed));
|
|
13
11
|
|
|
14
12
|
return new RandomBufferGenerator(nextValue);
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
public next(): Buffer {
|
|
18
|
-
const {
|
|
19
|
-
const { keccak256 } =
|
|
20
|
-
require("ethereum-cryptography/keccak") as typeof EthereumCryptographyKeccakT;
|
|
16
|
+
const { keccak256 } = require("../../../util/keccak") as typeof UtilKeccakT;
|
|
21
17
|
|
|
22
18
|
const valueToReturn = this._nextValue;
|
|
23
19
|
|
|
24
20
|
this._nextValue = keccak256(this._nextValue);
|
|
25
21
|
|
|
26
|
-
return
|
|
22
|
+
return valueToReturn;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public setNext(nextValue: Buffer) {
|
|
26
|
+
this._nextValue = Buffer.from(nextValue);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
public clone(): RandomBufferGenerator {
|
|
@@ -32,7 +32,8 @@ export class RandomBufferGenerator {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export const randomHash = () => {
|
|
35
|
-
const { bufferToHex } =
|
|
35
|
+
const { bufferToHex } =
|
|
36
|
+
require("@nomicfoundation/ethereumjs-util") as typeof EthereumjsUtilT;
|
|
36
37
|
return bufferToHex(randomHashBuffer());
|
|
37
38
|
};
|
|
38
39
|
|
|
@@ -42,12 +43,14 @@ export const randomHashBuffer = (): Buffer => {
|
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
export const randomAddress = () => {
|
|
45
|
-
const { Address } =
|
|
46
|
+
const { Address } =
|
|
47
|
+
require("@nomicfoundation/ethereumjs-util") as typeof EthereumjsUtilT;
|
|
46
48
|
return new Address(randomAddressBuffer());
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
export const randomAddressString = () => {
|
|
50
|
-
const { bufferToHex } =
|
|
52
|
+
const { bufferToHex } =
|
|
53
|
+
require("@nomicfoundation/ethereumjs-util") as typeof EthereumjsUtilT;
|
|
51
54
|
return bufferToHex(randomAddressBuffer());
|
|
52
55
|
};
|
|
53
56
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InternalError } from "../../../core/providers/errors";
|
|
2
|
-
import
|
|
2
|
+
import * as BigIntUtils from "../../../util/bigint";
|
|
3
3
|
import { SenderTransactions, SerializedTransaction } from "../PoolState";
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @nomiclabs/hardhat-internal-rules/only-hardhat-error */
|