AkivaCoin (peace sign) - 2017 token on the simplified MyAdvancedToken pattern.
Historical Significance
A late-2017 example of the MyAdvancedToken family with both buy and sell sides enabled, deployed alongside many similar configurable-price tutorial-derived tokens during the ICO era.
Context
Deployed three months before the late-2017 ICO frenzy peak. Uses the post-v0.4.7 metadata trailer (bzzr0 swarm hash) common to mid-2017 Solidity contracts.
Token Information
Key Facts
Description
AkivaCoin (peace-sign emoji) is a 2017 token deployed on August 2, 2017 (block 4,106,618). It follows the ConsenSys MyAdvancedToken pattern, simplified to omit transferFrom, mintToken, and freezeAccount. Source reconstructed and verified - all 2,880 code bytes match on-chain runtime byte-for-byte; only the trailing 43-byte CBOR-encoded swarm metadata hash differs.
Source Verified
MyAdvancedToken simplified; all 2,880 code bytes match; CBOR swarm hash differs. Optimizer: ON (200 runs)
Spurious Dragon Era
Continued DoS protection. State trie clearing.
Bytecode Overview
Verified Source Available
This contract has verified source code.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract token {
string public standard = "Token 0.1";
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
function token(
uint256 initialSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol
) {
balanceOf[msg.sender] = initialSupply;
totalSupply = initialSupply;
name = tokenName;
symbol = tokenSymbol;
decimals = decimalUnits;
}
function transfer(address _to, uint256 _value) {
require(balanceOf[msg.sender] >= _value);
require(balanceOf[_to] + _value >= balanceOf[_to]);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender, _to, _value);
return;
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function () {
revert();
}
}
contract AkivaCoin is owned, token {
uint256 public sellPrice;
uint256 public buyPrice;
function AkivaCoin(
uint256 initialSupply,
string tokenName,
uint8 decimalUnits,
string tokenSymbol,
uint256 initialSellPrice,
uint256 initialBuyPrice
) token (initialSupply, tokenName, decimalUnits, tokenSymbol) {
sellPrice = initialSellPrice;
buyPrice = initialBuyPrice;
}
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
function buy() payable {
uint amount = msg.value / buyPrice;
require(balanceOf[this] >= amount);
balanceOf[msg.sender] += amount;
balanceOf[this] -= amount;
Transfer(this, msg.sender, amount);
}
function sell(uint256 amount) {
require(balanceOf[msg.sender] >= amount);
balanceOf[this] += amount;
balanceOf[msg.sender] -= amount;
msg.sender.transfer(amount * sellPrice);
Transfer(msg.sender, this, amount);
if (false) {}
}
}