[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: EndpointRegistry
Compiler Version: v0.4.25+commit.59dbf8f1
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.23;

/// @title Endpoint Registry
/// @notice This contract is a registry which maps an Ethereum address to its
/// endpoint. The Raiden node registers its ethereum address in this registry.
contract EndpointRegistry {
    string constant public contract_version = "0.3._";

    event AddressRegistered(address indexed eth_address, string endpoint);
    mapping (address => string) private address_to_endpoint;

    modifier noEmptyString(string str) {
        require(equals(str, "") != true);
        _;
    }

    /// @notice Registers the Ethereum address to the given endpoint.
    /// @param endpoint String in the format "127.0.0.1:38647".
    function registerEndpoint(string endpoint)
        public
        noEmptyString(endpoint)
    {
        string storage old_endpoint = address_to_endpoint[msg.sender];

        // Compare if the new endpoint matches the old one, if it does just
        // return
        if (equals(old_endpoint, endpoint)) {
            return;
        }

        // Update the storage with the new endpoint value
        address_to_endpoint[msg.sender] = endpoint;
        emit AddressRegistered(msg.sender, endpoint);
    }

    /// @notice Finds the endpoint if given a registered Ethereum address.
    /// @param eth_address A 20 byte Ethereum address.
    /// @return endpoint which the current Ethereum address is using.
    function findEndpointByAddress(address eth_address)
        public
        view
        returns (string endpoint)
    {
        return address_to_endpoint[eth_address];
    }

    /// @notice Checks if two strings are equal or not.
    /// @param a First string.
    /// @param b Second string.
    /// @return result True if `a` and `b` are equal, false otherwise.
    function equals(string a, string b) internal pure returns (bool result)
    {
        if (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b))) {
            return true;
        }

        return false;
    }
}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"eth_address","type":"address"}],"name":"findEndpointByAddress","outputs":[{"name":"endpoint","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"endpoint","type":"string"}],"name":"registerEndpoint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"contract_version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"eth_address","type":"address"},{"indexed":false,"name":"endpoint","type":"string"}],"name":"AddressRegistered","type":"event"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b506107e6806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063028a582e1461005c57806308b5a85a14610118578063b32c65c814610181575b600080fd5b34801561006857600080fd5b5061009d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610211565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100dd5780820151818401526020810190506100c2565b50505050905090810190601f16801561010a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561012457600080fd5b5061017f600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506102f1565b005b34801561018d57600080fd5b5061019661051a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d65780820151818401526020810190506101bb565b50505050905090810190601f1680156102035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102e55780601f106102ba576101008083540402835291602001916102e5565b820191906000526020600020905b8154815290600101906020018083116102c857829003601f168201915b50505050509050919050565b60008160011515610312826020604051908101604052806000815250610553565b15151415151561032157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209150610404828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103f95780601f106103ce576101008083540402835291602001916103f9565b820191906000526020600020905b8154815290600101906020018083116103dc57829003601f168201915b505050505084610553565b1561040e57610515565b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209080519060200190610460929190610715565b503373ffffffffffffffffffffffffffffffffffffffff167f3a62a9d7855df5303e50b0440124304fefafde7f677fc33787b784fc92cfa618846040518080602001828103825283818151815260200191508051906020019080838360005b838110156104da5780820151818401526020810190506104bf565b50505050905090810190601f1680156105075780820380516001836020036101000a031916815260200191505b509250505060405180910390a25b505050565b6040805190810160405280600581526020017f302e332e5f00000000000000000000000000000000000000000000000000000081525081565b6000816040516020018082805190602001908083835b60208310151561058e5780518252602082019150602081019050602083039250610569565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b6020831015156105f757805182526020820191506020810190506020830392506105d2565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916836040516020018082805190602001908083835b602083101515610661578051825260208201915060208101905060208303925061063c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b6020831015156106ca57805182526020820191506020810190506020830392506106a5565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141561070a576001905061070f565b600090505b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061075657805160ff1916838001178555610784565b82800160010185558215610784579182015b82811115610783578251825591602001919060010190610768565b5b5090506107919190610795565b5090565b6107b791905b808211156107b357600081600090555060010161079b565b5090565b905600a165627a7a7230582069ec25f25bf1912fa19df63a8aaa9716a47ca88f5a30f4e3d40e82b122eb85180029

   Swarm Source:
bzzr://69ec25f25bf1912fa19df63a8aaa9716a47ca88f5a30f4e3d40e82b122eb8518

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward