How to bring already deployed token into zeppelin-solidity Crowdsale.sol contructor? The owner is the same. What should I use instead of the "Mintable _token" below?

function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet, MintableToken _token) public {
  require(_startTime >= now);
  require(_endTime >= _startTime);
  require(_rate > 0);
  require(_wallet != address(0));
  require(_token != address(0));

  startTime = _startTime;
  endTime = _endTime;
  rate = _rate;
  wallet = _wallet;
  token = _token;

Assuming the token you created is of type MintableToken, then all you have to do is supply the address of the token contract to the contstructor as the _token parameter. You'll also have to set the owner of the token to be the crowdsale contract, since it needs to have permissions to mint tokens.

If the token contract you created isn't of type MintableToken, then it wont work because it wont have the necessary functions.

  • If it's not mintabke, can I just transfer token to the contract address manually? – askingtoomuch Feb 19 '18 at 11:39

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.