frangio / hardhat-exposed

Automatically expose internal Solidity functions for smart contract testing.
82 stars 13 forks source link

Support constructor argument in header #27

Closed Amxx closed 1 year ago

Amxx commented 1 year ago

Considerint the following contract

import "./token/ERC20/ERC20.sol";

contract Test is ERC20("name", "symbol") {}

hardhat-expose will produce

contract $Test is Test {
    bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";

    constructor(string memory name_, string memory symbol_) ERC20(name_, symbol_) {}

    /// ...
}

The result of the transpilation calls ERC20's constructor twice:

It looks like Test's implicit constructor is not seen by the plugin.