pragma solidity ^0.4.24; import "./Pausable.sol"; import "./ReclaimTokens.sol"; /** * @title Core functionality for registry upgradability */ contract PolymathRegistry is ReclaimTokens { mapping (bytes32 => address) public storedAddresses; event LogChangeAddress(string _nameKey, address indexed _oldAddress, address indexed _newAddress); /** * @notice Get the contract address * @param _nameKey is the key for the contract address mapping * @return address */ function getAddress(string _nameKey) view public returns(address) { bytes32 key = keccak256(bytes(_nameKey)); require(storedAddresses[key] != address(0), "Invalid address key"); return storedAddresses[key]; } /** * @notice change the contract address * @param _nameKey is the key for the contract address mapping * @param _newAddress is the new contract address */ function changeAddress(string _nameKey, address _newAddress) public onlyOwner { bytes32 key = keccak256(bytes(_nameKey)); emit LogChangeAddress(_nameKey, storedAddresses[key], _newAddress); storedAddresses[key] = _newAddress; } }