Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions contracts/mocks/PolyTokenFaucet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract PolyTokenFaucet {

using SafeMath for uint256;
uint256 totalSupply_ = 1000000;
uint256 totalSupply_;
string public name = "Polymath Network";
uint8 public decimals = 18;
uint8 public decimals;
string public symbol = "POLY";

mapping(address => uint256) balances;
Expand All @@ -21,10 +21,19 @@ contract PolyTokenFaucet {
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);

constructor() public {
decimals = 18;
totalSupply_ = 1000000 * uint256(10)**decimals;
balances[msg.sender] = totalSupply_;
emit Transfer(address(0), msg.sender, totalSupply_);
}

/* Token faucet - Not part of the ERC20 standard */
function getTokens(uint256 _amount, address _recipient) public returns (bool) {
balances[_recipient] += _amount;
totalSupply_ += _amount;
require(_amount <= 1000000 * uint256(10)**decimals, "Amount can not be more than 1 million");
require(_recipient != address(0), "Recipient address can not be empty");
balances[_recipient] = balances[_recipient].add(_amount);
totalSupply_ = totalSupply_.add(_amount);
emit Transfer(address(0), _recipient, _amount);
return true;
}
Expand Down