38 lines
1.1 KiB
Solidity
38 lines
1.1 KiB
Solidity
pragma solidity 0.4.24;
|
|
|
|
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
|
|
|
|
contract NoReturnTransferTokenMock {
|
|
using SafeMath for uint256;
|
|
|
|
event Transfer(address indexed from, address indexed to, uint256 value);
|
|
|
|
mapping(address => uint256) internal balances;
|
|
uint256 internal totalSupply_;
|
|
|
|
function totalSupply() public view returns (uint256) {
|
|
return totalSupply_;
|
|
}
|
|
|
|
function mint(address _to, uint256 _amount) public returns (bool) {
|
|
totalSupply_ = totalSupply_.add(_amount);
|
|
balances[_to] = balances[_to].add(_amount);
|
|
emit Transfer(address(0), _to, _amount);
|
|
return true;
|
|
}
|
|
|
|
function balanceOf(address _owner) public view returns (uint256) {
|
|
return balances[_owner];
|
|
}
|
|
|
|
// solhint-disable-next-line no-simple-event-func-name
|
|
function transfer(address _to, uint256 _value) public {
|
|
require(_value <= balances[msg.sender]);
|
|
require(_to != address(0));
|
|
|
|
balances[msg.sender] = balances[msg.sender].sub(_value);
|
|
balances[_to] = balances[_to].add(_value);
|
|
emit Transfer(msg.sender, _to, _value);
|
|
}
|
|
}
|