BasicToken.sol 980 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. pragma solidity ^0.4.11;
  2. import './ERC20Basic.sol';
  3. import '../math/SafeMath.sol';
  4. /**
  5. * @title Basic token
  6. * @dev Basic version of StandardToken, with no allowances.
  7. */
  8. contract BasicToken is ERC20Basic {
  9. using SafeMath for uint256;
  10. mapping(address => uint256) balances;
  11. /**
  12. * @dev transfer token for a specified address
  13. * @param _to The address to transfer to.
  14. * @param _value The amount to be transferred.
  15. */
  16. function transfer(address _to, uint256 _value) returns (bool) {
  17. balances[msg.sender] = balances[msg.sender].sub(_value);
  18. balances[_to] = balances[_to].add(_value);
  19. Transfer(msg.sender, _to, _value);
  20. return true;
  21. }
  22. /**
  23. * @dev Gets the balance of the specified address.
  24. * @param _owner The address to query the the balance of.
  25. * @return An uint256 representing the amount owned by the passed address.
  26. */
  27. function balanceOf(address _owner) constant returns (uint256 balance) {
  28. return balances[_owner];
  29. }
  30. }