Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Barclays Prague Comms. Communicate here.
Barclays Prague Comms:
-> Paste address and other things in the comments.
@simondlr

This comment has been minimized.

Copy link
Owner Author

@simondlr simondlr commented Jan 17, 2017

0x374Bd185Ee19fD9f8682Eb875E5D0546A8D58CdD

@fehy

This comment has been minimized.

Copy link

@fehy fehy commented Jan 17, 2017

0x86b3408A63C1BF68496c1938C5446931B20cB41D

@fusr

This comment has been minimized.

Copy link

@fusr fusr commented Jan 17, 2017

0x9ACF8877F566D04F4BED57b6c2B8F7026556335F

@VictorGil

This comment has been minimized.

Copy link

@VictorGil VictorGil commented Jan 17, 2017

0xe15947dC2C4cf18c752d1E9D72e57196dfe75783

@Seilim

This comment has been minimized.

Copy link

@Seilim Seilim commented Jan 17, 2017

0x9F4a8640e6dC8564600D777037DE5aF1e892E887

@janstafa

This comment has been minimized.

Copy link

@janstafa janstafa commented Jan 17, 2017

0x842Ae957b1A05aF7A398Ca2cf564A5aC2616b2ef

@spmichal

This comment has been minimized.

Copy link

@spmichal spmichal commented Jan 17, 2017

0x93A0b7780dad967746c10444E48fcabA2278f74B

@simondlr

This comment has been minimized.

Copy link
Owner Author

@simondlr simondlr commented Jan 17, 2017

https://github.com/springblock/Ethereum/blob/master/Blockchain/genesisBlock.json

vi genesisBlock.json
"paste below"
:w
:q

{
  "config:": {
    "homesteadBlock": "10"
  },  
  "nonce": "0x0",
  "timestamp": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "extraData": "0x0",
  "gasLimit": "0x2FEFD8",
  "difficulty": "0x2000",
  "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x3333333333333333333333333333333333333333",
  "alloc": {
  }
}

geth --datadir Blockchain/data init genesisBlock.json

@simondlr

This comment has been minimized.

Copy link
Owner Author

@simondlr simondlr commented Jan 17, 2017

geth --identity $1 --rpc --rpcport "20000" --rpccorsdomain "localhost" --datadir Blockchain/data --port 20010 --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3,admin,personal" --autodag --networkid 44955 --nat "any" --nodiscover --maxpeers 8 console

@simondlr

This comment has been minimized.

Copy link
Owner Author

@simondlr simondlr commented Jan 17, 2017

admin.addPeer("enode://426db9b9f9e49ff53f256e91a8f024d611477ac47b94a82285473b58a18ee55be058df083021b3ae440ddd99eb42286863d9c96eb51af56b10c3f007f6c7457a@97.0.191.89:20010?discport=0");

@tomasekjan

This comment has been minimized.

Copy link

@tomasekjan tomasekjan commented Jan 17, 2017

enode: "enode://faa0ecc553920c397053ae37518977bb723eff56af870b3221084494e03fe97cf1c60bd93d072416524011430768a465168c7b5bb059801c8dc4fb449877dbe6@[::]:20010?discport=0",

@tomasekjan

This comment has been minimized.

Copy link

@tomasekjan tomasekjan commented Jan 17, 2017

97.1.18.96

@janstafa

This comment has been minimized.

Copy link

@janstafa janstafa commented Jan 17, 2017

97.0.248.180

@simondlr

This comment has been minimized.

Copy link
Owner Author

@simondlr simondlr commented Jan 17, 2017

On Android hotspot:

admin.addPeer("enode://426db9b9f9e49ff53f256e91a8f024d611477ac47b94a82285473b58a18ee55be058df083021b3ae440ddd99eb42286863d9c96eb51af56b10c3f007f6c7457a@192.168.43.19:20010?discport=0");

@simondlr

This comment has been minimized.

Copy link
Owner Author

@simondlr simondlr commented Jan 17, 2017

@VictorGil

This comment has been minimized.

Copy link

@VictorGil VictorGil commented Jan 17, 2017

I am 192.168.43.254

@tomasekjan

This comment has been minimized.

Copy link

@tomasekjan tomasekjan commented Jan 17, 2017

0x24396580B5db8bF04cb2467B04a8260cD10dd5B7 Jan

@janstafa

This comment has been minimized.

Copy link

@janstafa janstafa commented Jan 17, 2017

0xf3081cb21e8ee1a8ee7c3a9117780d4527e29f07

@spmichal

This comment has been minimized.

Copy link

@spmichal spmichal commented Jan 17, 2017

0x93A0b7780dad967746c10444E48fcabA2278f74B

@simondlr

This comment has been minimized.

Copy link
Owner Author

@simondlr simondlr commented Jan 19, 2017

pragma solidity ^0.4.8;

contract Owner {
    address owner;
    
    function Owner() {
        owner = msg.sender;
    }
    
    modifier isOwner() {
        if(msg.sender == owner) {
            _;
        }
    }
}

contract ERC20Asset is Owner {
    
    mapping(address => uint256) public balances;
    mapping(address => mapping(address => uint256)) public allowed;

    function ERC20Asset() {
        //balances[msg.sender] = 10000;
    }
    
    function deposit() payable {
        balances[msg.sender] += msg.value;
    }
    
    function withdraw() {
        if(!msg.sender.send(balances[msg.sender])) {
            throw;    
        }
        
        balances[msg.sender] = 0;

    }
    
    /*function mint(address _for, uint256 _value) isOwner {
        balances[_for] += _value;
    }
    
    function destroy(address _for, uint256 _value) isOwner {
        if(balances[_for] >= _value) {
            balances[_for] -= _value;
        } else {
            balances[_for] = 0;
        }
    }*/
    
    function balanceOf(address _owner) constant returns (uint256 balance) {
        return balances[_owner];
    }
    
    function transfer(address _to, uint256 _value) returns (bool success) {
        //msg.sender
        //tx.origin [BAD]
        if(balances[msg.sender] >= _value) {
            balances[msg.sender] -= _value;
            balances[_to] += _value;
            Transfer(msg.sender, _to, _value);
            return true;
        } else {
            throw;
        }
    }
    
    //function internalTransfer()
    
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        //spender == msg.sender
        if(allowed[_from][msg.sender] >= _value && balances[_from] >= _value) {
            balances[_from] -= _value;
            balances[_to] += _value;
            allowed[_from][msg.sender] -= _value;
            Transfer(_from, _to, _value);
            return true;
        }
        return false;
    }
    
    function allowance(address _owner, address _spender) constant returns (uint amount) {
        return allowed[_owner][_spender];
        
    }
    
    function approve(address _spender, uint256 _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    } 
    
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
    event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
@simondlr

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment