0

I am getting the following error - Here is a error screenshot


GustavoCoin.sol

pragma solidity ^0.4.22;

import "../node_modules/zeppelin-solidity/contracts/token/ERC20/MintableToken.sol";

contract GustavoCoin  {

    string public name = "GUSTAVO COIN";

    string public symbol = "GUS";

    uint8 public decimals = 18;
  constructor() {
  }
}



GustavoCoinCrowdsale.sol

pragma solidity ^0.4.22;

import './GustavoCoin.sol';

import '../node_modules/zeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol';

import '../node_modules/zeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol';
contract GustavoCoinCrowdsale is TimedCrowdsale, MintedCrowdsale {

    function GustavoCoinCrowdsale

        (

            uint256 _openingTime,

            uint256 _closingTime,

            uint256 _rate,

            address _wallet,

            MintableToken _token

        )

        public

        Crowdsale(_rate, _wallet, _token)

        TimedCrowdsale(_openingTime, _closingTime) {



        }
}


truffle.js

module.exports = {
  networks: {
      development: {
          host: "127.0.0.1", 
          port: 8545, 
          network_id: "*" // Match any network id 
      } 
  }
};


I am follwimg a tutorial from this link.

  • 1
    Please provide the section of code which are relevant to your question - for example the truffle script is missing. Furthermore, your GustavoCoin does not have such function transferOwnership. – Lauri Peltonen Sep 19 '18 at 11:23
  • @LauriPeltonen I have also mentioned link which i'm following! GustavoCoin is a contract name and the given code is related to my question! for more clearance please see the link given there! – Sunanda Sharma Sep 19 '18 at 11:26
1

The gist used by the tutorial you mentioned defines the contract as

pragma solidity 0.4.19;
import 'zeppelin-solidity/contracts/token/ERC20/MintableToken.sol';

contract GustavoCoin is MintableToken {
   ...
}

MintableToken inherits OpenZeppelin's Ownable, and that's where transferOwnership method can be found. Your code above lacks is MintableToken inheritance.

| improve this answer | |
  • Then what we can do to resolve it? @Utgarda – Sunanda Sharma Sep 19 '18 at 12:15
  • Compare the contract definition line in your code with the gist, make your code look like the example. I.e. add is MintableToken after your contract name. – Utgarda Sep 19 '18 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.