Contract 0x8302d610f9c6b94560befb9a7118b4aa7f414ec3

 

TxHash Block Age From To Value [TxFee]
0xa63668ccc1d73d1e82b61b46eda4085cf51cd9baa4a7eaad0d6efe08a37f4e81706067937 days 22 hrs ago0x8c5b361555eeb37f24d840c83be7666d5166858f IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000291875
0x8e8e545b0e654ad648b85ef70ae7cff015bbd31af5613804d9aff2e03882c68f6395557148 days 10 hrs ago0x9a0474070bd71fcc84a364de4f8a8848f6c4f816 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.005421875
0x0e62710fd54aa6442ac31b24dd5a69b6231e856642f1622812c790960e357e325849474240 days 15 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000216875
0xab771326d4a7a00d171156ee17d3f82b52fbe97111e7c6746948cb4130a167a95849472240 days 15 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.0001735
0x7ecdcc2a03a2723c21ba5cf1dbc588fb88a2cbe1673eb0756282379a387057dd5848658240 days 18 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.00043311
0xd39773eeacbe941a175b93292bd4be76e54bd886bcdebd2e65a01f32d0c4917d5848645240 days 18 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000216555
0xa540de357290c7a8f6c88b10d9079b1074fd23ddfe64eaaad4be2fc4c81058ab5848301240 days 20 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000167868
0xd5e52b681bda2cc88ddd8a7890fdf012a9367c9877e2a8f765cd87f0649ec5345848068240 days 21 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.0001735
0x0badd8cb7dda238e3306193dc8ff140757cff8dfbd95e27c4fc8f2cb0a58788e5848057240 days 21 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.002212125
0xbc61db766ff1e18dde430f786e05f7e02773beeadd204a1e37d715c33d03f00a5847343241 days 7 mins ago0xbc8834edc658c07bf3f865b08f2a47380a8a6cbd IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000216875
0xeb9f172bb2a2f4143443ca8e0e4843e7cb2a984ade51ce5604a34a1e1f0a04995847173241 days 47 mins ago0x7e7e2bf7edc52322ee1d251432c248693ecd9e0f IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.001604875
0x3154ef180a81ae82f132cc67e4a08f48858f7e7db18cb4c05122d81e9b43ebb15845070241 days 9 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.0008675
0x43b942b7a4cac1b17bb7d127807bb746c612aa5427103dc5da1a7dce1e55270c5845052241 days 9 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000291875
0xfef57fb8d88ec36aeb8eb99369da575a672e15e564e8156e911202c3f46b40db5845010241 days 9 hrs ago0x5409e9e2f6cc8340d307fa15e0728adad54d6e8c IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.001079375
0x6d32c3f57b1972a94ed67421a19778a6ef47ec2d404e8ce6d3aedcda5f3db0905843830241 days 14 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000216555
0xc292b16c27313e2a2eff25c8208727026a1eeb99c2abc619a6e8f5561089bf055843681241 days 15 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.00086622
0xb0ee8ad623dc270ca211ef70bc06c35d83ebe1d932c5c1cfb9b8ce5705f07e185843679241 days 15 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000216555
0x7bf4401dc94ac9ac70d9d8cbf6313fea0d0a7d622fd902b19715ca6c4b34b1295843607241 days 15 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000086622
0x78f0259a38d96809ac58dddebe6c445231b507998f87a41b7bec1d4a34b156495843606241 days 15 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000086622
0x1143069b90510536568125d6b170d3c162655f938591de696220b8a65fcd5c025843580241 days 15 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  0x8302d610f9c6b94560befb9a7118b4aa7f414ec30 Ether0.000084502
0xfd807134798d9935d4171ebf95730de8a5196916eeb4aba3fa85bfbd6a58cb795843561241 days 15 hrs ago0x1d00ffffb205cc0c5a51e7c77a7668a8b90bbb90 IN  Contract Creation0 Ether0.0014013
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: GasFaucet
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: No
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.18;
/*

0xBitcoin Token Faucet in a Smart Contract (ver 0.0.0)

Any tokens sent to this contract may be withdrawn by other users through use
of the dispense() function. The dispensed amount is dependant on the
transaction's gas price. This means a transaction sent at 4 gwei will dispense
twice as many tokens as a transaction sent at 2 gwei.

The dispensing "rate" is changable by the contract owner and allows the rate to
be changed over time to follow the token's price. The intention of this ratio is
to ensure that the value of ether spent as gas is roughly equal to the value of
the tokens received.

Typically calls to dispense() cost about 41879 gas total.

*/


/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  /**
  * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}


contract ERC20Interface {
    function totalSupply() public constant returns (uint);
    function balanceOf(address tokenOwner) public constant returns (uint balance);
    function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
    function transfer(address to, uint tokens) public returns (bool success);
    function approve(address spender, uint tokens) public returns (bool success);
    function transferFrom(address from, address to, uint tokens) public returns (bool success);

    event Transfer(address indexed from, address indexed to, uint tokens);
    event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}


// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
    address public owner;
    address public newOwner;

    event OwnershipTransferred(address indexed _from, address indexed _to);

    function Owned() public {
        owner = msg.sender;
    }

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address _newOwner) public onlyOwner {
        newOwner = _newOwner;
    }
    function acceptOwnership() public {
        require(msg.sender == newOwner);
        OwnershipTransferred(owner, newOwner);
        owner = newOwner;
        newOwner = address(0);
    }
}


contract GasFaucet is Owned {
    using SafeMath for uint256;

    address public faucetTokenAddress;
    uint256 public priceInWeiPerSatoshi;

    event Dispense(address indexed destination, uint256 sendAmount);

    constructor() public {
        // 0xBitcoin Token Address (Ropsten)
        // faucetTokenAddress = 0x9D2Cc383E677292ed87f63586086CfF62a009010;
        // 0xBitcoin Token Address (Mainnet)
        faucetTokenAddress = 0xB6eD7644C69416d67B522e20bC294A9a9B405B31;

        // Set rate to 0 satoshis / wei. Calls to 'dispense' will send 0 tokens
        // until the rate is manually changed.
        priceInWeiPerSatoshi = 0;
    }

    // ------------------------------------------------------------------------
    // Dispense some free tokens. The more gas you spend, the more tokens you
    // recieve. 
    // 
    // Tokens recieved (in satoshi) = gasprice / priceInWeiPerSatoshi
    // ------------------------------------------------------------------------
    function dispense(address destination) public {
        uint256 sendAmount = calculateDispensedTokensForGasPrice(tx.gasprice);
        require(tokenBalance() > sendAmount);

        ERC20Interface(faucetTokenAddress).transfer(destination, sendAmount);

        emit Dispense(destination, sendAmount);
    }
    
    // ------------------------------------------------------------------------
    // Retrieve the current dispensing rate in satoshis per gwei
    // ------------------------------------------------------------------------
    function calculateDispensedTokensForGasPrice(uint256 gasprice) public view returns (uint256) {
        if(priceInWeiPerSatoshi == 0){ 
            return 0; 
        }
        return gasprice.div(priceInWeiPerSatoshi);
    }
    
    // ------------------------------------------------------------------------
    // Retrieve Faucet's balance 
    // ------------------------------------------------------------------------
    function tokenBalance() public view returns (uint)  {
        return ERC20Interface(faucetTokenAddress).balanceOf(this);
    }
    
    // ------------------------------------------------------------------------
    // Retrieve the current dispensing rate in satoshis per gwei
    // ------------------------------------------------------------------------
    function getWeiPerSatoshi() public view returns (uint256) {
        return priceInWeiPerSatoshi;
    }
    
    // ------------------------------------------------------------------------
    // Set the current dispensing rate in satoshis per gwei
    // ------------------------------------------------------------------------
    function setWeiPerSatoshi(uint256 price) public onlyOwner {
        priceInWeiPerSatoshi = price;
    }

    // ------------------------------------------------------------------------
    // Don't accept ETH
    // ------------------------------------------------------------------------
    function () public payable {
        revert();
    }

    // ------------------------------------------------------------------------
    // Owner can withdraw any accidentally sent eth
    // ------------------------------------------------------------------------
    function withdrawEth(uint256 amount) public onlyOwner {
        require(amount < address(this).balance);
        owner.transfer(amount);
    }

    // ------------------------------------------------------------------------
    // Owner can transfer out any ERC20 tokens
    // ------------------------------------------------------------------------
    function transferAnyERC20Token(address tokenAddress, uint256 tokens) public onlyOwner {
        
        // Note: Owner has full control of priceInWeiPerSatoshi, so preventing
        // withdrawal of the faucetTokenAddress token serves no purpose. It
        // would merely be misleading.
        //
        // if(tokenAddress == faucetTokenAddress){ 
        //     revert(); 
        // }

        ERC20Interface(tokenAddress).transfer(owner, tokens);
    }
}

Contract ABI
[{"constant":true,"inputs":[],"name":"priceInWeiPerSatoshi","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getWeiPerSatoshi","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"destination","type":"address"}],"name":"dispense","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"faucetTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"withdrawEth","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tokenAddress","type":"address"},{"name":"tokens","type":"uint256"}],"name":"transferAnyERC20Token","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"gasprice","type":"uint256"}],"name":"calculateDispensedTokensForGasPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"price","type":"uint256"}],"name":"setWeiPerSatoshi","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"destination","type":"address"},{"indexed":false,"name":"sendAmount","type":"uint256"}],"name":"Dispense","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Contract Creation Code
608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555073b6ed7644c69416d67b522e20bc294a9a9b405b31600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600381905550610c30806100bd6000396000f3006080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302987db8146100ca57806314b933e1146100f55780635f7462331461012057806379ba5097146101635780638da5cb5b1461017a5780639d499363146101d15780639e1a4d1914610228578063c311d04914610253578063d4ee1d9014610280578063dc39d06d146102d7578063e8c2835814610324578063ecbdee9b14610365578063f2fde38b14610392575b600080fd5b3480156100d657600080fd5b506100df6103d5565b6040518082815260200191505060405180910390f35b34801561010157600080fd5b5061010a6103db565b6040518082815260200191505060405180910390f35b34801561012c57600080fd5b50610161600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103e5565b005b34801561016f57600080fd5b5061017861055a565b005b34801561018657600080fd5b5061018f6106f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101dd57600080fd5b506101e661071e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023457600080fd5b5061023d610744565b6040518082815260200191505060405180910390f35b34801561025f57600080fd5b5061027e60048036038101908080359060200190929190505050610843565b005b34801561028c57600080fd5b5061029561092e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e357600080fd5b50610322600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610954565b005b34801561033057600080fd5b5061034f60048036038101908080359060200190929190505050610ab3565b6040518082815260200191505060405180910390f35b34801561037157600080fd5b5061039060048036038101908080359060200190929190505050610ae5565b005b34801561039e57600080fd5b506103d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b4a565b005b60035481565b6000600354905090565b60006103f03a610ab3565b9050806103fb610744565b11151561040757600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156104cc57600080fd5b505af11580156104e0573d6000803e3d6000fd5b505050506040513d60208110156104f657600080fd5b8101908080519060200190929190505050508173ffffffffffffffffffffffffffffffffffffffff167feb9df064f68e905565a2656b40e16dd2df0c9c21d72fda0d3a97de56f826f3d8826040518082815260200191505060405180910390a25050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105b657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561080357600080fd5b505af1158015610817573d6000803e3d6000fd5b505050506040513d602081101561082d57600080fd5b8101908080519060200190929190505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1631811015156108c357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561092a573d6000803e3d6000fd5b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109af57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a7357600080fd5b505af1158015610a87573d6000803e3d6000fd5b505050506040513d6020811015610a9d57600080fd5b8101908080519060200190929190505050505050565b6000806003541415610ac85760009050610ae0565b610add60035483610be990919063ffffffff16565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4057600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba557600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284811515610bf757fe5b04905080915050929150505600a165627a7a72305820c17d57b65143c1084ba5c7744c6a4f6571d5e72153b9aba30ab9438a6f2807fa0029


   Swarm Source:
bzzr://c17d57b65143c1084ba5c7744c6a4f6571d5e72153b9aba30ab9438a6f2807fa
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.