Sponsored Link:   Color - Revolutionizing the Dapp Ecosystem, Bounty & Airdrop, Get 240,000 COL NOW!
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 333 txns
 Latest 25 txns from a total Of 333 transactions

TxHash Age From To Value [TxFee]
0xd7bb0680e16299193829cd58875371fc5e5f4265ca05932d2b9343bfe64cd18f3 days 4 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x12b1f1abbbf2777042d10a04eb5919be611a3f7fd88faa07359caf6de4410cf13 days 4 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x6b36930da8b1145c497bd74be1c43f59ffa8c2dd153ae1fab6b7dd8104b4f10a3 days 13 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x08706200593dd3635c5f990d9c7024e7879e6e3aaa355f67529c8dea5b93711e4 days 1 hr ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x01b31e505a48ad54b6f3439e3f52151c5889b440d92b5ab87238db6c124c2af54 days 22 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x420c9575fbfe9a1c609b5972a63393e39d0919e262ea074d79d49affaf31b7734 days 22 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x439cb3933fb3f5268630670990148c95bfed3dbeffd4127daca21bd26c1d71ee4 days 22 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xd8e410f24935c5b3906235b4bd2fb7048b71822451d6f40335c3b9eebaa946624 days 22 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x8021c5d89eb1d91b0749f5302f500d47e68dffaf981af2dd9c33d661762c89804 days 23 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xf27815e129364e9570b0acb326ed4dd3a2c7e473a5fd1d75033938d992cb777b4 days 23 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xacd898c8219c41e157a72b15d7cbad47112c46cd14d960ac63c7fc33630ea5e54 days 23 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x0b63333427da9d34a67e84784f32ff7d95c329b0368586b3e13ef0060fca4dbf5 days 20 mins ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xac6ff172bfdcd1419b5a3c07f20b9025b3a51cd8f40c4e53aeab5b8629e61a4c5 days 29 mins ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xb7fb08bc77ba10d465b31333095eb7cb43af4e0cb0ac42098666561fd2fd229e5 days 42 mins ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x85cef28c0fbc999c8c9a12bb6189f77df0eff8c411501c47012176f78a5f9d545 days 1 hr ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x0a9641e238a38846dae42b600c951c70fac1cb3c8c8d1e73baa0944ad4c1619d5 days 4 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xea72fff88007303318f55b01ccb8aa41306823b217801abaff65d1c784185a2b5 days 7 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x37442ed7e2f15c6121e15b7dffc5e842f5b7e14df5f0a832cd60a8fdb023c43b5 days 13 hrs ago0x082e340ff81e5594199ef19d5219fa09f14638a1  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.000205164
0x14cdd91eadfdc4c9ed4023b00e855ae6f00bd0c3fada51d4b62b7393db65193f5 days 13 hrs ago0x082e340ff81e5594199ef19d5219fa09f14638a1  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.000102584
0xe5f0dc07070caf8cd5abadfca0c911fef2cda0934cff0bd6c7fb63ca6fc704cf6 days 1 hr ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xb715ad1f0438f7fb96c11e781a8ab88f0a9cd460d712ce42672ce38ec8f7ba596 days 2 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0xc0cb98bc3f19200365fe5a91a83746447b985acbca210acc06c2a639c39c310b6 days 4 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x644a32868082ca218a8032ab3f165f5fff4261d4f64276b04cee210a5abd849f6 days 6 hrs ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00069981
0x8ab45d1c9bfb026b2a59dcfaa895dc4dff9e84c98c59735055e206db43e6501e7 days 51 mins ago0x65b3fc64f7d2957d480d1e6a7abbba0dbf5b4ce0  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00025646
0x9fe9ca35fdbea49d98824c641af607c307c2f59f56e92781da7b78c3f2ef5a7c7 days 54 mins ago0xd71b3542b3ec31a7f8c881980d8cb8c09b9310f4  IN   0x75d884981d814d676b4b6930038ee9887129b6390 Ether0.00025646
[ 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: Connections
Compiler Version: v0.4.19+commit.c4cbbb05
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity 0.4.19;


contract IConnections {
    // Forward = the connection is from the Connection creator to the specified recipient
    // Backwards = the connection is from the specified recipient to the Connection creator
    enum Direction {NotApplicable, Forwards, Backwards, Invalid}
    function createUser() external returns (address entityAddress);
    function createUserAndConnection(address _connectionTo, bytes32 _connectionType, Direction _direction) external returns (address entityAddress);
    function createVirtualEntity() external returns (address entityAddress);
    function createVirtualEntityAndConnection(address _connectionTo, bytes32 _connectionType, Direction _direction) external returns (address entityAddress);
    function editEntity(address _entity, bool _active, bytes32 _data) external;
    function transferEntityOwnerPush(address _entity, address _newOwner) external;
    function transferEntityOwnerPull(address _entity) external;
    function addConnection(address _entity, address _connectionTo, bytes32 _connectionType, Direction _direction) public;
    function editConnection(address _entity, address _connectionTo, bytes32 _connectionType, Direction _direction, bool _active, bytes32 _data, uint _expiration) external;
    function removeConnection(address _entity, address _connectionTo, bytes32 _connectionType) external;
    function isUser(address _entity) view public returns (bool isUserEntity);
    function getEntity(address _entity) view external returns (bool active, address transferOwnerTo, bytes32 data, address owner);
    function getConnection(address _entity, address _connectionTo, bytes32 _connectionType) view external returns (bool entityActive, bool connectionEntityActive, bool connectionActive, bytes32 data, Direction direction, uint expiration);

    // ################## Events ################## //
    event entityAdded(address indexed entity, address indexed owner);
    event entityModified(address indexed entity, address indexed owner, bool indexed active, bytes32 data);
    event entityOwnerChangeRequested(address indexed entity, address indexed oldOwner, address newOwner);
    event entityOwnerChanged(address indexed entity, address indexed oldOwner, address newOwner);
    event connectionAdded(address indexed entity, address indexed connectionTo, bytes32 connectionType, Direction direction);
    event connectionModified(address indexed entity, address indexed connectionTo, bytes32 indexed connectionType, Direction direction, bool active, uint expiration);
    event connectionRemoved(address indexed entity, address indexed connectionTo, bytes32 indexed connectionType);
    event entityResolved(address indexed entityRequested, address indexed entityResolved);    
}


/**
 * @title Connections v0.2
 * @dev The Connections contract records different connections between different types of entities.
 *
 * The contract has been designed for flexibility and scalability for use by anyone wishing to record different types of connections.
 *
 * Entities can be Users representing People, or Virtual Entities representing abstract types such as companies, objects, devices, robots etc...
 * User entities are special: each Ethereum address that creates or controls a User entity can only ever create one User Entity.
 * Each entity has an address to refer to it.
 *
 * Each entity has a number of connections to other entities, which are refered to using the entities address that the connection is to.
 * Modifying or removing entities, or adding, modifying or removing connections can only be done by the entity owner.
 *
 * Each connection also has a type, a direction and an expiration. The use of these fields is up to the Dapp to define and interprete.
 * Hashing a string of the connection name to create the connection type is suggested to obscure and diffuse types. Example bytes32 connection types:
 *     0x30ed9383ab64b27cb4b70035e743294fe1a1c83eaf57eca05033b523d1fa4261 = keccak256("isAdvisorOf")
 *     0xffe72ffb7d5cc4224f27ea8ad324f4b53b37835a76fc2b627b3d669180b75ecc = keccak256("isPartneredWith")
 *     0xa64b51178a7ee9735fb96d8e7ffdebb455b02beb3b1e17a709b5c1beef797405 = keccak256("isEmployeeOf")
 *     0x0079ca0c877589ba53b2e415a660827390d2c2a62123cef473009d003577b7f6 = keccak256("isColleagueOf")
 *
 */
contract Connections is IConnections {

    struct Entity {
        bool active;
        address transferOwnerTo;
        address owner;
        bytes32 data; // optional, this can link to IPFS or another off-chain storage location
        mapping (address => mapping (bytes32 => Connection)) connections;
    }

    // Connection has a type and direction
    struct Connection {
        bool active;
        bytes32 data; // optional, this can link to IPFS or another off-chain storage location
        Direction direction;
        uint expiration; // optional, unix timestamp or latest date to assume this connection is valid, 0 as no expiration
    }

    mapping (address => Entity) public entities;
    mapping (address => address) public entityOfUser;
    uint256 public virtualEntitiesCreated = 0;

    // ################## Constructor and Fallback function ################## //
    /**
     * Constructor
     */
    function Connections() public {}

    /**
     * Fallback function that cannot be called and will not accept Ether
     * Note that Ether can still be forced to this contract with a contract suicide()
     */
    function () external {
        revert();
    }


    // ################## External function ################## //
    /**
     * Creates a new user entity with an address of the msg.sender
     */
    function createUser() external returns (address entityAddress) {
        entityAddress = msg.sender;
        assert(entityOfUser[msg.sender] == address(0));
        createEntity(entityAddress, msg.sender);
        entityOfUser[msg.sender] = entityAddress;
    }

    /**
     * Creates a new user entity and a connection in one transaction
     * @param _connectionTo - the address of the entity to connect to
     * @param _connectionType - hash of the connection type
     * @param _direction - indicates the direction of the connection type
     */
    function createUserAndConnection(
        address _connectionTo,
        bytes32 _connectionType,
        Direction _direction
    )
        external returns (address entityAddress)
    {
        entityAddress = msg.sender;
        assert(entityOfUser[msg.sender] == address(0));
        createEntity(entityAddress, msg.sender);
        entityOfUser[msg.sender] = entityAddress;
        addConnection(entityAddress, _connectionTo, _connectionType, _direction);
    }

    /**
     * Creates a new virtual entity that is assigned to a unique address
     */
    function createVirtualEntity() external returns (address entityAddress) {
        entityAddress = createVirtualAddress();
        createEntity(entityAddress, msg.sender);
    }

    /**
     * Creates a new virtual entity and a connection in one transaction
     * @param _connectionTo - the address of the entity to connect to
     * @param _connectionType - hash of the connection type
     * @param _direction - indicates the direction of the connection type
     */
    function createVirtualEntityAndConnection(
        address _connectionTo,
        bytes32 _connectionType,
        Direction _direction
    )
        external returns (address entityAddress)
    {
        entityAddress = createVirtualAddress();
        createEntity(entityAddress, msg.sender);
        addConnection(entityAddress, _connectionTo, _connectionType, _direction);
    }

    /**
     * Edits data or active boolean of an entity that the msg sender is an owner of
     * This can be used to activate or deactivate an entity
     * @param _entity - the address of the entity to edit
     * @param _active - boolean to indicate if the entity is active or not
     * @param _data - data to be used to locate off-chain information about the user
     */
    function editEntity(address _entity, bool _active, bytes32 _data) external {
        address resolvedEntity = resolveEntityAddressAndOwner(_entity);
        Entity storage entity = entities[resolvedEntity];
        entity.active = _active;
        entity.data = _data;
        entityModified(_entity, msg.sender, _active, _data);
    }

    /**
     * Creates a request to transfer the ownership of an entity which must be accepted.
     * To cancel a request execute this function with _newOwner = address(0)
     * @param _entity - the address of the entity to transfer
     * @param _newOwner - the address of the new owner that will then have the exclusive permissions to control the entity
     */
    function transferEntityOwnerPush(address _entity, address _newOwner) external {
        address resolvedEntity = resolveEntityAddressAndOwner(_entity);
        entities[resolvedEntity].transferOwnerTo = _newOwner;
        entityOwnerChangeRequested(_entity, msg.sender, _newOwner);
    }

    /**
     * Accepts a request to transfer the ownership of an entity
     * @param _entity - the address of the entity to get ownership of
     */
    function transferEntityOwnerPull(address _entity) external {
        address resolvedEntity = resolveEntityAddress(_entity);
        emitEntityResolution(_entity, resolvedEntity);
        Entity storage entity = entities[resolvedEntity];
        require(entity.transferOwnerTo == msg.sender);
        if (isUser(resolvedEntity)) { // This is a user entity
            assert(entityOfUser[msg.sender] == address(0) ||
                   entityOfUser[msg.sender] == resolvedEntity);
            entityOfUser[msg.sender] = resolvedEntity;
        }
        address oldOwner = entity.owner;
        entity.owner = entity.transferOwnerTo;
        entity.transferOwnerTo = address(0);
        entityOwnerChanged(_entity, oldOwner, msg.sender);
    }

    /**
     * Edits a connection to another entity
     * @param _entity - the address of the entity to edit the connection of
     * @param _connectionTo - the address of the entity to connect to
     * @param _connectionType - hash of the connection type
     * @param _active - boolean to indicate if the connection is active or not
     * @param _direction - indicates the direction of the connection type
     * @param _expiration - number to indicate the expiration of the connection
     */
    function editConnection(
        address _entity,
        address _connectionTo,
        bytes32 _connectionType,
        Direction _direction,
        bool _active,
        bytes32 _data,
        uint _expiration
    )
        external
    {
        address resolvedEntity = resolveEntityAddressAndOwner(_entity);
        address resolvedConnectionEntity = resolveEntityAddress(_connectionTo);
        emitEntityResolution(_connectionTo, resolvedConnectionEntity);
        Entity storage entity = entities[resolvedEntity];
        Connection storage connection = entity.connections[resolvedConnectionEntity][_connectionType];
        connection.active = _active;
        connection.direction = _direction;
        connection.data = _data;
        connection.expiration = _expiration;
        connectionModified(_entity, _connectionTo, _connectionType, _direction, _active, _expiration);
    }

    /**
     * Removes a connection from the entities connections mapping.
     * If this is the last connection of any type to the _connectionTo address, then the removeConnection function should also be called to clean up the Entity
     * @param _entity - the address of the entity to edit the connection of
     * @param _connectionTo - the address of the entity to connect to
     * @param _connectionType - hash of the connection type
     */
    function removeConnection(address _entity, address _connectionTo, bytes32 _connectionType) external {
        address resolvedEntity = resolveEntityAddressAndOwner(_entity);
        address resolvedConnectionEntity = resolveEntityAddress(_connectionTo);
        emitEntityResolution(_connectionTo,resolvedConnectionEntity);
        Entity storage entity = entities[resolvedEntity];
        delete entity.connections[resolvedConnectionEntity][_connectionType];
        connectionRemoved(_entity, _connectionTo, _connectionType); // TBD: @haresh should we use resolvedEntity and resolvedConnectionEntity here?
    }

    /**
     * Returns the sha256 hash of a string. Useful for looking up the bytes32 values are for connection types.
     * Note this function is designed to be called off-chain for convenience, it is not used by any functions internally and does not change contract state
     * @param _string - string to hash
     * @return result - the hash of the string
     */
    function sha256ofString(string _string) external pure returns (bytes32 result) {
        result = keccak256(_string);
    }

    /**
     * Returns all the fields of an entity
     * @param _entity - the address of the entity to retrieve
     * @return (active, transferOwnerTo, data, owner) - a tuple containing the active flag, transfer status, data field and owner of an entity
     */
    function getEntity(address _entity) view external returns (bool active, address transferOwnerTo, bytes32 data, address owner) {
        address resolvedEntity = resolveEntityAddress(_entity);
        Entity storage entity = entities[resolvedEntity];
        return (entity.active, entity.transferOwnerTo, entity.data, entity.owner);
    }

    /**
     * Returns details of a connection
     * @param _entity - the address of the entity which created the
     * @return (entityActive, connectionEntityActive, connectionActive, data, direction, expiration)
     *                - tupple containing the entity active and the connection fields
     */
    function getConnection(
        address _entity,
        address _connectionTo,
        bytes32 _connectionType
    )
        view external returns (
            bool entityActive,
            bool connectionEntityActive,
            bool connectionActive,
            bytes32 data,
            Direction direction,
            uint expiration
    ){
        address resolvedEntity = resolveEntityAddress(_entity);
        address resolvedConnectionEntity = resolveEntityAddress(_connectionTo);
        Entity storage entity = entities[resolvedEntity];
        Connection storage connection = entity.connections[resolvedConnectionEntity][_connectionType];
        return (entity.active, entities[resolvedConnectionEntity].active, connection.active, connection.data, connection.direction, connection.expiration);
    }


    // ################## Public function ################## //
    /**
     * Creates a new connection to another entity
     * @param _entity - the address of the entity to add a connection to
     * @param _connectionTo - the address of the entity to connect to
     * @param _connectionType - hash of the connection type
     * @param _direction - indicates the direction of the connection type
     */
    function addConnection(
        address _entity,
        address _connectionTo,
        bytes32 _connectionType,
        Direction _direction
    )
        public
    {
        address resolvedEntity = resolveEntityAddressAndOwner(_entity);
        address resolvedEntityConnection = resolveEntityAddress(_connectionTo);
        emitEntityResolution(_connectionTo, resolvedEntityConnection);
        Entity storage entity = entities[resolvedEntity];
        assert(!entity.connections[resolvedEntityConnection][_connectionType].active);
        Connection storage connection = entity.connections[resolvedEntityConnection][_connectionType];
        connection.active = true;
        connection.direction = _direction;
        connectionAdded(_entity, _connectionTo, _connectionType, _direction);
    }

    /**
     * Returns true if an entity is a user, false if a virtual entity or fails if is not an entity
     * @param _entity - the address of the entity
     * @return isUserEntity - true if the entity was created with createUser(), false if the entity is created using createVirtualEntity()
     */
    function isUser(address _entity) view public returns (bool isUserEntity) {
        address resolvedEntity = resolveEntityAddress(_entity);
        assert(entities[resolvedEntity].active); // Make sure the user is active, otherwise this function call is invalid
        address owner = entities[resolvedEntity].owner;
        isUserEntity = (resolvedEntity == entityOfUser[owner]);
    }


    // ################## Internal functions ################## //
    /**
     * Creates a new entity at a specified address
     */
    function createEntity(address _entityAddress, address _owner) internal {
        require(!entities[_entityAddress].active); // Ensure the new entity address is not in use, prevents forceful takeover off addresses
        Entity storage entity = entities[_entityAddress];
        entity.active = true;
        entity.owner = _owner;
        entityAdded(_entityAddress, _owner);
    }

    /**
     * Returns a new unique deterministic address that has not been used before
     */
    function createVirtualAddress() internal returns (address virtualAddress) {
        virtualAddress = address(keccak256(safeAdd(virtualEntitiesCreated,block.number)));
        virtualEntitiesCreated = safeAdd(virtualEntitiesCreated,1);
    }

    /**
     * Emits an event if an entity resolution took place. Separated out as it would impact
     * view only functions which need entity resolution as well.
     */
    function emitEntityResolution(address _entity, address _resolvedEntity) internal {
        if (_entity != _resolvedEntity)
            entityResolved(_entity,_resolvedEntity);
    }

    /**
     * Returns the correct entity address resolved based on entityOfUser mapping
     */
    function resolveEntityAddress(address _entityAddress) internal view returns (address resolvedAddress) {
        if (entityOfUser[_entityAddress] != address(0) && entityOfUser[_entityAddress] != _entityAddress) {
            resolvedAddress = entityOfUser[_entityAddress];
        } else {
            resolvedAddress = _entityAddress;
        }
    }

    /**
     * Returns the correct entity address resolved based on entityOfUser mapping and also reverts if the
     * resolved if it is owned by the message sender
     * sender.
     */
    function resolveEntityAddressAndOwner(address _entityAddress) internal returns (address entityAddress) {
        entityAddress = resolveEntityAddress(_entityAddress);
        emitEntityResolution(_entityAddress, entityAddress);
        require(entities[entityAddress].owner == msg.sender);
    }

    /**
     * Adds two numbers and returns result throws in case an overflow occurs.
     */
    function safeAdd(uint256 x, uint256 y) internal pure returns(uint256) {
      uint256 z = x + y;
      assert(z >= x);
      return z;
    }    

}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"entityOfUser","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_entity","type":"address"},{"name":"_connectionTo","type":"address"},{"name":"_connectionType","type":"bytes32"},{"name":"_direction","type":"uint8"},{"name":"_active","type":"bool"},{"name":"_data","type":"bytes32"},{"name":"_expiration","type":"uint256"}],"name":"editConnection","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_entity","type":"address"},{"name":"_active","type":"bool"},{"name":"_data","type":"bytes32"}],"name":"editEntity","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"entities","outputs":[{"name":"active","type":"bool"},{"name":"transferOwnerTo","type":"address"},{"name":"owner","type":"address"},{"name":"data","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"createUser","outputs":[{"name":"entityAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_entity","type":"address"},{"name":"_newOwner","type":"address"}],"name":"transferEntityOwnerPush","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_entity","type":"address"}],"name":"isUser","outputs":[{"name":"isUserEntity","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_string","type":"string"}],"name":"sha256ofString","outputs":[{"name":"result","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"createVirtualEntity","outputs":[{"name":"entityAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_entity","type":"address"}],"name":"transferEntityOwnerPull","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_entity","type":"address"}],"name":"getEntity","outputs":[{"name":"active","type":"bool"},{"name":"transferOwnerTo","type":"address"},{"name":"data","type":"bytes32"},{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_entity","type":"address"},{"name":"_connectionTo","type":"address"},{"name":"_connectionType","type":"bytes32"}],"name":"getConnection","outputs":[{"name":"entityActive","type":"bool"},{"name":"connectionEntityActive","type":"bool"},{"name":"connectionActive","type":"bool"},{"name":"data","type":"bytes32"},{"name":"direction","type":"uint8"},{"name":"expiration","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"virtualEntitiesCreated","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_entity","type":"address"},{"name":"_connectionTo","type":"address"},{"name":"_connectionType","type":"bytes32"}],"name":"removeConnection","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_entity","type":"address"},{"name":"_connectionTo","type":"address"},{"name":"_connectionType","type":"bytes32"},{"name":"_direction","type":"uint8"}],"name":"addConnection","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_connectionTo","type":"address"},{"name":"_connectionType","type":"bytes32"},{"name":"_direction","type":"uint8"}],"name":"createUserAndConnection","outputs":[{"name":"entityAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_connectionTo","type":"address"},{"name":"_connectionType","type":"bytes32"},{"name":"_direction","type":"uint8"}],"name":"createVirtualEntityAndConnection","outputs":[{"name":"entityAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entity","type":"address"},{"indexed":true,"name":"owner","type":"address"}],"name":"entityAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entity","type":"address"},{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"active","type":"bool"},{"indexed":false,"name":"data","type":"bytes32"}],"name":"entityModified","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entity","type":"address"},{"indexed":true,"name":"oldOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"entityOwnerChangeRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entity","type":"address"},{"indexed":true,"name":"oldOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"entityOwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entity","type":"address"},{"indexed":true,"name":"connectionTo","type":"address"},{"indexed":false,"name":"connectionType","type":"bytes32"},{"indexed":false,"name":"direction","type":"uint8"}],"name":"connectionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entity","type":"address"},{"indexed":true,"name":"connectionTo","type":"address"},{"indexed":true,"name":"connectionType","type":"bytes32"},{"indexed":false,"name":"direction","type":"uint8"},{"indexed":false,"name":"active","type":"bool"},{"indexed":false,"name":"expiration","type":"uint256"}],"name":"connectionModified","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entity","type":"address"},{"indexed":true,"name":"connectionTo","type":"address"},{"indexed":true,"name":"connectionType","type":"bytes32"}],"name":"connectionRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"entityRequested","type":"address"},{"indexed":true,"name":"entityResolved","type":"address"}],"name":"entityResolved","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60606040526000600255341561001457600080fd5b611f81806100236000396000f3006060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a9c29c5146101015780630aa4c8891461017a5780631d0192e11461020c5780631d8ee48a1461025d57806325ad91ce1461032357806339ea68ba146103785780634209fff1146103d057806366ae70e914610421578063693e26dd1461046b5780636f5da961146104c057806375894e8c146104f95780637858651e146105bf578063a6044f281461067d578063c173508b146106a6578063cf66785e1461070b578063d2d134731461077c578063e87b32661461080e575b34156100fc57600080fd5b600080fd5b341561010c57600080fd5b610138600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108a0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561018557600080fd5b61020a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356000191690602001909190803560ff169060200190919080351515906020019091908035600019169060200190919080359060200190919050506108d3565b005b341561021757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035151590602001909190803560001916906020019091905050610a85565b005b341561026857600080fd5b610294600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b73565b60405180851515151581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826000191660001916815260200194505050505060405180910390f35b341561032e57600080fd5b610336610bf0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038357600080fd5b6103ce600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d17565b005b34156103db57600080fd5b610407600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e3a565b604051808215151515815260200191505060405180910390f35b341561042c57600080fd5b61044d60048080359060200190820180359060200191909192905050610f9c565b60405180826000191660001916815260200191505060405180910390f35b341561047657600080fd5b61047e610fc3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104cb57600080fd5b6104f7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fdc565b005b341561050457600080fd5b610530600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113b6565b60405180851515151581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390f35b34156105ca57600080fd5b610622600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356000191690602001909190505061147c565b60405180871515151581526020018615151515815260200185151515158152602001846000191660001916815260200183600381111561065e57fe5b60ff168152602001828152602001965050505050505060405180910390f35b341561068857600080fd5b6106906115e8565b6040518082815260200191505060405180910390f35b34156106b157600080fd5b610709600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035600019169060200190919050506115ee565b005b341561071657600080fd5b61077a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356000191690602001909190803560ff1690602001909190505061174f565b005b341561078757600080fd5b6107cc600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356000191690602001909190803560ff16906020019091905050611954565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561081957600080fd5b61085e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356000191690602001909190803560ff16906020019091905050611a8b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806108e28b611ab4565b93506108ed8a611b6b565b92506108f98a84611d08565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a600019166000191681526020019081526020016000209050868160000160006101000a81548160ff021916908315150217905550878160020160006101000a81548160ff021916908360038111156109d157fe5b02179055508581600101816000191690555084816003018190555088600019168a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167fc601f34497cd366cb21f7c70b02d1fdb924c28dc92447c12ce320013a9bc207c8b8b8a60405180846003811115610a5357fe5b60ff16815260200183151515158152602001828152602001935050505060405180910390a45050505050505050505050565b600080610a9185611ab4565b91506000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050838160000160006101000a81548160ff021916908315150217905550828160020181600019169055508315153373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fb4a44f49e7689d5d2cbcf64d78c6dc65de2300e3fc8192e134093dd9616615e28660405180826000191660001916815260200191505060405180910390a45050505050565b60006020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154905084565b6000339050600073ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610c8c57fe5b610c968133611d9c565b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090565b6000610d2283611ab4565b9050816000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f586001067cfd3cac9ff78f1fcea08b2a4df6297c24cb4fbcce33d58d18ed161084604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a3505050565b6000806000610e4884611b6b565b91506000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515610ea157fe5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161492505050919050565b60008282604051808383808284378201915050925050506040518091039020905092915050565b6000610fcd611ef8565b9050610fd98133611d9c565b90565b6000806000610fea84611b6b565b9250610ff68484611d08565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091503373ffffffffffffffffffffffffffffffffffffffff168260000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561109457600080fd5b61109d83610e3a565b1561124d57600073ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111c657508273ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15156111ce57fe5b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008260000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fa84707ed1a20537aa3545a97567a462fab29774dfcabf7c1337352c5099fb8ae33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a350505050565b6000806000806000806113c887611b6b565b91506000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000160009054906101000a900460ff168160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600201548360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16955095509550955050509193509193565b6000806000806000806000806000806114948d611b6b565b935061149f8c611b6b565b92506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c6000191660001916815260200190815260200160002090508160000160009054906101000a900460ff166000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff168260000160009054906101000a900460ff1683600101548460020160009054906101000a900460ff1685600301549950995099509950995099505050505093975093979195509350565b60025481565b60008060006115fc86611ab4565b925061160785611b6b565b91506116138583611d08565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008560001916600019168152602001908152602001600020600080820160006101000a81549060ff021916905560018201600090556002820160006101000a81549060ff02191690556003820160009055505083600019168573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f4b238bcbf7cb21a3e4744d42aed7c0fae81b61207320ff3f547e542497e3120d60405160405180910390a4505050505050565b60008060008061175e88611ab4565b935061176987611b6b565b92506117758784611d08565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000876000191660001916815260200190815260200160002060000160009054906101000a900460ff1615151561182957fe5b8160030160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008760001916600019168152602001908152602001600020905060018160000160006101000a81548160ff021916908315150217905550848160020160006101000a81548160ff021916908360038111156118c257fe5b02179055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f356e8b58ffa49eb58d48aa756231b01699dec71eb273a61c1ee94f1887a7c76c888860405180836000191660001916815260200182600381111561193657fe5b60ff1681526020019250505060405180910390a35050505050505050565b6000339050600073ffffffffffffffffffffffffffffffffffffffff16600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156119f057fe5b6119fa8133611d9c565b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a848185858561174f565b9392505050565b6000611a95611ef8565b9050611aa18133611d9c565b611aad8185858561174f565b9392505050565b6000611abf82611b6b565b9050611acb8282611d08565b3373ffffffffffffffffffffffffffffffffffffffff166000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611b6657600080fd5b919050565b60008073ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015611c9357508173ffffffffffffffffffffffffffffffffffffffff16600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b15611cff57600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050611d03565b8190505b919050565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515611d98578073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f15687d9854ff02176ac79b483777770fb54b5a7350d9c33edf8b4762f9c2ebdf60405160405180910390a35b5050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16151515611df957600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060018160000160006101000a81548160ff021916908315150217905550818160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fbbb1598dca83166487facc52f9481f629b31e41e8f4d530378c58e86b05e843b60405160405180910390a3505050565b6000611f0660025443611f37565b604051808281526020019150506040518091039020600190049050611f2e6002546001611f37565b60028190555090565b6000808284019050838110151515611f4b57fe5b80915050929150505600a165627a7a7230582095b5964310a4a8cc53a2672d8f9c39508a6d2b9c274991668b14557fd57e12930029

   Swarm Source:
bzzr://95b5964310a4a8cc53a2672d8f9c39508a6d2b9c274991668b14557fd57e1293

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.