Closed Dycedlp closed 5 years ago
Hey there @Dycedlp! The snippet you posted seems to be correct, could you share your full contract and the complete error message? Thanks!
Ok @nventuro when I try to publish this coin.sol it says "This contract does not implement all functions and thus cannot be created." I have ERC20mintable.sol, Roles.sol, IERC20.sol, ERC20Burnable.sol, ERC20.sol, ERC20Capped.sol, MinterRole.sol, Safemath.sol and then finally the coin.sol in my Remix IDE directory... I was under the impression you had to just deploy the coin for it to function. Is there any chance you have a working example of a burnable + mintable/capped erc20 token? Or know how I can fix this contract to work/deploy? I'm using the newest commit of the 0.4.24 compiler as well, everything compiles perfect.
Hmm, that error message should show you which functions it is that you're not implementig. Are you sure the contract you're deploying is the one you made, and now one of the OpenZeppelin ones (e.g. IERC20
)?
Something like this ought to work for what you intend:
pragma solidity ^0.4.24;
import "openzeppelin-solidity/token/ERC20/ERC20Capped.sol";
import "openzeppelin-solidity/token/ERC20/ERC20Burnable.sol";
contract SimpleToken is ERC20Capped, ERC20Burnable {
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals()));
constructor (uint256 cap) public ERC20Capped(cap) {
_mint(msg.sender, INITIAL_SUPPLY);
}
}
Coin.sol:
-- I have all the other inherited contracts in the remix IDE just published the coin.
💻 Environment Remix IDE
📝 Details
Says the contract doesn't implement all functions therefore can't be created.
🔢 Code to reproduce bug
Using the new open zeppelin contracts.