trying test some simple smart contract but don’t know I have error Can anybody tell me where I have a mistake?
I want to test this code but this error stops me.
I’m testing this tutorial: https://programtheblockchain.com/posts/2018/02/02/writing-a-token-sale-contract/
pragma solidity ^0.4.21;
interface IERC20Token {
function balanceOf(address owner) public returns (uint256);
function transfer(address to, uint256 amount) public returns (bool);
function decimals() public returns (uint256);
}
contract TokenSale {
IERC20Token public tokenContract =
IERC20Token(0x12740510086c7062d5131BFe7C680c8b5D728c7f); // the token being sold
uint256 public price = 1000000000000000; // the price, in wei, per token
address owner;
uint256 public tokensSold;
event Sold(address buyer, uint256 amount);
function TokenSale(IERC20Token _tokenContract, uint256 _price) public {
owner = msg.sender;
tokenContract = _tokenContract;
price = _price;
}