Skip to content
Verified contractPartial

PersonaRegistry

Address0x8b5429bdf4e24f508154aa864675a007e618e79e
Balance

0 ETH

 

Transactions

15

 

Compiler

solc 0.1.6

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.6+commit.d41f8b7c
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
410,348
Creation transaction
0x362ccf0261…2f22a2be0b

PersonaRegistry.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Persona {
    function owner() returns (address);
}

contract PersonaRegistry {
    mapping (address => address) public idLookup;
    address[] public idList;
    uint public version;

    function PersonaRegistry() {
        version = 0;
        idList.length = 0;
    }

    function registerPersona(address id) {
        Persona p = Persona(id);
        address owner = p.owner();
        if (owner == msg.sender) {
            if (idLookup[owner] == 0) {
                idList.length++;
                idList[idList.length - 1] = owner;
            }
            idLookup[owner] = id;
        }
    }

    function removePersona() {
        address id;
        if (idLookup[msg.sender] != 0) {
            id = idLookup[msg.sender];
            idLookup[msg.sender] = 0;
        }
        for (uint i = 0; i < idList.length; i++) {
            if (idList[i] == msg.sender) {
                idList[i] = idList[idList.length - 1];
                idList.length--;
            }
        }
    }

    function getIdList() returns (address[]) {
        return idList;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.