|
@@ -1,8 +1,8 @@
|
|
|
pragma solidity ^0.4.8;
|
|
|
|
|
|
|
|
|
+import './BasicToken.sol';
|
|
|
import './ERC20.sol';
|
|
|
-import '../SafeMath.sol';
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -12,19 +12,11 @@ import '../SafeMath.sol';
|
|
|
* Based on code by FirstBlood:
|
|
|
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
|
|
|
*/
|
|
|
-contract StandardToken is ERC20, SafeMath {
|
|
|
+contract StandardToken is BasicToken, ERC20 {
|
|
|
|
|
|
- mapping(address => uint) balances;
|
|
|
mapping (address => mapping (address => uint)) allowed;
|
|
|
|
|
|
- function transfer(address _to, uint _value) returns (bool success) {
|
|
|
- balances[msg.sender] = safeSub(balances[msg.sender], _value);
|
|
|
- balances[_to] = safeAdd(balances[_to], _value);
|
|
|
- Transfer(msg.sender, _to, _value);
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- function transferFrom(address _from, address _to, uint _value) returns (bool success) {
|
|
|
+ function transferFrom(address _from, address _to, uint _value) {
|
|
|
var _allowance = allowed[_from][msg.sender];
|
|
|
|
|
|
// Check is not needed because safeSub(_allowance, _value) will already throw if this condition is not met
|
|
@@ -34,17 +26,11 @@ contract StandardToken is ERC20, SafeMath {
|
|
|
balances[_from] = safeSub(balances[_from], _value);
|
|
|
allowed[_from][msg.sender] = safeSub(_allowance, _value);
|
|
|
Transfer(_from, _to, _value);
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- function balanceOf(address _owner) constant returns (uint balance) {
|
|
|
- return balances[_owner];
|
|
|
}
|
|
|
|
|
|
- function approve(address _spender, uint _value) returns (bool success) {
|
|
|
+ function approve(address _spender, uint _value) {
|
|
|
allowed[msg.sender][_spender] = _value;
|
|
|
Approval(msg.sender, _spender, _value);
|
|
|
- return true;
|
|
|
}
|
|
|
|
|
|
function allowance(address _owner, address _spender) constant returns (uint remaining) {
|