solmd icon indicating copy to clipboard operation
solmd copied to clipboard

Unclear error "Failed to compile"

Open KorbinianK opened this issue 6 years ago • 3 comments

When using a contract inheriting the ERC20Basic abstract contract, I get the error that it fails to compile. Compiling just the ERC20Basic contract works as intended. Any ideas?

Otherwise this tool is very useful mostly works great!

pragma solidity ^0.4.21;
/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

Even if empty, this contract fails to compile according to solmd:

pragma solidity ^0.4.23; 

import "./ERC20Basic.sol";

/**
 * @title ERC20Handler
 */
contract ERC20Handler is ERC20Basic{
 // 
}

KorbinianK avatar Jul 08 '18 18:07 KorbinianK

I managed to fix it:

The ERC20Handler contract was named "erc20handler.sol". After renaming it to mirror the contract name itself "ERC20Handler.sol" the error went away. Guess the compiler at some point expects the file to be identical to the contracts name.

Maybe add a warning or additional information for this? :) I leave the issue open for now, but can probably closed if this is intended.

KorbinianK avatar Jul 08 '18 19:07 KorbinianK

Well... judging by the (absence of) responses to this issue, I can clearly say that this one has been abandoned...

Any idea of an appropriate tool for this purpose, which is also being maintained?

barakman avatar Jun 17 '19 10:06 barakman

Looks abandoned. Switching to solidity-docgen.

alexcambose avatar Apr 12 '21 11:04 alexcambose