Trying to deal with Ethereum contracts using OpenZeppelin examples and Remix. There is a token contract deployed in the test network:
pragma solidity ^0.5.0;
import "./ERC20.sol";
import "./ERC20Detailed.sol";
import "./Ownable.sol";
contract TestToken is Ownable, ERC20, ERC20Detailed {
/**
* @dev Constructor that gives _msgSender() all of existing tokens.
*/
constructor () public ERC20Detailed("TestToken", "TST", 18) {
_mint(_msgSender(), 100000 * (10 ** uint256(decimals())));
}
}
I don’t understand how to make crowdsale contract take TestToken tokens:
pragma solidity ^0.5.0;
import "./Crowdsale.sol";
contract MyCrowdsale is Crowdsale {
constructor (
uint256 rate,
address payable wallet,
IERC20 token
)
public
Crowdsale(1000000000, wallet, token)
{
}
}
if I substitute the address of the contract instead of token, for example Crowdsale (1000000000, wallet, 0x7D01c89107B0d682D06cbC635C320EE531146E6A)
, I get an error.
I will be grateful for an example.