keycard-redeem/contracts/erc20/TestToken.sol

38 lines
782 B
Solidity
Raw Normal View History

2020-02-18 19:23:31 +00:00
pragma solidity ^0.6.1;
import "./StandardToken.sol";
/**
* @notice ERC20Token for test scripts, can be minted by anyone.
*/
contract TestToken is StandardToken {
string private _symbol;
uint256 private _decimals;
2020-02-18 19:23:31 +00:00
constructor(string memory symbol, uint256 decimals) public {
_symbol = symbol;
_decimals = decimals;
}
2020-02-18 19:23:31 +00:00
fallback() external {
uint256 amount = 5000;
mint(amount * uint256(10)**_decimals);
}
2020-03-25 09:03:27 +00:00
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint256) {
return _decimals;
}
/**
* @notice any caller can mint any `_amount`
* @param _amount how much to be minted
*/
function mint(uint256 _amount) public {
mint(msg.sender, _amount);
}
2020-02-18 19:23:31 +00:00
}