all: update generated code (#15808)
* core/types, core/vm, eth, tests: regenerate gencodec files * Makefile: update devtools target Install protoc-gen-go and print reminders about npm, solc and protoc. Also switch to github.com/kevinburke/go-bindata because it's more maintained. * contracts/ens: update contracts and regenerate with solidity v0.4.19 The newer upstream version of the FIFSRegistrar contract doesn't set the resolver anymore. The resolver is now deployed separately. * contracts/release: regenerate with solidity v0.4.19 * contracts/chequebook: fix fallback and regenerate with solidity v0.4.19 The contract didn't have a fallback function, payments would be rejected when compiled with newer solidity. References to 'mortal' and 'owned' use the local file system so we can compile without network access. * p2p/discv5: regenerate with recent stringer * cmd/faucet: regenerate * dashboard: regenerate * eth/tracers: regenerate * internal/jsre/deps: regenerate * dashboard: avoid sed -i because it's not portable * accounts/usbwallet/internal/trezor: fix go generate warnings
This commit is contained in:
committed by
Péter Szilágyi
parent
a139041d40
commit
5c2f1e0014
@@ -1,6 +1,6 @@
|
||||
pragma solidity ^0.4.18;
|
||||
|
||||
import "https://github.com/ethereum/solidity/std/mortal.sol";
|
||||
import "./mortal.sol";
|
||||
|
||||
/// @title Chequebook for Ethereum micropayments
|
||||
/// @author Daniel A. Nagy <daniel@ethereum.org>
|
||||
@@ -11,6 +11,9 @@ contract chequebook is mortal {
|
||||
/// @notice Overdraft event
|
||||
event Overdraft(address deadbeat);
|
||||
|
||||
// Allow sending ether to the chequebook.
|
||||
function() public payable { }
|
||||
|
||||
/// @notice Cash cheque
|
||||
///
|
||||
/// @param beneficiary beneficiary address
|
||||
@@ -19,8 +22,7 @@ contract chequebook is mortal {
|
||||
/// @param sig_r signature parameter r
|
||||
/// @param sig_s signature parameter s
|
||||
/// The digital signature is calculated on the concatenated triplet of contract address, beneficiary address and cumulative amount
|
||||
function cash(address beneficiary, uint256 amount,
|
||||
uint8 sig_v, bytes32 sig_r, bytes32 sig_s) {
|
||||
function cash(address beneficiary, uint256 amount, uint8 sig_v, bytes32 sig_r, bytes32 sig_s) public {
|
||||
// Check if the cheque is old.
|
||||
// Only cheques that are more recent than the last cashed one are considered.
|
||||
require(amount > sent[beneficiary]);
|
||||
@@ -31,7 +33,7 @@ contract chequebook is mortal {
|
||||
// and the cumulative amount on the last cashed cheque to beneficiary.
|
||||
uint256 diff = amount - sent[beneficiary];
|
||||
if (diff <= this.balance) {
|
||||
// update the cumulative amount before sending
|
||||
// update the cumulative amount before sending
|
||||
sent[beneficiary] = amount;
|
||||
beneficiary.transfer(diff);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user