Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
5ec4fbeb
Commit
5ec4fbeb
authored
Oct 12, 2016
by
Manuel Aráoz
Committed by
GitHub
Oct 12, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26 from currymj/minor-fixes
Minor fixes
parents
570d6cb9
a9d030ac
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
50 additions
and
23 deletions
+50
-23
Bounty.sol
contracts/Bounty.sol
+3
-2
ERC20.sol
contracts/ERC20.sol
+1
-0
Killable.sol
contracts/Killable.sol
+1
-0
LimitFunds.sol
contracts/LimitFunds.sol
+1
-0
Migrations.sol
contracts/Migrations.sol
+2
-1
Ownable.sol
contracts/Ownable.sol
+2
-1
PullPayment.sol
contracts/PullPayment.sol
+3
-2
Rejector.sol
contracts/Rejector.sol
+1
-0
Stoppable.sol
contracts/Stoppable.sol
+3
-2
Token.sol
contracts/Token.sol
+1
-0
BadArrayUse.sol
contracts/examples/BadArrayUse.sol
+3
-2
BadFailEarly.sol
contracts/examples/BadFailEarly.sol
+1
-0
BadPushPayments.sol
contracts/examples/BadPushPayments.sol
+1
-0
GoodArrayUse.sol
contracts/examples/GoodArrayUse.sol
+3
-2
GoodFailEarly.sol
contracts/examples/GoodFailEarly.sol
+2
-0
GoodPullPayments.sol
contracts/examples/GoodPullPayments.sol
+1
-0
ProofOfExistence.sol
contracts/examples/ProofOfExistence.sol
+2
-0
PullPaymentBid.sol
contracts/examples/PullPaymentBid.sol
+4
-2
PullPaymentExample.sol
contracts/examples/PullPaymentExample.sol
+5
-3
StoppableBid.sol
contracts/examples/StoppableBid.sol
+5
-3
PullPaymentMock.sol
contracts/test-helpers/PullPaymentMock.sol
+1
-0
PullPayment.js
test/PullPayment.js
+3
-3
TestOwnable.sol
test/TestOwnable.sol
+1
-0
No files found.
contracts/Bounty.sol
View file @
5ec4fbeb
import './PullPaymentCapable.sol';
pragma solidity ^0.4.0;
import './PullPayment.sol';
import './Token.sol';
import './Token.sol';
/*
/*
...
@@ -7,7 +8,7 @@ import './Token.sol';
...
@@ -7,7 +8,7 @@ import './Token.sol';
* to be lower than its totalSupply, which would mean that it doesn't
* to be lower than its totalSupply, which would mean that it doesn't
* have sufficient ether for everyone to withdraw.
* have sufficient ether for everyone to withdraw.
*/
*/
contract Bounty is PullPayment
Capable
{
contract Bounty is PullPayment {
bool public claimed;
bool public claimed;
mapping(address => address) public researchers;
mapping(address => address) public researchers;
...
...
contracts/ERC20.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
contract ERC20 {
contract ERC20 {
function totalSupply() constant returns (uint);
function totalSupply() constant returns (uint);
function balanceOf(address who) constant returns (uint);
function balanceOf(address who) constant returns (uint);
...
...
contracts/Killable.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
import "./Ownable.sol";
import "./Ownable.sol";
/*
/*
...
...
contracts/LimitFunds.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
contract LimitFunds {
contract LimitFunds {
uint LIMIT = 5000;
uint LIMIT = 5000;
...
...
contracts/Migrations.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
contract Migrations {
contract Migrations {
address public owner;
address public owner;
uint public last_completed_migration;
uint public last_completed_migration;
modifier restricted() {
modifier restricted() {
if (msg.sender == owner) _
if (msg.sender == owner) _
;
}
}
function Migrations() {
function Migrations() {
...
...
contracts/Ownable.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
/*
/*
* Ownable
* Ownable
* Base contract with an owner
* Base contract with an owner
...
@@ -11,7 +12,7 @@ contract Ownable {
...
@@ -11,7 +12,7 @@ contract Ownable {
modifier onlyOwner() {
modifier onlyOwner() {
if (msg.sender == owner)
if (msg.sender == owner)
_
_
;
}
}
function transfer(address newOwner) onlyOwner {
function transfer(address newOwner) onlyOwner {
...
...
contracts/PullPayment.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
/*
/*
* PullPayment
Capable
* PullPayment
* Base contract supporting async send for pull payments.
* Base contract supporting async send for pull payments.
* Inherit from this contract and use asyncSend instead of send.
* Inherit from this contract and use asyncSend instead of send.
*/
*/
contract PullPayment
Capable
{
contract PullPayment {
mapping(address => uint) public payments;
mapping(address => uint) public payments;
// store sent amount as credit to be pulled, called by payer
// store sent amount as credit to be pulled, called by payer
...
...
contracts/Rejector.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
/*
/*
* Rejector
* Rejector
* Base contract for rejecting direct deposits.
* Base contract for rejecting direct deposits.
...
...
contracts/Stoppable.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
/*
/*
* Stoppable
* Stoppable
* Abstract contract that allows children to implement an
* Abstract contract that allows children to implement an
...
@@ -7,8 +8,8 @@ contract Stoppable {
...
@@ -7,8 +8,8 @@ contract Stoppable {
address public curator;
address public curator;
bool public stopped;
bool public stopped;
modifier stopInEmergency { if (!stopped) _ }
modifier stopInEmergency { if (!stopped) _
;
}
modifier onlyInEmergency { if (stopped) _ }
modifier onlyInEmergency { if (stopped) _
;
}
function Stoppable(address _curator) {
function Stoppable(address _curator) {
if (_curator == 0) throw;
if (_curator == 0) throw;
...
...
contracts/Token.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
// Source: https://github.com/nexusdev/erc20
// Source: https://github.com/nexusdev/erc20
// Flat file implementation of `dappsys/token/base.sol::DSTokenBase`
// Flat file implementation of `dappsys/token/base.sol::DSTokenBase`
...
...
contracts/examples/BadArrayUse.sol
View file @
5ec4fbeb
import '../PullPaymentCapable.sol';
pragma solidity ^0.4.0;
import '../PullPayment.sol';
// UNSAFE CODE, DO NOT USE!
// UNSAFE CODE, DO NOT USE!
contract BadArrayUse is PullPayment
Capable
{
contract BadArrayUse is PullPayment {
address[] employees;
address[] employees;
function payBonus() {
function payBonus() {
...
...
contracts/examples/BadFailEarly.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
// UNSAFE CODE, DO NOT USE!
// UNSAFE CODE, DO NOT USE!
contract BadFailEarly {
contract BadFailEarly {
...
...
contracts/examples/BadPushPayments.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
// UNSAFE CODE, DO NOT USE!
// UNSAFE CODE, DO NOT USE!
contract BadPushPayments {
contract BadPushPayments {
...
...
contracts/examples/GoodArrayUse.sol
View file @
5ec4fbeb
import '../PullPaymentCapable.sol';
pragma solidity ^0.4.0;
import '../PullPayment.sol';
contract GoodArrayUse is PullPayment
Capable
{
contract GoodArrayUse is PullPayment {
address[] employees;
address[] employees;
mapping(address => uint) bonuses;
mapping(address => uint) bonuses;
...
...
contracts/examples/GoodFailEarly.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
contract GoodFailEarly {
contract GoodFailEarly {
uint constant DEFAULT_SALARY = 50000;
uint constant DEFAULT_SALARY = 50000;
...
...
contracts/examples/GoodPullPayments.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
contract GoodPullPayments {
contract GoodPullPayments {
address highestBidder;
address highestBidder;
uint highestBid;
uint highestBid;
...
...
contracts/examples/ProofOfExistence.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
import "../Rejector.sol";
import "../Rejector.sol";
/*
/*
...
...
contracts/examples/PullPaymentBid.sol
View file @
5ec4fbeb
import '../PullPaymentCapable.sol'
;
pragma solidity ^0.4.0
;
contract PullPaymentBid is PullPaymentCapable {
import '../PullPayment.sol';
contract PullPaymentBid is PullPayment {
address public highestBidder;
address public highestBidder;
uint public highestBid;
uint public highestBid;
...
...
contracts/examples/PullPayment
Capable
Example.sol
→
contracts/examples/PullPaymentExample.sol
View file @
5ec4fbeb
import '../PullPaymentCapable.sol'
;
pragma solidity ^0.4.0
;
// Example class using PullPaymentCapable
import '../PullPayment.sol';
contract PullPaymentCapableExample is PullPaymentCapable {
// Example class using PullPayment
contract PullPaymentExample is PullPayment {
// test helper function to call asyncSend
// test helper function to call asyncSend
function callSend(address dest, uint amount) external {
function callSend(address dest, uint amount) external {
asyncSend(dest, amount);
asyncSend(dest, amount);
...
...
contracts/examples/StoppableBid.sol
View file @
5ec4fbeb
import '../PullPaymentCapable.sol';
pragma solidity ^0.4.0;
import '../PullPayment.sol';
import '../Stoppable.sol';
import '../Stoppable.sol';
contract StoppableBid is Stoppable, PullPayment
Capable
{
contract StoppableBid is Stoppable, PullPayment {
address public highestBidder;
address public highestBidder;
uint public highestBid;
uint public highestBid;
function StoppableBid(address _curator)
function StoppableBid(address _curator)
Stoppable(_curator)
Stoppable(_curator)
PullPayment
Capable
() {}
PullPayment() {}
function bid() external stopInEmergency {
function bid() external stopInEmergency {
if (msg.value <= highestBid) throw;
if (msg.value <= highestBid) throw;
...
...
contracts/test-helpers/PullPaymentMock.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
import '../PullPayment.sol';
import '../PullPayment.sol';
// mock class using PullPayment
// mock class using PullPayment
...
...
test/PullPayment.js
View file @
5ec4fbeb
contract
(
'PullPayment
Capab
le'
,
function
(
accounts
)
{
contract
(
'PullPayment
Examp
le'
,
function
(
accounts
)
{
it
(
"can't call asyncSend externally"
,
function
(
done
)
{
it
(
"can't call asyncSend externally"
,
function
(
done
)
{
var
ppc
;
var
ppc
;
return
PullPayment
Capable
Example
.
new
()
return
PullPaymentExample
.
new
()
.
then
(
function
(
ppc
)
{
.
then
(
function
(
ppc
)
{
assert
.
isUndefined
(
ppc
.
asyncSend
);
assert
.
isUndefined
(
ppc
.
asyncSend
);
})
})
...
@@ -12,7 +12,7 @@ contract('PullPaymentCapable', function(accounts) {
...
@@ -12,7 +12,7 @@ contract('PullPaymentCapable', function(accounts) {
it
(
"can record an async payment correctly"
,
function
(
done
)
{
it
(
"can record an async payment correctly"
,
function
(
done
)
{
var
ppce
;
var
ppce
;
var
AMOUNT
=
100
;
var
AMOUNT
=
100
;
return
PullPayment
Capable
Example
.
new
()
return
PullPaymentExample
.
new
()
.
then
(
function
(
_ppce
)
{
.
then
(
function
(
_ppce
)
{
ppce
=
_ppce
;
ppce
=
_ppce
;
ppce
.
callSend
(
accounts
[
0
],
AMOUNT
)
ppce
.
callSend
(
accounts
[
0
],
AMOUNT
)
...
...
test/TestOwnable.sol
View file @
5ec4fbeb
pragma solidity ^0.4.0;
import "truffle/Assert.sol";
import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/Ownable.sol";
import "../contracts/Ownable.sol";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment