Closed a2468834 closed 2 years ago
Just added the ability to specify nameTags
in config available in hardhat-tracer@1.1.0-rc.4
. So the addresses specified in config should be available in the scripts as well as the trace task. Let me know if it works or if any issue.
tracer: {
nameTags: {
'0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266': 'MyContract',
[wethAddress]: 'WrappedEther',
},
},
Awesome!
The functionalities work pretty well in hardhat-tracer@1.1.0-rc.6
.
I also found that if I have compiled the contracts (which are involved in the transaction), the output result would be automatically converted into contract ABI's format.π€©
Hello everyone,
I have already tried the command
npx hardhat test --fulltrace
with setting addressesnameTags
. It works great and highly readable. This tool truly helps me a lot!However, when I tried to run a script with
npx hardhat run
,nameTags
doesn't work. Here are the descriptions of what I tried:(1) I have set up a Hardhat Network with mainnet forking mode. (2) Because I only have Alchemy free account, I cannot use the debug API (e.g.,
debug_traceTransaction
). (3) As a result, I set up a Hardhat Network with forking. Then, I ran another project which is connected to the Hardhat Network and sent transactions to that network. (4) When I tried to usenpx hardhat trace --hash 0x...
command, the addresses cannot display with thenameTags
.For example, the directory structure: (omitted trivial folders/files)
(1) I ran
npx hardhat --network "hardhat" node
command in theπhardhat_network_w_forking
. The default JSON-RPC URL ishttp://127.0.0.1:8545
.(2)
hardhat.config.js
in theπanother_project
:(3)
contract.sol
in theπanother_project
:(4)
script.js
in theπanother_project
:(5) Finally, I ran the following commands in the
πanother_project
.(6) But, if I ran the same script with
npx hardhat test --trace
, I would get:In short,
hre.tracer.nameTags[weth9_address] = "WrappedEther";
doesn't work when running the combination ofnpx hardhat run
andnpx hardhat trace --hash "0x..."
.Could anyone tell me how should I do to solve this problem? Many thanks.