diff --git a/swarm/services/chequebook/contract/chequebook.sol b/swarm/services/chequebook/contract/chequebook.sol index eefe6c0637..e6979c0f0b 100644 --- a/swarm/services/chequebook/contract/chequebook.sol +++ b/swarm/services/chequebook/contract/chequebook.sol @@ -1,4 +1,6 @@ -import "mortal"; +pragma solidity ^0.4.3; + +import "mortal.sol" as mortal; /// @title Chequebook for Ethereum micropayments /// @author Daniel A. Nagy @@ -9,6 +11,14 @@ contract chequebook is mortal { /// @notice Overdraft event event Overdraft(address deadbeat); + /// @notice Deposit event + event Deposit(uint256 amount); + + /// @notice Top up chequebook + function() payable { + Deposit(msg.value); + } + /// @notice Cash cheque /// /// @param beneficiary beneficiary address @@ -39,7 +49,7 @@ contract chequebook is mortal { // owner.sendToDebtorsPrison(); Overdraft(owner); // Compensate beneficiary. - suicide(beneficiary); + selfdestruct(beneficiary); } } }