I 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.
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 = '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;
}
Line 10. Add a semicolon before your comment.
IERC20Token public tokenContract = '0x12740510086c7062d5131BFe7C680c8b5D728c7f'; // the token being sold
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.