mirror of
git://holbrook.no/eth-contract-registry
synced 2026-05-24 20:26:18 +02:00
Add event for address added
This commit is contained in:
@@ -18,6 +18,9 @@ contract ContractRegistry {
|
||||
// Implements ERC173
|
||||
event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner);
|
||||
|
||||
// Implements Registry
|
||||
event AddressKey(bytes32 indexed _key, address _address);
|
||||
|
||||
constructor(bytes32[] memory _identifiers) {
|
||||
owner = msg.sender;
|
||||
for (uint i = 0; i < _identifiers.length; i++) {
|
||||
@@ -25,7 +28,7 @@ contract ContractRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
// Irrevocably set a contract registry value
|
||||
// Implements Registry
|
||||
function set(bytes32 _identifier, address _address) public returns (bool) {
|
||||
require(msg.sender == owner);
|
||||
require(entries[_identifier] == address(0));
|
||||
@@ -40,6 +43,9 @@ contract ContractRegistry {
|
||||
require(found);
|
||||
|
||||
entries[_identifier] = _address;
|
||||
|
||||
emit AddressKey(_identifier, _address);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -66,7 +72,7 @@ contract ContractRegistry {
|
||||
|
||||
// Implements ERC165
|
||||
function supportsInterface(bytes4 _sum) public pure returns (bool) {
|
||||
if (_sum == 0x12625fe5) { // Registry
|
||||
if (_sum == 0xa82606d9) { // Registry
|
||||
return true;
|
||||
}
|
||||
if (_sum == 0x01ffc9a7) { // ERC165
|
||||
|
||||
Reference in New Issue
Block a user