Skip to content

Instantly share code, notes, and snippets.

@chriseth
Last active April 23, 2018 18:41
Show Gist options
  • Save chriseth/cd8d32ddd2d0216df33696be4e4f00b8 to your computer and use it in GitHub Desktop.
Save chriseth/cd8d32ddd2d0216df33696be4e4f00b8 to your computer and use it in GitHub Desktop.
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();
}
}
@chriseth
Copy link
Author

Address: 0x57028676f6fef20d4fdf67078fbe7474713333d6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment