ETH Price: $2,512.95 (+0.87%)

Token

 

Overview

Max Total Supply

2,983,535,617

Holders

72

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 0 Decimals)

Balance
10,000,000

Value
$0.00
0x7C4401aE98F12eF6de39aE24cf9fc51f80EBa16B
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
GavCoin

Compiler Version
v0.3.6+commit.3fc68da

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2016-10-19
*/

contract Token {
    /// Get the total amount of tokens in the system.
    function totalSupply() constant returns (uint256 total);

    /// @param _owner The address from which the balance will be retrieved
    /// @return The balance
    function balanceOf(address _owner) constant returns (uint256 balance);

    /// @notice send `_value` token to `_to` from `msg.sender`
    /// @param _to The address of the recipient
    /// @param _value The amount of token to be transferred
    /// @return Whether the transfer was successful or not
    function transfer(address _to, uint256 _value) returns (bool success);

    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
    /// @param _from The address of the sender
    /// @param _to The address of the recipient
    /// @param _value The amount of token to be transferred
    /// @return Whether the transfer was successful or not
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);

    /// @notice `msg.sender` approves `_addr` to spend `_value` tokens
    /// @param _spender The address of the account able to transfer the tokens
    /// @param _value The amount of wei to be approved for transfer
    /// @return Whether the approval was successful or not
    function approve(address _spender, uint256 _value) returns (bool success);

    /// @param _owner The address of the account owning tokens
    /// @param _spender The address of the account able to transfer the tokens
    /// @return Amount of remaining tokens allowed to spent
    function allowance(address _owner, address _spender) constant returns (uint256 remaining);

    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}

contract GavCoin {
    struct Receipt {
        uint units;
        uint32 activation;
    }
    struct Account {
        uint balance;
        mapping (uint => Receipt) receipt;
        mapping (address => uint) allowanceOf;
    }
    
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Buyin(address indexed buyer, uint indexed price, uint indexed amount);
    event Refund(address indexed buyer, uint indexed price, uint indexed amount);
    event NewTranch(uint indexed price);
    
    modifier when_owns(address _owner, uint _amount) { if (accounts[_owner].balance < _amount) return; _ }
    modifier when_has_allowance(address _owner, address _spender, uint _amount) { if (accounts[_owner].allowanceOf[_spender] < _amount) return; _ }
    modifier when_have_active_receipt(uint _price, uint _units) { if (accounts[msg.sender].receipt[_price].units < _units || now < accounts[msg.sender].receipt[_price].activation) return; _ }

    function balanceOf(address _who) constant returns (uint) { return accounts[_who].balance; }
    
    function transfer(address _to, uint256 _value) when_owns(msg.sender, _value) returns (bool success) {
        Transfer(msg.sender, _to, _value);
        accounts[msg.sender].balance -= _value;
        accounts[_to].balance += _value;
    }
    function transferFrom(address _from, address _to, uint256 _value) when_owns(_from, _value) when_has_allowance(_from, msg.sender, _value) returns (bool success) {
        Transfer(_from, _to, _value);
        accounts[_from].allowanceOf[msg.sender] -= _value;
        accounts[_from].balance -= _value;
        accounts[_to].balance += _value;
        return true;
    }
    function approve(address _spender, uint256 _value) returns (bool success) {
        Approval(msg.sender, _spender, _value);
        accounts[msg.sender].allowanceOf[_spender] += _value;
        return true;
    }
    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
        return accounts[_owner].allowanceOf[_spender];
    }
    
    /// Simple buyin.
    function() { buyinInternal(msg.sender, 2 ** 255); }

    /// Extended buyin.
    function buyin(address _who, uint _maxPrice) { buyinInternal(_who, _maxPrice); }

    function refund(uint _price, uint _units) when_have_active_receipt(_price, _units) when_owns(msg.sender, _units) returns (bool) {
        Refund(msg.sender, _price, _units);
        accounts[msg.sender].balance -= _units;
        totalSupply += _units;
        accounts[msg.sender].receipt[_price].units -= _units;
        if (accounts[msg.sender].receipt[_price].units == 0)
            delete accounts[msg.sender].receipt[_price];
        if (!msg.sender.send(_units * _price / base))
            throw;
        return true;
    }

    function buyinInternal(address _who, uint _maxPrice) internal {
        var leftToSpend = msg.value;
        while (leftToSpend > 0 && price <= _maxPrice) {
            // How much the remaining tokens of this tranch cost to buy
            var maxCanSpend = price * remaining / base;
            // How much we will spend - the mininum of what's left in the tranch
            // to buy and what we have remaining
            var spend = leftToSpend > maxCanSpend ? maxCanSpend : leftToSpend;
            // The number of units we get for spending that
            var units = spend * base / price;

            // Provide tokens and a purchase receipt
            accounts[msg.sender].balance += units;
            accounts[msg.sender].receipt[price].units += units;
            accounts[msg.sender].receipt[price].activation = uint32(now) + refundActivationPeriod;
            totalSupply += units;
            Buyin(msg.sender, price, units);

            // Reduce the amounts remaining
            leftToSpend -= spend;
            remaining -= units;
            
            // If this is the end of the tranch...
            if (remaining == 0) {
                // ...Increment price and reset remaining
                price += tranchStep;
                remaining = tokensPerTranch * base;
                NewTranch(price);
            }
        }
    }
    
    uint public totalSupply;
    mapping (address => Account) accounts;
    
    uint constant base = 1000000;               // tokens are subdivisible by 1000000
    uint constant tranchStep = 1 finney;        // raise price by 1 finney / tranch
    uint constant tokensPerTranch = 100;        // 100 tokens per tranch
    uint public price = 1 finney;               // begin at 1 finney / token
    uint public remaining = tokensPerTranch * base;
    uint32 constant refundActivationPeriod = 7 days;
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"},{"name":"_maxPrice","type":"uint256"}],"name":"buyin","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"remaining","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"},{"name":"_units","type":"uint256"}],"name":"refund","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_who","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"type":"function"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":true,"name":"price","type":"uint256"},{"indexed":true,"name":"amount","type":"uint256"}],"name":"Buyin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":true,"name":"price","type":"uint256"},{"indexed":true,"name":"amount","type":"uint256"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"price","type":"uint256"}],"name":"NewTranch","type":"event"}]

606060405266038d7ea4c680006002556305f5e10060035561077b806100256000396000f3606060405236156100825760e060020a6000350463095ea7b381146100c957806318160ddd1461015457806323b872dd1461015d57806329cbdc861461019557806355234ec0146101a85780635af36e3e146101b157806370a0823114610252578063a035b1fe14610280578063a9059cbb14610289578063dd62ed3e146102c1575b6102fa6102fc3360ff60020a5b34600080805b6000841180156100a85750600254859011155b1561031257600254600354620f4240910204925082841161031a578361031c565b6102fe600435602435600082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600160a060020a0333811682526001602081815260408085209387168552600293909301905291208054830190555b92915050565b61026e60005481565b6102fe600435602435604435600160a060020a038316600090815260016020526040812054849083908190101561056f575050610568565b6102fa6004356024356105b1828261008f565b61026e60035481565b6102fe600435602435600160a060020a03331660009081526001602081815260408084208685529092019052812054839083908190108061024657506001600050600033600160a060020a03168152602001908152602001600020600050600101600050600083815260200190815260200160002060005060010160009054906101000a900463ffffffff1663ffffffff1642105b156105b557505061014e565b600435600160a060020a03166000908152600160205260409020545b60408051918252519081900360200190f35b61026e60025481565b6102fe600435602435600160a060020a03339081166000908152600160205260408120549091908390819010156106fb57505061014e565b61026e600435602435600160a060020a03828116600090815260016020908152604080832093851683526002939093019052205461014e565b005b565b604080519115158252519081900360200190f35b505050505050565b825b9150600260005054620f42408302049050806001600050600033600160a060020a03168152602001908152602001600020600050600001600082828250540192505081905550806001600050600033600160a060020a031681526020019081526020016000206000506001016000506000600260005054815260200190815260200160002060005060000160008282825054019250508190555062093a8042016001600050600033600160a060020a031681526020019081526020016000206000506001016000506000600260005054815260200190815260200160002060005060010160006101000a81548163ffffffff021916908302179055508060006000828282505401925050819055508060026000505433600160a060020a03167f689dcb02b6a65e0e2f1d23ef47c1ec86604ffbed0bcb65f20150cfc7d5e5a94860405180905060405180910390a460038054829003908190559382900393600014156104c5576002805466038d7ea4c6800001908190556305f5e1006003556040517f23c3dae768238f239632b5c4acb89485b440e0fa72481c4aad9f9b4f9b5a0a5f90600090a25b610095565b87600160a060020a031689600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a350505050600160a060020a038581166000908152600160208181526040808420338616855260028101835281852080548a9003905591839052815488900390915592871682529190208054850190559150505b9392505050565b600160a060020a0386811660009081526001602090815260408083203394851684526002019091529020548791908690819010156104ca575050505050610568565b5050565b600160a060020a03339081166000908152600160205260409020548590819010156105e3575050505061014e565b60405186908890600160a060020a033316907f73f04af9dcc582a923ec15d3eea990fe34adabfff2879e28d44572e01a54abb690600090a4600160a060020a033316600090815260016020818152604080842080548b9003815584548b0185558b85529092019052812080548890039081905514156106bc576001600050600033600160a060020a031681526020019081526020016000206000506001016000506000888152602001908152602001600020600060008201600050600090556001820160006101000a81549063ffffffff021916905550505b604051600160a060020a03331690600090620f42408a8a02049082818181858883f1935050505015156106ee57610002565b600194505050505061014e565b84600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050600160a060020a03338116600090815260016020526040808220805486900390559185168152208054830190559291505056

Deployed Bytecode

0x606060405236156100825760e060020a6000350463095ea7b381146100c957806318160ddd1461015457806323b872dd1461015d57806329cbdc861461019557806355234ec0146101a85780635af36e3e146101b157806370a0823114610252578063a035b1fe14610280578063a9059cbb14610289578063dd62ed3e146102c1575b6102fa6102fc3360ff60020a5b34600080805b6000841180156100a85750600254859011155b1561031257600254600354620f4240910204925082841161031a578361031c565b6102fe600435602435600082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600160a060020a0333811682526001602081815260408085209387168552600293909301905291208054830190555b92915050565b61026e60005481565b6102fe600435602435604435600160a060020a038316600090815260016020526040812054849083908190101561056f575050610568565b6102fa6004356024356105b1828261008f565b61026e60035481565b6102fe600435602435600160a060020a03331660009081526001602081815260408084208685529092019052812054839083908190108061024657506001600050600033600160a060020a03168152602001908152602001600020600050600101600050600083815260200190815260200160002060005060010160009054906101000a900463ffffffff1663ffffffff1642105b156105b557505061014e565b600435600160a060020a03166000908152600160205260409020545b60408051918252519081900360200190f35b61026e60025481565b6102fe600435602435600160a060020a03339081166000908152600160205260408120549091908390819010156106fb57505061014e565b61026e600435602435600160a060020a03828116600090815260016020908152604080832093851683526002939093019052205461014e565b005b565b604080519115158252519081900360200190f35b505050505050565b825b9150600260005054620f42408302049050806001600050600033600160a060020a03168152602001908152602001600020600050600001600082828250540192505081905550806001600050600033600160a060020a031681526020019081526020016000206000506001016000506000600260005054815260200190815260200160002060005060000160008282825054019250508190555062093a8042016001600050600033600160a060020a031681526020019081526020016000206000506001016000506000600260005054815260200190815260200160002060005060010160006101000a81548163ffffffff021916908302179055508060006000828282505401925050819055508060026000505433600160a060020a03167f689dcb02b6a65e0e2f1d23ef47c1ec86604ffbed0bcb65f20150cfc7d5e5a94860405180905060405180910390a460038054829003908190559382900393600014156104c5576002805466038d7ea4c6800001908190556305f5e1006003556040517f23c3dae768238f239632b5c4acb89485b440e0fa72481c4aad9f9b4f9b5a0a5f90600090a25b610095565b87600160a060020a031689600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a350505050600160a060020a038581166000908152600160208181526040808420338616855260028101835281852080548a9003905591839052815488900390915592871682529190208054850190559150505b9392505050565b600160a060020a0386811660009081526001602090815260408083203394851684526002019091529020548791908690819010156104ca575050505050610568565b5050565b600160a060020a03339081166000908152600160205260409020548590819010156105e3575050505061014e565b60405186908890600160a060020a033316907f73f04af9dcc582a923ec15d3eea990fe34adabfff2879e28d44572e01a54abb690600090a4600160a060020a033316600090815260016020818152604080842080548b9003815584548b0185558b85529092019052812080548890039081905514156106bc576001600050600033600160a060020a031681526020019081526020016000206000506001016000506000888152602001908152602001600020600060008201600050600090556001820160006101000a81549063ffffffff021916905550505b604051600160a060020a03331690600090620f42408a8a02049082818181858883f1935050505015156106ee57610002565b600194505050505061014e565b84600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050600160a060020a03338116600090815260016020526040808220805486900390559185168152208054830190559291505056

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.