Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
AccountRegistry
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2018-08-19 */ pragma solidity 0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface AccountRegistryInterface { function accountIdForAddress(address _address) public view returns (uint256); function addressBelongsToAccount(address _address) public view returns (bool); function createNewAccount(address _newUser) external; function addAddressToAccount( address _newAddress, address _sender ) external; function removeAddressFromAccount(address _addressToRemove) external; } /** * @title Bloom account registry * @notice Account Registry implements the Bloom ID data structures * and the low-level account administration functions. * The account administration functions are not publicly accessible. * Account Registry Logic implements the public functions which access the functions in Account Registry. */ contract AccountRegistry is Ownable, AccountRegistryInterface{ address public accountRegistryLogic; /** * @notice The AccountRegistry constructor configures the account registry logic implementation * and creates an account for the user who deployed the contract. * @dev The owner is also set as the original registryAdmin, who has the privilege to * create accounts outside of the normal invitation flow. * @param _accountRegistryLogic Address of deployed Account Registry Logic implementation */ constructor( address _accountRegistryLogic ) public { accountRegistryLogic = _accountRegistryLogic; } event AccountRegistryLogicChanged(address oldRegistryLogic, address newRegistryLogic); /** * @dev Zero address not allowed */ modifier nonZero(address _address) { require(_address != 0); _; } modifier onlyAccountRegistryLogic() { require(msg.sender == accountRegistryLogic); _; } // Counter to generate unique account Ids uint256 numAccounts; mapping(address => uint256) public accountByAddress; /** * @notice Change the address of the registry logic which has exclusive write control over this contract * @dev Restricted to AccountRegistry owner and new admin address cannot be 0x0 * @param _newRegistryLogic Address of new registry logic implementation */ function setRegistryLogic(address _newRegistryLogic) public onlyOwner nonZero(_newRegistryLogic) { address _oldRegistryLogic = accountRegistryLogic; accountRegistryLogic = _newRegistryLogic; emit AccountRegistryLogicChanged(_oldRegistryLogic, accountRegistryLogic); } /** * @notice Retreive account ID associated with a user's address * @param _address Address to look up * @return account id as uint256 if exists, otherwise reverts */ function accountIdForAddress(address _address) public view returns (uint256) { require(addressBelongsToAccount(_address)); return accountByAddress[_address]; } /** * @notice Check if an address is associated with any user account * @dev Check if address is associated with any user by cross validating * the accountByAddress with addressByAccount * @param _address Address to check * @return true if address has been assigned to user. otherwise reverts */ function addressBelongsToAccount(address _address) public view returns (bool) { return accountByAddress[_address] > 0; } /** * @notice Create an account for a user and emit an event * @param _newUser Address of the new user */ function createNewAccount(address _newUser) external onlyAccountRegistryLogic nonZero(_newUser) { require(!addressBelongsToAccount(_newUser)); numAccounts++; accountByAddress[_newUser] = numAccounts; } /** * @notice Add an address to an existing id * @param _newAddress Address to add to account * @param _sender User requesting this action */ function addAddressToAccount( address _newAddress, address _sender ) external onlyAccountRegistryLogic nonZero(_newAddress) { // check if address belongs to someone else require(!addressBelongsToAccount(_newAddress)); accountByAddress[_newAddress] = accountIdForAddress(_sender); } /** * @notice Remove an address from an id * @param _addressToRemove Address to remove from account */ function removeAddressFromAccount( address _addressToRemove ) external onlyAccountRegistryLogic { delete accountByAddress[_addressToRemove]; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"addressBelongsToAccount","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newRegistryLogic","type":"address"}],"name":"setRegistryLogic","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"accountIdForAddress","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newAddress","type":"address"},{"name":"_sender","type":"address"}],"name":"addAddressToAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newUser","type":"address"}],"name":"createNewAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"accountRegistryLogic","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_addressToRemove","type":"address"}],"name":"removeAddressFromAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"accountByAddress","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_accountRegistryLogic","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldRegistryLogic","type":"address"},{"indexed":false,"name":"newRegistryLogic","type":"address"}],"name":"AccountRegistryLogicChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051602080610b4683398101806040528101908080519060200190929190505050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610a82806100c46000396000f3006080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063178daa54146100a957806319354750146101045780631a5b70ad14610147578063275bf2301461019e5780634f96baf114610201578063568531cc146102445780638a5a86621461029b5780638da5cb5b146102de578063a62586dd14610335578063f2fde38b1461038c575b600080fd5b3480156100b557600080fd5b506100ea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103cf565b604051808215151515815260200191505060405180910390f35b34801561011057600080fd5b50610145600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061041a565b005b34801561015357600080fd5b50610188600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105c2565b6040518082815260200191505060405180910390f35b3480156101aa57600080fd5b506101ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061061f565b005b34801561020d57600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610708565b005b34801561025057600080fd5b506102596107fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102a757600080fd5b506102dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610822565b005b3480156102ea57600080fd5b506102f36108c4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034157600080fd5b50610376600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e9565b6040518082815260200191505060405180910390f35b34801561039857600080fd5b506103cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610901565b005b600080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561047757600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415151561049e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f65b53e3f816e3ffd9aac808fbd21feec8a35ff24e6e6e2ae80168e82e2e6526f82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1505050565b60006105cd826103cf565b15156105d857600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561067b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff16141515156106a257600080fd5b6106ab836103cf565b1515156106b757600080fd5b6106c0826105c2565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561076457600080fd5b8060008173ffffffffffffffffffffffffffffffffffffffff161415151561078b57600080fd5b610794826103cf565b1515156107a057600080fd5b600260008154809291906001019190505550600254600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561087e57600080fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561095c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561099857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820c32c1caa4cc2f6164c1500fec782923d1772e3c93a402dc96bee7fc39ca464dc00290000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063178daa54146100a957806319354750146101045780631a5b70ad14610147578063275bf2301461019e5780634f96baf114610201578063568531cc146102445780638a5a86621461029b5780638da5cb5b146102de578063a62586dd14610335578063f2fde38b1461038c575b600080fd5b3480156100b557600080fd5b506100ea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103cf565b604051808215151515815260200191505060405180910390f35b34801561011057600080fd5b50610145600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061041a565b005b34801561015357600080fd5b50610188600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105c2565b6040518082815260200191505060405180910390f35b3480156101aa57600080fd5b506101ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061061f565b005b34801561020d57600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610708565b005b34801561025057600080fd5b506102596107fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102a757600080fd5b506102dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610822565b005b3480156102ea57600080fd5b506102f36108c4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034157600080fd5b50610376600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e9565b6040518082815260200191505060405180910390f35b34801561039857600080fd5b506103cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610901565b005b600080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054119050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561047757600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415151561049e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f65b53e3f816e3ffd9aac808fbd21feec8a35ff24e6e6e2ae80168e82e2e6526f82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1505050565b60006105cd826103cf565b15156105d857600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561067b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff16141515156106a257600080fd5b6106ab836103cf565b1515156106b757600080fd5b6106c0826105c2565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561076457600080fd5b8060008173ffffffffffffffffffffffffffffffffffffffff161415151561078b57600080fd5b610794826103cf565b1515156107a057600080fd5b600260008154809291906001019190505550600254600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561087e57600080fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561095c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561099857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820c32c1caa4cc2f6164c1500fec782923d1772e3c93a402dc96bee7fc39ca464dc0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _accountRegistryLogic (address): 0x0000000000000000000000000000000000000000
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Swarm Source
bzzr://c32c1caa4cc2f6164c1500fec782923d1772e3c93a402dc96bee7fc39ca464dc
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.