Latest 1 txn

TxHash Age From To Value [TxFee]
0x4a52daf0a93660ac325f6939d0d9e67e5b09b1baf77aa7bbe685e7c51276100c336 days 1 hr agochevdor  IN    Contract Creation0 Ether0.012912655471




[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Verified Source Code for Contract 0xfB85F84805510035DbEfE3582cA48c90583E551F
Contract Name: FunToken
Compiler Version: v0.4.19+commit.c4cbbb05
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.19;

/**
 * The Owned contract ensures that only the creator (deployer) of a 
 * contract can perform certain tasks.
 */
contract Owned {
	address public owner = msg.sender;
	event OwnerChanged(address indexed old, address indexed current);
	modifier only_owner { require(msg.sender == owner); _; }
	function setOwner(address _newOwner) only_owner public { OwnerChanged(owner, _newOwner); owner = _newOwner; }
}

/**
 * See https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20_Token {
	// Triggered when tokens are transferred.
	event Transfer(address indexed _from, address indexed _to, uint256 _value);

	// Triggered whenever approve(address _spender, uint256 _value) is called.
	event Approval(address indexed _owner, address indexed _spender, uint256 _value);

	// Get the total token supply
	function totalSupply() constant returns (uint256 totalSupply);
	
	// Get the account balance of another account with address _owner
	function balanceOf(address _owner) constant returns (uint256 balance);
	
	// Send _value amount of tokens to address _to
	function transfer(address _to, uint256 _value) returns (bool success);
	
	// Send _value amount of tokens from address _from to address _to
	function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
	
	// Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value.
	function approve(address _spender, uint256 _value) returns (bool success);
	
	// Returns the amount which _spender is still allowed to withdraw from _owner
	function allowance(address _owner, address _spender) constant returns (uint256 remaining);
}

contract FunToken is ERC20_Token, Owned {
	mapping (address => uint256) public balances;
	mapping (address => mapping (address => uint256)) public allowance;
	uint public price;	// price per token. 
	uint256 supply;
	
	event PriceChanged(uint new_price);

	/**
	 * Prevent an account from behing 0x0
	 * @param addr Address to check
	 */
	modifier No0x(address addr) { 
		if (addr == 0x0) revert();
		_; 
	}

	/**
	 * A modifer to check validity of a balance for a transfer
	 * from an account to another.
	 * @param from  [description]
	 * @param to    [description]
	 * @param value [description]
	 */
	modifier ValidBalance(address from, address to, uint256 value) { 
		if (balances[from] < value) revert();                 // Check if the sender has enough
        if (balances[to] + value < balances[to]) revert();  // Check for overflows
		_; 
	}
	
	/**
	 * Constructor of FunToken
	 * @param _price Price for a token. 1 szabo or 1 finney would be good. That means 1 ETH = 1e6 tokens. 
	 */
	function FunToken (uint _price) {
		require(_price > 0);
		price = _price;
		supply = 0;
	}

	function () payable public  {
		uint nbTokens = msg.value / price;
		supply += nbTokens;
		balances[msg.sender] += nbTokens;
		Transfer(this, msg.sender, nbTokens);                 
	}
	
	function setPrice(uint _price) public only_owner{
		require(_price > 0);
		price = _price;
		PriceChanged(price);
	}


	function cashout() public only_owner{
		owner.transfer(this.balance);
	}

	/**
	 * Returns the total amount of tokens
	 * @return total amount
	 */
	function totalSupply() constant returns(uint256 totalSupply) {
		return supply;
	}

	/**
	 * Returns The balance of a given account
	 * @param addr Address of the account
	 * @return Balance
	 */
	function balanceOf(address addr) constant returns(uint256 balance) {
		return balances[addr];
	}
	
	/**
	 * Returns the amount which _spender is still allowed to withdraw from _owner
	 */
	function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
		return allowance[_owner][_spender];	
	}

	/**
	 * Send coins
	 * @param _to    	The recipient of tokens
	 * @param _value 	Amount of tokens to send 
	 */
	 function transfer(address _to, uint256 _value) No0x(_to) ValidBalance(msg.sender, _to, _value) 
	 returns (bool success) {                        
        balances[msg.sender] -= _value;                     // Subtract from the sender
        balances[_to] += _value;                            // Add the same to the recipient
        Transfer(msg.sender, _to, _value);                   // Notify anyone listening that this transfer took place
    	return true;
    }

    /**
     * Allow another contract to spend some tokens in your behalf
     * @param _spender 	Account that can take some of your tokens
     * @param _value   	Max amount of tokens the _spender account can take
     * @return {return}	Return true if the action succeeded
     */
    function approve(address _spender, uint256 _value) returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }  

    /**
     * A contract attempts to get the coins
     * @param _from     Address holding the tokens to transfer
     * @param _to       Account to send the coins to
     * @param _value	How many tokens     
     * @return {bool}   Whether the call was successful
     */
    function transferFrom(address _from, address _to, uint256 _value) No0x (_to) ValidBalance(_from, _to, _value)
    returns (bool success) {
        if (_value > allowance[_from][msg.sender]) revert();     // Check allowance
        balances[_from] -= _value;                           // Subtract from the sender
        balances[_to] += _value;                             // Add the same to the recipient
        allowance[_from][msg.sender] -= _value;
        Transfer(_from, _to, _value);
        return true;
    }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"totalSupply","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"cashout","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_price","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"new_price","type":"uint256"}],"name":"PriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"OwnerChanged","type":"event"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405260008054600160a060020a03191633600160a060020a0316179055341561002a57600080fd5b604051602080610783833981016040528080519150506000811161004d57600080fd5b600355600060045561071f806100646000396000f3006060604052600436106100b95763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461013557806313af40351461016b57806318160ddd1461018c57806323b872dd146101b157806327e235e3146101d957806370a08231146101f857806384054d3d146102175780638da5cb5b1461022a57806391b7f5ed14610259578063a035b1fe1461026f578063a9059cbb14610282578063dd62ed3e146102a4575b6000600354348115156100c857fe5b60048054929091049182019055600160a060020a03338116600081815260016020526040908190208054850190559293509130909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a350005b341561014057600080fd5b610157600160a060020a03600435166024356102c9565b604051901515815260200160405180910390f35b341561017657600080fd5b61018a600160a060020a0360043516610335565b005b341561019757600080fd5b61019f6103bb565b60405190815260200160405180910390f35b34156101bc57600080fd5b610157600160a060020a03600435811690602435166044356103c1565b34156101e457600080fd5b61019f600160a060020a03600435166104f1565b341561020357600080fd5b61019f600160a060020a0360043516610503565b341561022257600080fd5b61018a61051e565b341561023557600080fd5b61023d610574565b604051600160a060020a03909116815260200160405180910390f35b341561026457600080fd5b61018a600435610583565b341561027a57600080fd5b61019f6105e6565b341561028d57600080fd5b610157600160a060020a03600435166024356105ec565b34156102af57600080fd5b61019f600160a060020a03600435811690602435166106c8565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005433600160a060020a0390811691161461035057600080fd5b600054600160a060020a0380831691167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600082600160a060020a03811615156103d957600080fd5b600160a060020a0385166000908152600160205260409020548590859085908190101561040557600080fd5b600160a060020a038216600090815260016020526040902054818101101561042c57600080fd5b600160a060020a038089166000908152600260209081526040808320339094168352929052205486111561045f57600080fd5b600160a060020a03808916600081815260016020908152604080832080548c900390558b851680845281842080548d01905584845260028352818420339096168452949091529081902080548a900390557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9089905190815260200160405180910390a3506001979650505050505050565b60016020526000908152604090205481565b600160a060020a031660009081526001602052604090205490565b60005433600160a060020a0390811691161461053957600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561057257600080fd5b565b600054600160a060020a031681565b60005433600160a060020a0390811691161461059e57600080fd5b600081116105ab57600080fd5b60038190557fa6dc15bdb68da224c66db4b3838d9a2b205138e8cff6774e57d0af91e196d6228160405190815260200160405180910390a150565b60035481565b600082600160a060020a038116151561060457600080fd5b33600160a060020a038116600090815260016020526040902054859085908190101561062f57600080fd5b600160a060020a038216600090815260016020526040902054818101101561065657600080fd5b600160a060020a0333811660008181526001602052604080822080548b90039055928a168082529083902080548a019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9089905190815260200160405180910390a35060019695505050505050565b600160a060020a039182166000908152600260209081526040808320939094168252919091522054905600a165627a7a72305820043ee5124ad7511f4e9027d177ad751ff4e6af09c4ab45ec6f8c842345715b27002900000000000000000000000000000000000000000000000000038d7ea4c68000

   Swarm Source:
bzzr://043ee5124ad7511f4e9027d177ad751ff4e6af09c4ab45ec6f8c842345715b27

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward