pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol"; // import "./MyCoin.sol"; contract MyCoin { function transfer(address _to,uint256 _value) public returns (bool) ; function totalSupply() public view returns (uint256) ; } contract MyToken is ERC721Token { MyCoin myCoin; address _owner; uint256 tokenId=0; event LotteryFinished(address indexed from,uint _tokenId); constructor() ERC721Token("MyToken", "MTC") public { myCoin = MyCoin(0x1A31b9b9D281D49001fE7F3f638000a739Afc9C3); _owner=msg.sender; } function getOwner() public view returns(address){ return _owner; } function totalSupply() public view returns(uint256){ // this code don't report error return myCoin.totalSupply(); } function doLottery(uint256 _value) public{ // this code report error require(myCoin.transfer(_owner,_value)); tokenId=tokenId+1; _mint(msg.sender,tokenId); emit LotteryFinished(msg.sender,tokenId); } }