Verified contractPartial
token
Address0xfe331c7af078f5a8545c40b57bfca0ab8df4fb80
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.1.5
- Same code
Only this contract
Details
- Compiler
- solc 0.1.5+commit.23865e39
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 392,000
- Creation transaction
- 0x13ac173517…09a6933e84
token.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract token {
mapping (address => uint) public coinBalanceOf;
uint totalEther;
uint totalTokens;
uint tokenPrice;
event CoinTransfer(address sender, address receiver, uint amount);
function token(uint supply) {
coinBalanceOf[msg.sender] = supply;
totalTokens = supply;
totalEther = msg.value;
tokenPrice = totalEther / totalTokens;
}
function sendCoin(address receiver, uint amount) returns(bool sufficient) {
if (coinBalanceOf[msg.sender] < amount) return false;
coinBalanceOf[msg.sender] -= amount;
coinBalanceOf[receiver] += amount;
CoinTransfer(msg.sender, receiver, amount);
return true;
}
function showTokenPrice() returns (uint) {
return tokenPrice;
}
function showTokens(address addr) returns (uint) {
return coinBalanceOf[addr];
}
function showTotalEther() returns (uint) {
return totalEther;
}
function showBalance() returns (uint) {
return this.balance;
}
function showTotalTokens() returns (uint) {
return totalTokens;
}
function withdraw(uint amount) returns (bool) {
if (amount <= coinBalanceOf[msg.sender]) {
msg.sender.send(amount * tokenPrice);
totalTokens -= amount;
coinBalanceOf[msg.sender] -= amount;
totalEther -= amount * tokenPrice;
return true;
}
return false;
}
function deposit() returns (uint tokens) {
tokens = msg.value / tokenPrice;
coinBalanceOf[msg.sender] += tokens;
totalTokens += tokens;
totalEther += msg.value;
return tokens;
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.