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
4e77aaa0
Unverified
Commit
4e77aaa0
authored
Jan 22, 2018
by
Matt Condon
Committed by
GitHub
Jan 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into fix/reference-of-rbac-usage
parents
96e0d35f
370e6a88
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
29 additions
and
12 deletions
+29
-12
CappedCrowdsale.sol
contracts/crowdsale/CappedCrowdsale.sol
+2
-2
SimpleToken.sol
contracts/examples/SimpleToken.sol
+1
-1
BasicTokenMock.sol
contracts/mocks/BasicTokenMock.sol
+1
-1
BurnableTokenMock.sol
contracts/mocks/BurnableTokenMock.sol
+1
-1
ERC223TokenMock.sol
contracts/mocks/ERC223TokenMock.sol
+1
-1
ERC827TokenMock.sol
contracts/mocks/ERC827TokenMock.sol
+1
-1
SafeERC20Helper.sol
contracts/mocks/SafeERC20Helper.sol
+8
-0
StandardTokenMock.sol
contracts/mocks/StandardTokenMock.sol
+1
-1
BasicToken.sol
contracts/token/BasicToken.sol
+9
-0
BurnableToken.sol
contracts/token/BurnableToken.sol
+1
-1
CappedToken.sol
contracts/token/CappedToken.sol
+1
-1
ERC20Basic.sol
contracts/token/ERC20/ERC20Basic.sol
+1
-1
MintableToken.sol
contracts/token/MintableToken.sol
+1
-1
DelayedClaimable.test.js
test/ownership/DelayedClaimable.test.js
+0
-0
No files found.
contracts/crowdsale/CappedCrowdsale.sol
View file @
4e77aaa0
...
...
@@ -22,14 +22,14 @@ contract CappedCrowdsale is Crowdsale {
// @return true if crowdsale event has ended
function hasEnded() public view returns (bool) {
bool capReached = weiRaised >= cap;
return
super.hasEnded() || capReached
;
return
capReached || super.hasEnded()
;
}
// overriding Crowdsale#validPurchase to add extra cap logic
// @return true if investors can buy at the moment
function validPurchase() internal view returns (bool) {
bool withinCap = weiRaised.add(msg.value) <= cap;
return
super.validPurchase() && withinCap
;
return
withinCap && super.validPurchase()
;
}
}
contracts/examples/SimpleToken.sol
View file @
4e77aaa0
...
...
@@ -22,7 +22,7 @@ contract SimpleToken is StandardToken {
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function SimpleToken() public {
totalSupply = INITIAL_SUPPLY;
totalSupply
_
= INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
...
...
contracts/mocks/BasicTokenMock.sol
View file @
4e77aaa0
...
...
@@ -9,7 +9,7 @@ contract BasicTokenMock is BasicToken {
function BasicTokenMock(address initialAccount, uint256 initialBalance) public {
balances[initialAccount] = initialBalance;
totalSupply = initialBalance;
totalSupply
_
= initialBalance;
}
}
contracts/mocks/BurnableTokenMock.sol
View file @
4e77aaa0
...
...
@@ -7,7 +7,7 @@ contract BurnableTokenMock is BurnableToken {
function BurnableTokenMock(address initialAccount, uint initialBalance) public {
balances[initialAccount] = initialBalance;
totalSupply = initialBalance;
totalSupply
_
= initialBalance;
}
}
contracts/mocks/ERC223TokenMock.sol
View file @
4e77aaa0
...
...
@@ -12,7 +12,7 @@ contract ERC223TokenMock is BasicToken {
function ERC223TokenMock(address initialAccount, uint256 initialBalance) public {
balances[initialAccount] = initialBalance;
totalSupply = initialBalance;
totalSupply
_
= initialBalance;
}
// ERC223 compatible transfer function (except the name)
...
...
contracts/mocks/ERC827TokenMock.sol
View file @
4e77aaa0
...
...
@@ -9,7 +9,7 @@ contract ERC827TokenMock is ERC827Token {
function ERC827TokenMock(address initialAccount, uint256 initialBalance) public {
balances[initialAccount] = initialBalance;
totalSupply = initialBalance;
totalSupply
_
= initialBalance;
}
}
contracts/mocks/SafeERC20Helper.sol
View file @
4e77aaa0
...
...
@@ -5,6 +5,10 @@ import "../token/ERC20/SafeERC20.sol";
contract ERC20FailingMock is ERC20 {
function totalSupply() public view returns (uint256) {
return 0;
}
function transfer(address, uint256) public returns (bool) {
return false;
}
...
...
@@ -28,6 +32,10 @@ contract ERC20FailingMock is ERC20 {
contract ERC20SucceedingMock is ERC20 {
function totalSupply() public view returns (uint256) {
return 0;
}
function transfer(address, uint256) public returns (bool) {
return true;
}
...
...
contracts/mocks/StandardTokenMock.sol
View file @
4e77aaa0
...
...
@@ -9,7 +9,7 @@ contract StandardTokenMock is StandardToken {
function StandardTokenMock(address initialAccount, uint256 initialBalance) public {
balances[initialAccount] = initialBalance;
totalSupply = initialBalance;
totalSupply
_
= initialBalance;
}
}
contracts/token/BasicToken.sol
View file @
4e77aaa0
...
...
@@ -14,6 +14,15 @@ contract BasicToken is ERC20Basic {
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
...
...
contracts/token/BurnableToken.sol
View file @
4e77aaa0
...
...
@@ -22,7 +22,7 @@ contract BurnableToken is BasicToken {
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply
= totalSupply
.sub(_value);
totalSupply
_ = totalSupply_
.sub(_value);
Burn(burner, _value);
}
}
contracts/token/CappedToken.sol
View file @
4e77aaa0
...
...
@@ -24,7 +24,7 @@ contract CappedToken is MintableToken {
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply.add(_amount) <= cap);
require(totalSupply
_
.add(_amount) <= cap);
return super.mint(_to, _amount);
}
...
...
contracts/token/ERC20/ERC20Basic.sol
View file @
4e77aaa0
...
...
@@ -7,7 +7,7 @@ pragma solidity ^0.4.18;
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply
;
function totalSupply() public view returns (uint256)
;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
...
...
contracts/token/MintableToken.sol
View file @
4e77aaa0
...
...
@@ -32,7 +32,7 @@ contract MintableToken is StandardToken, Ownable {
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply
= totalSupply
.add(_amount);
totalSupply
_ = totalSupply_
.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
...
...
test/ownership/DelayedClaimble.test.js
→
test/ownership/DelayedClaim
a
ble.test.js
View file @
4e77aaa0
File moved
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