2

I am trying to modify the OpenZeppelin Crowdsale.sol contract for my own purpose and in the constructor it takes a token.

  function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet, MintableToken _token) public {

What do I need to do there? When I try passing in the name of the token contract that I am attempting to crowdsale I get

creation of Crowdsale errored: Error encoding arguments: SyntaxError: Unexpected token x in JSON at position 46

I am using remix.

I am very confused as I cannot find any examples of how this contract is actually implemented anywhere. Thank you for any help.

3 Answers 3

2

Usually syntax errors involving JSON means you're not entering the contract arguments correctly.

Are you entering the address in double quotes? For example: "0xbbf289d846208c16edc8474705c748aff07732db"

I think this particular example requires you to create a token contract separately and then pass in the address of that token when initializing your crowdsale contract.

0

You just pass the address of the token to it.

1
  • Does this mean I cannot have the Crowdsale contract inheriting from the Token contract (because that would mean calling a new constructor for a Token contract which would create an entirely new Token with a different address?). I appreciate your help. I am new to solidity and the documentation regarding inheritance and constructors is quite dense, and does not seem geared towards ICO contract development. Thanks again. Commented Feb 2, 2018 at 14:23
0

When I try to do that it says " The constructor should be payable if you send value debug the transaction if you get more information" . What does it mean?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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