From f9b88bac27724f5e4756a75a31f8c3e405ba0c3b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 4 Nov 2017 14:32:18 -0500 Subject: [PATCH] chequebook: require a modern version of solidity --- contracts/chequebook/contract/chequebook.sol | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contracts/chequebook/contract/chequebook.sol b/contracts/chequebook/contract/chequebook.sol index 845ba464b3..538ca48336 100644 --- a/contracts/chequebook/contract/chequebook.sol +++ b/contracts/chequebook/contract/chequebook.sol @@ -1,4 +1,6 @@ -import "mortal"; +pragma solidity ^0.4.18; + +import "https://github.com/ethereum/solidity/std/mortal.sol"; /// @title Chequebook for Ethereum micropayments /// @author Daniel A. Nagy @@ -23,7 +25,7 @@ contract chequebook is mortal { // Only cheques that are more recent than the last cashed one are considered. if(amount <= sent[beneficiary]) return; // Check the digital signature of the cheque. - bytes32 hash = sha3(address(this), beneficiary, amount); + bytes32 hash = keccak256(address(this), beneficiary, amount); if(owner != ecrecover(hash, sig_v, sig_r, sig_s)) return; // Attempt sending the difference between the cumulative amount on the cheque // and the cumulative amount on the last cashed cheque to beneficiary. @@ -40,7 +42,7 @@ contract chequebook is mortal { // owner.sendToDebtorsPrison(); Overdraft(owner); // Compensate beneficiary. - suicide(beneficiary); + selfdestruct(beneficiary); } } }