Created
January 22, 2019 07:46
-
-
Save werew/1d9125cafa0d113766b5085b63900a2b to your computer and use it in GitHub Desktop.
Shrinked PFAToken
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.20; | |
interface ERC20Token { | |
function balanceOf(address _owner) constant external returns (uint256 balance); | |
function transfer(address _to, uint256 _value) external returns (bool success); | |
} | |
contract Token is ERC20Token{ | |
mapping (address => uint256) balances; | |
mapping (address => mapping (address => uint256)) allowed; | |
uint256 public totalSupply; | |
function balanceOf(address _owner) constant external returns (uint256 balance) { | |
return balances[_owner]; | |
} | |
function transfer(address _to, uint256 _value) external returns (bool success) { | |
if(msg.data.length < (2 * 32) + 4) { revert(); } | |
if (balances[msg.sender] >= _value && _value > 0) { | |
balances[msg.sender] -= _value; | |
balances[_to] += _value; | |
return true; | |
} else { return false; } | |
} | |
} | |
contract PFAToken is Token{ | |
address owner = msg.sender; | |
//consturtor | |
function PFAToken() { | |
balances[msg.sender] = 1000000000 * 1000000000000000000; | |
balances[address(this)] = 1; // XXX | |
totalSupply = 1000000000 * 1000000000000000000; | |
totalSupply += 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment