pragma solidity ^0.4.13;
contract Latium {
string public constant name = "Latium";
string public constant symbol = "LAT";
uint8 public constant decimals = 16;
uint256 public constant totalSupply =
30000000 * 10 ** uint256(decimals);
// owner of this contract
address public owner;
// balances for each account
mapping (address => uint256) public balanceOf;
// triggered when tokens are transferred
event Transfer(address indexed _from, address indexed _to, uint _value);
// constructor
function Latium() {
owner = msg.sender;
balanceOf[owner] = totalSupply;
}
// transfer the balance from sender's account to another one
function transfer(address _to, uint256 _value) {
// prevent transfer to 0x0 address
require(_to != 0x0);
// sender and recipient should be different
require(msg.sender != _to);
// check if the sender has enough coins
require(_value > 0 && balanceOf[msg.sender] >= _value);
// check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// subtract coins from sender's account
balanceOf[msg.sender] -= _value;
// add coins to recipient's account
balanceOf[_to] += _value;
// notify listeners about this transfer
Transfer(msg.sender, _to, _value);
}
}
{
"compilationTarget": {
"Latium.sol": "Latium"
},
"libraries": {},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"}]