Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- geth --testnet --datadir="x:\a\b\GethWithRopsten\"
- var web3 = new Web3(new web3.providers.IpcProvider('\\.\pipe\geth.ipc',net));
- function div(uint256 a, uint256 b) internal pure returns (uint256) {
- return a / b;
- }
- function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
- sellPrice = newSellPrice;
- buyPrice = newBuyPrice;
- }
- function buy() payable onlyIfEnabled public {
- uint256 amount = msg.value.div(buyPrice);
- _transfer(this, msg.sender, amount);
- }
- function _transfer(address _from, address _to, uint256 _value) internal returns (bool){
- require (_to != 0x0);
- require (balanceOf[_from] >= _value);
- require (balanceOf[_to].add(_value) > balanceOf[_to]);
- require(!frozenAccount[_from]);
- require(!frozenAccount[_to]);
- balanceOf[_from] = balanceOf[_from].sub(_value);
- balanceOf[_to] = balanceOf[_to].add(_value);
- emit Transfer(_from, _to, _value);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement