Commit 5ec4fbeb by Manuel Aráoz Committed by GitHub

Merge pull request #26 from currymj/minor-fixes

Minor fixes
parents 570d6cb9 a9d030ac
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;
......
pragma solidity ^0.4.0;
contract ERC20 {
function totalSupply() constant returns (uint);
function balanceOf(address who) constant returns (uint);
......
pragma solidity ^0.4.0;
import "./Ownable.sol";
/*
......
pragma solidity ^0.4.0;
contract LimitFunds {
uint LIMIT = 5000;
......
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() {
......
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 {
......
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
......
pragma solidity ^0.4.0;
/*
* Rejector
* Base contract for rejecting direct deposits.
......
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;
......
pragma solidity ^0.4.0;
// Source: https://github.com/nexusdev/erc20
// Flat file implementation of `dappsys/token/base.sol::DSTokenBase`
......
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() {
......
pragma solidity ^0.4.0;
// UNSAFE CODE, DO NOT USE!
contract BadFailEarly {
......
pragma solidity ^0.4.0;
// UNSAFE CODE, DO NOT USE!
contract BadPushPayments {
......
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;
......
pragma solidity ^0.4.0;
contract GoodFailEarly {
uint constant DEFAULT_SALARY = 50000;
......
pragma solidity ^0.4.0;
contract GoodPullPayments {
address highestBidder;
uint highestBid;
......
pragma solidity ^0.4.0;
import "../Rejector.sol";
/*
......
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;
......
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);
......
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;
......
pragma solidity ^0.4.0;
import '../PullPayment.sol';
// mock class using PullPayment
......
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)
......
pragma solidity ^0.4.0;
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/Ownable.sol";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment