Sponsored Link:   Trade.io - The Exchange You've Been Waiting For Has Arrived. Instant Verification, Fully Customizable. Pre-Register today
Contract Overview
ETH Balance: 0.9671072 Ether
ETH USD Value: $617.83 (@ $638.84/ETH)
No Of Transactions: 5 txns
  Latest 5 txns

TxHash Age From To Value [TxFee]
0x3d533906133d36e0424c914e64acf7134160b22197e332ac13d0314f0481b7123 days 14 hrs ago0xc713ad7305ec2eb9d8d7654190ac359293a22968  IN   0x1db45a09efcdd8955b1c3bb855b5a8d333446bff0 Ether0.00008374
0x1a9982e0e2216df68ba585f3813c84356efa4e1f9bcb2917a9daed694424368e3 days 16 hrs ago0x73c4e5386073f34acbe47d57dd5e522fe2c3da66  IN   0x1db45a09efcdd8955b1c3bb855b5a8d333446bff0 Ether0.000022225
0x2ee3702e9b39d530aa6a9d2e7f7b8d17f8063df1bf4523866646768397b691ce8 days 2 hrs ago0xc713ad7305ec2eb9d8d7654190ac359293a22968  IN   0x1db45a09efcdd8955b1c3bb855b5a8d333446bff0 Ether0.000052337
0xd02b13d55871e1bbbccc60e68954755b374c12aa3c1a248ea12510c61a8c3c558 days 7 hrs ago0xc713ad7305ec2eb9d8d7654190ac359293a22968  IN   0x1db45a09efcdd8955b1c3bb855b5a8d333446bff0 Ether0.000062104
0x0e9c63ebbe169ba9d996f0be4d1422f07ebf06da0e40c19423e35dfcf99d8e4a8 days 11 hrs ago0xc713ad7305ec2eb9d8d7654190ac359293a22968  IN    Contract Creation0 Ether0.000746819
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0xb40b50faaf8eedd1a0d05e1ccc066de36ea2aec939c0f12594dbf11c10752139548776821 hrs 2 mins ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x2dcf14c8106cbdc882c5ff82f740e3062b3896bb7158f8411725cc8a73c0b767548775221 hrs 5 mins ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xd6d792c8db65ab2cbe8c4d92e6a83b331aaeb41386828f50139c946c4422d42c54767242 days 18 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x89e85cb281977eac56695d6728c03d3cd0acf4d343ae70df9070d3324ede642854736643 days 6 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x70b6620281a80226b5a41c4ce9982791aa5e64ef5e6e0daa64c4af030ba952c154736623 days 6 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xc08722d74013bae898f3ebd2cd7b0413f12f3322ccf4846bdffa94906464b24554736463 days 6 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xdd7725a90c165d16ca0d6bc65e5ada642de1372587ea80a0ea93263d674a794754735923 days 7 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x8e18361e8e515d56efdc90aa2fa6b3416e15ea5c07cbf39bbd6896acc3ffc57d54729673 days 9 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xac2c00ad70334aade21b72c73c3fbb08a21d310134c797405e10625b97b4472154724523 days 12 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x3d533906133d36e0424c914e64acf7134160b22197e332ac13d0314f0481b71254719593 days 14 hrs ago0x1db45a09efcdd8955b1c3bb855b5a8d333446bff0xc713ad7305ec2eb9d8d7654190ac359293a229680.0000928 Ether
0xec7bbbd34aee58dd7c5bd18f4a67f7ad5367d84158c692fb9fe582c5feefa8e954689844 days 2 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x3afc76a7d1c21c74281e5c6edb31eeb7c33e9546eba6177b099683abc5c5e2ee54682604 days 5 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x9a99136c71f193e6bae58008850ca08b69df7b6dd3757154f3a452d92b1fdb4254682484 days 5 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x6731cfa9bd1ce3d0724ea942dbfc87b63d166530a4d3f369e700f88bc622ad4154682214 days 5 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x4f0ffc6c19a43cdbc26718b56c53989f47453539e10487876468592fb48199a054682084 days 5 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x3be4740cb9bea0cd2d8d9989a42f8d15acd680b14998765466daa596974a954954681974 days 5 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xffc443c2b5e69b60220f55f2af01aee3f94648fb3bd280db366bb72861771f4e54680934 days 6 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xa794389bb3f745d189a5c121faea9bf9830ebe05eb336cb9388d3d989a2bfb1354680864 days 6 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x193191cd4380f51eb14c771026b191bca1c84d63b1f6eeb9a36d0320dfa6a06454680624 days 6 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x87d9d5e35ef540d8575b419374d9e8cc4c7a52585b19ea3032bcc65f7a810ae854647514 days 19 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x3dfdc92e78c77252c3370f5c8c1df498a60da267228edd1960d5f8baf1ee75aa54647434 days 19 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xdf656b50f785e3f742cf19f5ae85eca84901330481268e117e437bef124a5b0e54647434 days 19 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x7bf421c93caeba79c263054d95f494cc2ac9ce5768ed6b749cb36c1fd409950654647404 days 19 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0x6dff19d770305f669059e3aabb211c3ae0961c9501537b25b02c541b93044d4d54647334 days 19 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
0xc2c4f0f1b0819f26c12f3702138c274e18fd89e953154aa8ea5878ae9b6aa81554647314 days 19 hrs ago0xe0a22d8f528048ea7dc39fd660d2ac1f1c9595690x1db45a09efcdd8955b1c3bb855b5a8d333446bff0.004 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact match)
Contract Name: Share
Compiler Version: v0.4.21+commit.dfe3193c
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.21;

/**
 * this contract stands for the holds of WestIndia group
 * all income will be split to holders according to their holds
 * user can buy holds from shareholders at his will
 */
contract Share {

    bool public pause;
    /**
     * owner can pause the contract so that no one can withdrawal
     * he can't do anything else
     */
    address public owner;
    
    /**
     * the holds of every holder
     * the total holds stick to 10000
     */
    mapping (address => uint) public holds;

    /**
     * since we don't record holders' address in a list
     * and we don't want to loop holders list everytime when there is income
     *
     * we use a mechanism called 'watermark'
     * 
     * the watermark indicates the value that brought into each holds from the begining
     * it only goes up when new income send to the contract

     * fullfilled indicate the amount that the holder has withdrawaled from his share
     * it goes up when user withdrawal bonus
     * and it goes up when user sell holds, goes down when user buy holds, since the total bonus of him stays the same.
     */
    mapping (address => uint256) public fullfilled;

    /**
     * any one can setup a price to sell his holds
     * if set to 0, means not on sell
     */
    mapping (address => uint256) public sellPrice;
    mapping (address => uint) public toSell;

    uint256 public watermark;

    event PAUSED();
    event STARTED();

    event SHARE_TRANSFER(address from, address to, uint amount);
    event INCOME(uint256);
    event PRICE_SET(address holder, uint shares, uint256 price, uint sell);
    event WITHDRAWAL(address owner, uint256 amount);
    event SELL_HOLDS(address from, address to, uint amount, uint256 price);
    event SEND_HOLDS(address from, address to, uint amount);

    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }
    
    modifier notPaused() {
        require(!pause);
        _;
    }
    
    function setState(bool _pause) onlyOwner public {
        pause = _pause;
        
        if (_pause) {
            emit PAUSED();
        } else {
            emit STARTED();
        } 
    }

    /**
     * at start the owner has 100% share, which is 10,000 holds
     */
    function Share() public {        
        owner = msg.sender;
        holds[owner] = 10000;
        pause = false;
    }

    /**
     * when there's income, the water mark goes up
     */
    function onIncome() public payable {
        if (msg.value > 0) {
            watermark += (msg.value / 10000);
            assert(watermark * 10000 > watermark);

            emit INCOME(msg.value);
        }
    }

    /**
     * automatically split income
     */
    function() public payable {
        onIncome();
    }

    function bonus() public view returns (uint256) {
        return (watermark - fullfilled[msg.sender]) * holds[msg.sender];
    }
    
    function setPrice(uint256 price, uint sell) public notPaused {
        sellPrice[msg.sender] = price;
        toSell[msg.sender] = sell;
        emit PRICE_SET(msg.sender, holds[msg.sender], price, sell);
    }

    /**
     * withdrawal the bonus
     */
    function withdrawal() public notPaused {
        if (holds[msg.sender] == 0) {
            //you don't have any, don't bother
            return;
        }
        uint256 value = bonus();
        fullfilled[msg.sender] = watermark;

        msg.sender.transfer(value);

        emit WITHDRAWAL(msg.sender, value);
    }

    /**
     * transfer holds from => to (only holds, no bouns)
     * this will withdrawal the holder bonus of these holds
     * and the to's fullfilled will go up, since total bonus unchanged, but holds goes more
     */
    function transferHolds(address from, address to, uint amount) internal {
        require(holds[from] >= amount);
        require(amount > 0);

        uint256 fromBonus = (watermark - fullfilled[from]) * amount;
        uint256 toBonus = (watermark - fullfilled[to]) * holds[to];
        

        holds[from] -= amount;
        holds[to] += amount;
        fullfilled[to] = watermark - toBonus / holds[to];

        from.transfer(fromBonus);

        emit SHARE_TRANSFER(from, to, amount);
        emit WITHDRAWAL(from, fromBonus);
    }

    /**
     * one can buy holds from anyone who set up an price,
     * and u can buy @ price higher than he setup
     */
    function buyFrom(address from) public payable notPaused {
        require(sellPrice[from] > 0);
        uint256 amount = msg.value / sellPrice[from];

        if (amount >= holds[from]) {
            amount = holds[from];
        }

        if (amount >= toSell[from]) {
            amount = toSell[from];
        }

        require(amount > 0);

        toSell[from] -= amount;
        transferHolds(from, msg.sender, amount);
        from.transfer(msg.value);
        
        emit SELL_HOLDS(from, msg.sender, amount, sellPrice[from]);
    }
    
    function transfer(address to, uint amount) public notPaused {
        require(holds[msg.sender] >= amount);
        transferHolds(msg.sender, to, amount);
        
        emit SEND_HOLDS(msg.sender, to, amount);
    }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"from","type":"address"}],"name":"buyFrom","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"bonus","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pause","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"toSell","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"amount","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_pause","type":"bool"}],"name":"setState","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"fullfilled","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"holds","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"onIncome","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"withdrawal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"watermark","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"price","type":"uint256"},{"name":"sell","type":"uint256"}],"name":"setPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"sellPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[],"name":"PAUSED","type":"event"},{"anonymous":false,"inputs":[],"name":"STARTED","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"SHARE_TRANSFER","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"","type":"uint256"}],"name":"INCOME","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"holder","type":"address"},{"indexed":false,"name":"shares","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"},{"indexed":false,"name":"sell","type":"uint256"}],"name":"PRICE_SET","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WITHDRAWAL","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"}],"name":"SELL_HOLDS","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"SEND_HOLDS","type":"event"}]

  Contract Creation Code Switch To Opcodes View
6060604052341561000f57600080fd5b6000805461010060a860020a03191661010033600160a060020a03908116820292909217808455041681526001602052604081206127109055805460ff1916815561097590819061006090396000f3006060604052600436106100cf5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663691a3f6481146100d957806375b4d78c146100ed5780638456cb59146101125780638da5cb5b1461013957806392c51d3a14610168578063a9059cbb14610187578063ac9f0222146101a9578063ba548298146101c1578063c3d073ff146101e0578063d47c0fb0146100cf578063d4e93292146101ff578063f13dc2e214610212578063f7d9757714610225578063fcd393b91461023e575b6100d761025d565b005b6100d7600160a060020a03600435166102b7565b34156100f857600080fd5b610100610472565b60405190815260200160405180910390f35b341561011d57600080fd5b61012561049f565b604051901515815260200160405180910390f35b341561014457600080fd5b61014c6104a8565b604051600160a060020a03909116815260200160405180910390f35b341561017357600080fd5b610100600160a060020a03600435166104bc565b341561019257600080fd5b6100d7600160a060020a03600435166024356104ce565b34156101b457600080fd5b6100d76004351515610563565b34156101cc57600080fd5b610100600160a060020a03600435166105fb565b34156101eb57600080fd5b610100600160a060020a036004351661060d565b341561020a57600080fd5b6100d761061f565b341561021d57600080fd5b6101006106ee565b341561023057600080fd5b6100d76004356024356106f4565b341561024957600080fd5b610100600160a060020a036004351661079c565b60003411156102b55760058054612710348190049091019182905581021161028157fe5b7f340d7466e722c08973f52ac86a4c000d4f6c19b64417a453dd19e14c22839a153460405190815260200160405180910390a15b565b6000805460ff16156102c857600080fd5b600160a060020a038216600090815260036020526040812054116102eb57600080fd5b600160a060020a0382166000908152600360205260409020543481151561030e57fe5b600160a060020a0384166000908152600160205260409020549190049150811061034d5750600160a060020a0381166000908152600160205260409020545b600160a060020a03821660009081526004602052604090205481106103875750600160a060020a0381166000908152600460205260409020545b6000811161039457600080fd5b600160a060020a0382166000908152600460205260409020805482900390556103be8233836107ae565b600160a060020a0382163480156108fc0290604051600060405180830381858888f1935050505015156103f057600080fd5b7f651744d5204c9af244d95924618709bd2f817ce34717a93fb66fda030f32cf808233836003600087600160a060020a0316600160a060020a0316815260200190815260200160002054604051600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15050565b600160a060020a033316600090815260016020908152604080832054600290925290912054600554030290565b60005460ff1681565b6000546101009004600160a060020a031681565b60046020526000908152604090205481565b60005460ff16156104de57600080fd5b600160a060020a0333166000908152600160205260409020548190101561050457600080fd5b61050f3383836107ae565b7f406f762a95cdd6be5d64ff06454bcc82e34fbcb0d96f2a05f838628ac40d4590338383604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050565b60005433600160a060020a03908116610100909204161461058357600080fd5b6000805460ff191682158015919091179091556105cb577fa9aad58c4b885acff8f9e1618bc43dfc95c9de94a9a651589e5fc1d248b5305f60405160405180910390a16105f8565b7f1be35a59eaf211d3524f68a4558ae53028c9bbf75ad022c1de1b35bee8b3a1b560405160405180910390a15b50565b60026020526000908152604090205481565b60016020526000908152604090205481565b6000805460ff161561063057600080fd5b600160a060020a0333166000908152600160205260409020541515610654576105f8565b61065c610472565b600554600160a060020a033316600081815260026020526040908190209290925591925082156108fc0290839051600060405180830381858888f1935050505015156106a757600080fd5b7f4e03afc455089609953ae3473818d6eb2bacfa74db3a37652aedb667304af3ef3382604051600160a060020a03909216825260208201526040908101905180910390a150565b60055481565b60005460ff161561070457600080fd5b33600160a060020a038116600090815260036020908152604080832086905560048252808320859055600190915290819020547f83ad795fd4878097869f887c81d26e2679538582c005f3f5c887cb3a4c6f93e3929185908590518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a15050565b60036020526000908152604090205481565b600160a060020a0383166000908152600160205260408120548190839010156107d657600080fd5b600083116107e357600080fd5b5050600160a060020a0380841660008181526002602081815260408084205460055496891680865260018085528387208054968652848820549888529452918520805489900390559352805486019081905591840385029392909203909102908181151561084d57fe5b04600554036002600086600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a03166108fc839081150290604051600060405180830381858888f1935050505015156108ae57600080fd5b7f983460455a704de2b7c0a3aa0224496f578aa9226c81799190ad468ba03fa9ce858585604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a17f4e03afc455089609953ae3473818d6eb2bacfa74db3a37652aedb667304af3ef8583604051600160a060020a03909216825260208201526040908101905180910390a150505050505600a165627a7a72305820b95a45b9f9fcfe9925e60cb89f4c30309a1dcd727ddfe1b6ba028cb1edabf5740029

   Swarm Source:
bzzr://b95a45b9f9fcfe9925e60cb89f4c30309a1dcd727ddfe1b6ba028cb1edabf574

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.