I have two contracts. One inherits a function that gets the value to be paid by the second one.
If I remove the 'is Reference'
and replace the values from the external function, the code pays, without problems.
Am I doing something wrong here?
contract Reference {
function getAmount(string) public returns(uint);
}
contract Payment is Reference{
uint Value;
address sender=msg.sender;// for the suicide
function Payment (Reference _address, address _receiver, string _NR) payable {
Value = _address.getAmount(_NR);
if(!_receiver.send(Value)) {//pay
throw;
}
}
//receive remainder of the money allocated to the contract
function kill(){
if (msg.sender == sender)
suicide(sender);
}
}
Thanks for any feedback!
Addition: If I define the values (amount to pay, recipient address)
in the payment contract manually it doesn't get mined - this is as long as it still inherits from the other contract...
The extrnal function works fine...