Browse Source

Merge pull request #26 from currymj/minor-fixes

Minor fixes
Manuel Aráoz 9 years ago
parent
commit
5ec4fbeb45

+ 3 - 2
contracts/Bounty.sol

@@ -1,4 +1,5 @@
-import './PullPaymentCapable.sol';
+pragma solidity ^0.4.0;
+import './PullPayment.sol';
 import './Token.sol';
 
 /*
@@ -7,7 +8,7 @@ import './Token.sol';
  * to be lower than its totalSupply, which would mean that it doesn't 
  * have sufficient ether for everyone to withdraw.
  */
-contract Bounty is PullPaymentCapable {
+contract Bounty is PullPayment {
 
   bool public claimed;
   mapping(address => address) public researchers;

+ 1 - 0
contracts/ERC20.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 contract ERC20 {
     function totalSupply() constant returns (uint);
     function balanceOf(address who) constant returns (uint);

+ 1 - 0
contracts/Killable.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 import "./Ownable.sol";
 
 /*

+ 1 - 0
contracts/LimitFunds.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 contract LimitFunds {
 
   uint LIMIT = 5000;

+ 2 - 1
contracts/Migrations.sol

@@ -1,9 +1,10 @@
+pragma solidity ^0.4.0;
 contract Migrations {
   address public owner;
   uint public last_completed_migration;
 
   modifier restricted() {
-    if (msg.sender == owner) _
+    if (msg.sender == owner) _;
   }
 
   function Migrations() {

+ 2 - 1
contracts/Ownable.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 /*
  * Ownable
  * Base contract with an owner
@@ -11,7 +12,7 @@ contract Ownable {
 
   modifier onlyOwner() { 
     if (msg.sender == owner)
-      _
+      _;
   }
 
   function transfer(address newOwner) onlyOwner {

+ 3 - 2
contracts/PullPayment.sol

@@ -1,9 +1,10 @@
+pragma solidity ^0.4.0;
 /*
- * PullPaymentCapable
+ * PullPayment
  * Base contract supporting async send for pull payments.
  * Inherit from this contract and use asyncSend instead of send.
  */
-contract PullPaymentCapable {
+contract PullPayment {
   mapping(address => uint) public payments;
 
   // store sent amount as credit to be pulled, called by payer

+ 1 - 0
contracts/Rejector.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 /*
  * Rejector
  * Base contract for rejecting direct deposits.

+ 3 - 2
contracts/Stoppable.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 /*
  * Stoppable
  * Abstract contract that allows children to implement an
@@ -7,8 +8,8 @@ contract Stoppable {
   address public curator;
   bool public stopped;
 
-  modifier stopInEmergency { if (!stopped) _ }
-  modifier onlyInEmergency { if (stopped) _ }
+  modifier stopInEmergency { if (!stopped) _; }
+  modifier onlyInEmergency { if (stopped) _; }
 
   function Stoppable(address _curator) {
     if (_curator == 0) throw;

+ 1 - 0
contracts/Token.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 // Source: https://github.com/nexusdev/erc20
 // Flat file implementation of `dappsys/token/base.sol::DSTokenBase`
 

+ 3 - 2
contracts/examples/BadArrayUse.sol

@@ -1,8 +1,9 @@
-import '../PullPaymentCapable.sol';
+pragma solidity ^0.4.0;
+import '../PullPayment.sol';
 
 // UNSAFE CODE, DO NOT USE!
 
-contract BadArrayUse is PullPaymentCapable {
+contract BadArrayUse is PullPayment {
   address[] employees;
 
   function payBonus() {

+ 1 - 0
contracts/examples/BadFailEarly.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 // UNSAFE CODE, DO NOT USE!
 
 contract BadFailEarly {

+ 1 - 0
contracts/examples/BadPushPayments.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 // UNSAFE CODE, DO NOT USE!
 
 contract BadPushPayments {

+ 3 - 2
contracts/examples/GoodArrayUse.sol

@@ -1,6 +1,7 @@
-import '../PullPaymentCapable.sol';
+pragma solidity ^0.4.0;
+import '../PullPayment.sol';
 
-contract GoodArrayUse is PullPaymentCapable {
+contract GoodArrayUse is PullPayment {
   address[] employees;
   mapping(address => uint) bonuses;
 

+ 2 - 0
contracts/examples/GoodFailEarly.sol

@@ -1,3 +1,5 @@
+pragma solidity ^0.4.0;
+
 contract GoodFailEarly {
 
   uint constant DEFAULT_SALARY = 50000;

+ 1 - 0
contracts/examples/GoodPullPayments.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 contract GoodPullPayments {
   address highestBidder;
   uint highestBid;

+ 2 - 0
contracts/examples/ProofOfExistence.sol

@@ -1,3 +1,5 @@
+pragma solidity ^0.4.0;
+
 import "../Rejector.sol";
 
 /*

+ 4 - 2
contracts/examples/PullPaymentBid.sol

@@ -1,6 +1,8 @@
-import '../PullPaymentCapable.sol';
+pragma solidity ^0.4.0;
 
-contract PullPaymentBid is PullPaymentCapable {
+import '../PullPayment.sol';
+
+contract PullPaymentBid is PullPayment {
   address public highestBidder;
   uint public highestBid;
   

+ 5 - 3
contracts/examples/PullPaymentCapableExample.sol → contracts/examples/PullPaymentExample.sol

@@ -1,7 +1,9 @@
-import '../PullPaymentCapable.sol';
+pragma solidity ^0.4.0;
 
-// Example class using PullPaymentCapable
-contract PullPaymentCapableExample is PullPaymentCapable {
+import '../PullPayment.sol';
+
+// Example class using PullPayment
+contract PullPaymentExample is PullPayment {
   // test helper function to call asyncSend
   function callSend(address dest, uint amount) external {
     asyncSend(dest, amount);

+ 5 - 3
contracts/examples/StoppableBid.sol

@@ -1,13 +1,15 @@
-import '../PullPaymentCapable.sol';
+pragma solidity ^0.4.0;
+
+import '../PullPayment.sol';
 import '../Stoppable.sol';
 
-contract StoppableBid is Stoppable, PullPaymentCapable {
+contract StoppableBid is Stoppable, PullPayment {
   address public highestBidder;
   uint public highestBid;
 
   function StoppableBid(address _curator)
     Stoppable(_curator)
-    PullPaymentCapable() {}
+    PullPayment() {}
 
   function bid() external stopInEmergency {
     if (msg.value <= highestBid) throw;

+ 1 - 0
contracts/test-helpers/PullPaymentMock.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 import '../PullPayment.sol';
 
 // mock class using PullPayment

+ 3 - 3
test/PullPayment.js

@@ -1,8 +1,8 @@
-contract('PullPaymentCapable', function(accounts) {
+contract('PullPaymentExample', function(accounts) {
 
   it("can't call asyncSend externally", function(done) {
     var ppc;
-    return PullPaymentCapableExample.new()
+    return PullPaymentExample.new()
       .then(function(ppc) {
         assert.isUndefined(ppc.asyncSend);
       })
@@ -12,7 +12,7 @@ contract('PullPaymentCapable', function(accounts) {
   it("can record an async payment correctly", function(done) {
     var ppce;
     var AMOUNT = 100;
-    return PullPaymentCapableExample.new()
+    return PullPaymentExample.new()
       .then(function(_ppce) {
         ppce = _ppce;
         ppce.callSend(accounts[0], AMOUNT)

+ 1 - 0
test/TestOwnable.sol

@@ -1,3 +1,4 @@
+pragma solidity ^0.4.0;
 import "truffle/Assert.sol";
 import "truffle/DeployedAddresses.sol";
 import "../contracts/Ownable.sol";