Browse Source

Merge pull request #118 from mediachain/master

Add payable modifier to bid functions in examples
Manuel Aráoz 8 years ago
parent
commit
11cf9f8752

+ 1 - 1
contracts/examples/BadPushPayments.sol

@@ -7,7 +7,7 @@ contract BadPushPayments {
 	address highestBidder;
 	uint highestBid;
 
-	function bid() {
+	function bid() payable {
 		if (msg.value < highestBid) throw;
 
 		if (highestBidder != 0) {

+ 1 - 1
contracts/examples/GoodPullPayments.sol

@@ -6,7 +6,7 @@ contract GoodPullPayments {
   uint highestBid;
   mapping(address => uint) refunds;
 
-  function bid() external {
+  function bid() external payable {
     if (msg.value < highestBid) throw;
 
     if (highestBidder != 0) {

+ 1 - 1
contracts/examples/PullPaymentBid.sol

@@ -8,7 +8,7 @@ contract PullPaymentBid is PullPayment {
   address public highestBidder;
   uint public highestBid;
   
-  function bid() external {
+  function bid() external payable {
     if (msg.value <= highestBid) throw;
     
     if (highestBidder != 0) {

+ 1 - 1
contracts/examples/StoppableBid.sol

@@ -9,7 +9,7 @@ contract StoppableBid is Stoppable, PullPayment {
   address public highestBidder;
   uint public highestBid;
 
-  function bid() external stopInEmergency {
+  function bid() external payable stopInEmergency {
     if (msg.value <= highestBid) throw;
     
     if (highestBidder != 0) {