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.
@tomasekjan
Copy link

tomasekjan commented Jan 17, 2017

97.1.18.96

@janstafa
Copy link

janstafa commented Jan 17, 2017

97.0.248.180

@simondlr
Copy link
Author

simondlr commented Jan 17, 2017

On Android hotspot:

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

@simondlr
Copy link
Author

simondlr commented Jan 17, 2017

@VictorGil
Copy link

VictorGil commented Jan 17, 2017

I am 192.168.43.254

@tomasekjan
Copy link

tomasekjan commented Jan 17, 2017

0x24396580B5db8bF04cb2467B04a8260cD10dd5B7 Jan

@janstafa
Copy link

janstafa commented Jan 17, 2017

0xf3081cb21e8ee1a8ee7c3a9117780d4527e29f07

@spmichal
Copy link

spmichal commented Jan 17, 2017

0x93A0b7780dad967746c10444E48fcabA2278f74B

@simondlr
Copy link
Author

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);
}

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