mirror of
https://github.com/chaintool-py/eth-erc20.git
synced 2024-11-25 03:06:46 +01:00
Add makefile
This commit is contained in:
parent
30baee6d19
commit
eb2b89b13e
File diff suppressed because one or more lines are too long
@ -52,6 +52,7 @@ contract GiftableToken {
|
||||
}
|
||||
|
||||
function transfer(address _to, uint256 _value) public returns (bool) {
|
||||
require(balanceOf[msg.sender] >= _value);
|
||||
balanceOf[msg.sender] -= _value;
|
||||
balanceOf[_to] += _value;
|
||||
emit Transfer(msg.sender, _to, _value);
|
||||
@ -59,6 +60,8 @@ contract GiftableToken {
|
||||
}
|
||||
|
||||
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
|
||||
require(allowances[_from][msg.sender] >= _value);
|
||||
require(balanceOf[_from] >= _value);
|
||||
allowances[_from][msg.sender] = allowances[_from][msg.sender] - _value;
|
||||
balanceOf[_from] -= _value;
|
||||
balanceOf[_to] += _value;
|
||||
|
Loading…
Reference in New Issue
Block a user