# Error while deploying smart contract- This contract does not implement all functions and thus cannot be created

I have written and complied a smart contract written in Solidity for token and crowdsale. Compilation was successful with no errors in Remix IDE. Here is my smart contract

``````pragma solidity ^0.4.25;

library SafeMath {

/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}

uint256 c = a * b;
require(c / a == b);
return c;
}

/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {

require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold

return c;
}

/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {

require(b <= a);
uint256 c = a - b;

return c;
}

/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {

uint256 c = a + b;
require(c >= a);

return c;
}

/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {

require(b != 0);
return a % b;
}
}

interface ERC20 {

function balanceOf(address who) external view returns (uint256);
function transferToken(address to, uint256 value) external returns (bool);
// function approve(address spender, uint256 value) external returns (bool);

}

contract Owned {

function transferOwnership(address newOwner) public returns(bool success);

function setOperator(address newoperator) public returns(bool success);

function FreezeICO() public returns(bool success);

function setRate(uint8 newRate) public returns(bool success);

event Freeze_Ico(bool success);

event change_Rate(uint8 newRate);

owner = msg.sender;
operator = newoperator;

}

modifier onlyOwner {

require(msg.sender == owner);

_;

}

modifier onlyOperator {

require(msg.sender == operator);

_;

}
}

contract SafeToken is ERC20,Owned {

using SafeMath for uint;

string public _name = "DOHA";
string public _symbol = "DO";
uint8 public _decimals = 18;
uint256 public _totalSupply;
uint8 public _rate;
uint256 public _icoCompleted;
bool public _freeze;

mapping (address => uint256) public balances;
mapping (address => bool) public whiteList;

constructor(uint256 totalSupply, uint8 rate,  uint duration) public {

_rate=rate;
_totalSupply = totalSupply * 10**uint(_decimals);
_deadline = now + duration * 1 minutes;
balances[msg.sender] = _totalSupply;
_icoCompleted = 0;
_freeze = false;

}

function name()public view returns (string) {
return _name;
}

function symbol()public view returns (string) {
return _symbol;
}

function deadline()public view returns (uint) {
}

function totalSupply()public view returns (uint) {
return _totalSupply;
}

function currentOwner() public view returns (address) {
return owner;
}

function icoStatus() public view returns (uint) {
return _icoCompleted;
}

function freezeStatus() public view returns (bool) {
return _freeze;
}

function white_List(address who) public view returns (bool) {

return whiteList[who];
}

modifier icoFunctioning {

require(_freeze == false);
require(_icoCompleted < _totalSupply);
_;
}

_;
}

require(whiteList[who]==true);
_;
}

function() external payable icoFunctioning deadlineCheck whiteListed(msg.sender){

require(msg.value>0);

uint _tokens;
_tokens = SafeMath.mul(msg.value,_rate);

require(_tokens <= balances[owner]);

balances[owner] = SafeMath.sub(balances[owner],_tokens);

owner.transfer(msg.value);
emit TransferEther(msg.sender,_tokens);

}

function FreezeICO() public onlyOwner returns(bool success) {

_freeze = !_freeze;
emit Freeze_Ico(_freeze);
return _freeze;
}

whiteList[who] =true;
return(true);

}

function balanceOf(address who) external view returns (uint256 balance) {

return balances[who];
}

function transferToken(address _to, uint256 _value) external returns (bool) {

require(_value <= balances[msg.sender]);

balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
emit Transfer(msg.sender, _to, _value);
return true;
}

function setRate(uint8 newRate) public onlyOwner icoFunctioning returns (bool success) {

require(newRate != _rate);

_rate = newRate;
emit change_Rate(_rate);
return true;

}

function transferOwnership(address newOwner) public onlyOwner returns(bool success) {

balances[newOwner] = balances[owner];
balances[owner] = 0;
emit Ownership_Transferred(owner, newOwner);
owner = newOwner;
return true;

}

operator=newoperator;
emit change_Operator(operator);
return true;

}

}
``````

When deploying I got a message like this I don't have much experience in Ethereum. Need help

I found what's wrong here, your `contract Owned {` has a parameterised constructor but you are using it as a default constructor here :

`contract SafeToken is ERC20,Owned {`

while inheriting it's properties.

Hence the error that you are not implementing all the functions!

Solution:

Either you need to remove the parameterised constructor and it's initialization like this:

``````constructor() public { // observe that the parameters are removed

owner = msg.sender;
// operator = newoperator; // comment or remove this line

}
``````

OR

You can add parameter while inheriting like this:

``````contract SafeToken is ERC20, Owned(msg.sender) { // NOTE: You can add any address
``````

Choice is yours. Cheers!