OpenZeppelin / openzeppelin-contracts

OpenZeppelin Contracts is a library for secure smart contract development.
https://openzeppelin.com/contracts
MIT License
24.94k stars 11.8k forks source link

Crowdsale contract throws error when deployed to etherscan #1150

Closed madan-ideas2it closed 6 years ago

madan-ideas2it commented 6 years ago

The Plain Crowdsale.sol contract code is not getting deployed to etherscan.

I took the basic Crowdsale under contracts/Crowdsale.sol, used a python tool solidity_flattener to get the single aggregated solidity file with all the imports. (file attached). Now i copy pasted the code in remix, got the bytecode and tried to deploy it via MyEtherWallet but the transaction got failed in etherscan ropsten

If this basic contract fails, then i cannot build and deploy a contract on top of this CrowdsaleAggregated.txt

nventuro commented 6 years ago

Hi @madan-ideas2it! Are you sure you provided all required parameters to the crowdsale? The barebones Crowdsale contract has a constructor with three parameters, and the following requires, make sure the values are valid or you'll get a revert (like that transaction shows):

constructor(uint256 _rate, address _wallet, ERC20 _token) public {
    require(_rate > 0);
    require(_wallet != address(0));
    require(_token != address(0));
    ...
}