Help in a Smart Option Contract needed - I am missing something...

Hi everyone,
I am very new to writing smart contracts and scripting in general. I tried to create a contract on Remix and it's giving me this error message: This contract does not implement all functions and thus cannot be created.

What am I missing here? I would really appreciate your help!

This is the contract:

pragma solidity ^0.4.11;

contract owned {
address owner;
function owned() { owner = msg.sender; }
}

contract mortal is owned {
function kill () {
if (msg.sender == owner) selfdestruct(owner);
}
}

contract TestToken is owned, mortal {
mapping (address => uint256) public balanceOf;
function TestToken (uint256 initialSupply) {
balanceOf[msg.sender] = initialSupply;
}
function transfer(address _to, uint256 _value) {
require(balanceOf[msg.sender] >= _value);
require(balanceOf[_to] + _value >= balanceOf[_to]);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
}
}

contract LongCallOption is owned, mortal, TestToken {
address public seller;
address public buyer;
uint public margin;
uint public optionprice;
uint public strikeprice;
TestToken public underlier;
uint public underlieramount;
uint public maturity;
enum State { Created, Purchased, Exercised, Abandoned, Inactive }
State state;

function LongCallOption () payable {
seller = msg.sender;
margin = msg.value;
optionprice = 100;
strikeprice = 1;
underlieramount = 5000; //wie kann man den underlier als testtoken festlegen?
maturity = block.timestamp + 10;
state = State.Created;
}

function cancelsale () {
if (state != State.Created) throw;
if (msg.sender != seller) throw;
state = State.Inactive;
mortal.kill();
}

function purchaseLongCallOption () payable {
if (state != State.Created) throw;
if (msg.value < optionprice) throw;
buyer = msg.sender;
state = State.Purchased;
}

function exercise () payable {
if (state != State.Purchased) throw;
if (msg.sender != buyer) throw;
if (msg.value < underlieramount * strikeprice) throw;
if (block.timestamp > maturity) throw;
state = State.Exercised;
}

function abandon () {
if (state != State.Purchased) throw;
if (msg.sender != buyer) throw;
state = State.Abandoned;
}

function withdraw () {
if (msg.sender == buyer) {
if (state != State.Exercised) throw;
else { underlier.transfer(buyer, underlieramount); }
}
if (msg.sender == seller) {
if (state == State.Exercised)
{ seller.send(this.balance - underlieramount*strikeprice); }
if (state == State.Abandoned)
{ seller.send(this.balance); }
if (state != State.Exercised || state != State.Abandoned) throw;
}

}
}

Sign In or Register to comment.