Merge branch 'master' into feature/implement_erc721_standard
This commit is contained in:
@ -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.
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user