Closed MohamedLEGH closed 5 years ago
My bad, I forgot to add ERC20 import and call the mint function. This is the good code :
pragma solidity ^0.5.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
contract MAINToken is ERC20, ERC20Detailed {
string name_token = "MyToken";
string symbol_token = "MAIN";
uint8 decimal_number = 18;
uint256 total_amount = 2000 * (10 ** uint256(decimal_number));
constructor() ERC20Detailed(name_token, symbol_token, decimal_number) public {
_mint(msg.sender, total_amount);
}
}
With this code I get a bytecode and I can publish it on the blockchain.
This is my code :
When I run
etherlime compile
, the contract is compiled without error but the bytescode is "0x". Same with flatten file.Any idea how to solve this?