NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.28k stars 1.41k forks source link

Solidity stack traces no working #5515

Open xiaocaibird opened 3 months ago

xiaocaibird commented 3 months ago

Version of Hardhat

2.22.6

What happened?

Solidity stack traces no working in localhost-network

Minimal reproduction steps

solidity version: 0.8.24

contract:

pragma solidity ^0.8.24;

import 'hardhat/console.sol';

contract TestToken {
    constructor() {}

    function method1(uint32 a, uint32 b) private pure returns (uint32) {
        return method2(a, b);
    }

    function method2(uint32 a, uint32 b) private pure returns (uint32) {
        require(a + b < 100, '====error!!!!====');
        return a + b;
    }

    function add(uint32 a, uint32 b) public payable returns (uint32) {
        console.log('====exec add!!!====');
        return method1(a, b);
    }
}

when i run: npx hardhat my-task --network hardhat

Terminal display: image

when i run: npx hardhat my-task --network localhost

Terminal display: image image

Search terms

No response