-
-
Save chriseth/cd8d32ddd2d0216df33696be4e4f00b8 to your computer and use it in GitHub Desktop.
This file contains 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.0; | |
contract WeirdToken { | |
event Transfer(address indexed _from, address indexed _to, uint256 _value); | |
string public constant name = "WeirdToken"; | |
string public constant symbol = "WTK"; | |
uint8 public constant decimals = 0; | |
/// The main balances / accounting mapping. | |
mapping(address => uint256) balances; | |
uint public totalSupply; | |
/// @return the Token balance of a given account. | |
function balanceOf(address _account) view public returns (uint256) { | |
return balances[_account]; | |
} | |
/// Transfer some tokens from one account to another. | |
function transfer(address _to, uint256 _value) public returns (bool success) { | |
if (balances[msg.sender] >= _value) { | |
balances[msg.sender] -= _value; | |
balances[_to] += _value; | |
emit Transfer(msg.sender, _to, _value); | |
return true; | |
} else | |
return false; | |
} | |
/// Internal function to create a new token. | |
function createToken() internal { | |
balances[msg.sender] += 1; | |
totalSupply += 1; | |
emit Transfer(0, msg.sender, 1); | |
} | |
mapping(uint => bool) numberUsed; | |
function requestTokenMathematically(uint _multipleOf17) public { | |
require(_multipleOf17 % 17 == 0); | |
require(numberUsed[_multipleOf17] == false); | |
numberUsed[_multipleOf17] = true; | |
createToken(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Address: 0x57028676f6fef20d4fdf67078fbe7474713333d6