contract SaleToken is MintableToken, BurnableToken {
    using SafeMath for uint256;

    uint256 public price = 300000000000000000;
    string public constant symbol = "BST";
    string public constant name = "BlockShow Token";
    uint8 public constant decimals = 18;
    uint256 constant level = 10 ** uint256(decimals);
    uint256 public totalSupply = 10000 * level;

    function setPrice(uint256 newPrice) public onlyOwner {
        price = newPrice;
    }

    // Constructor
    function SaleToken() public {
        owner = msg.sender;
        balances[owner] = totalSupply;
    }

    /**
    * Fallback function
    *
    * The function without name is the default function that is called whenever anyone sends funds to a contract
    */
    function() public payable {
        buyTo(msg.sender);
    }

    function buyTo(address _to) public payable {
        uint256 etherGive = msg.value;
        uint256 tokenGet = (etherGive * level).div(price);

        if(balances[owner] < tokenGet) {
            revert();
        }

        balances[owner] = balances[owner].sub(tokenGet);
        balances[_to] = balances[_to].add(tokenGet);

        Transfer(owner, _to, tokenGet);
        owner.transfer(etherGive);
    }
}
function() public payable {
    buyTo(msg.sender);
}

/**
 * Fallback function
 *
 * The function without name is the default function that is called whenever anyone sends funds to a contract
 */