mirror of
git://holbrook.no/eth-contract-registry
synced 2026-05-24 04:06:19 +02:00
Change solidity contract comments
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
pragma solidity >0.6.11;
|
||||
pragma solidity >=0.8.0;
|
||||
|
||||
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
// File-version: 3
|
||||
// File-version: 4
|
||||
// Description: Keyed smart contract registry
|
||||
|
||||
|
||||
contract ContractRegistry {
|
||||
mapping (bytes32 => address) entries;
|
||||
|
||||
// Implements ERC173
|
||||
address public owner;
|
||||
|
||||
// Implements RegistryClient
|
||||
// Implements Registry
|
||||
bytes32[] public identifiers;
|
||||
mapping (bytes32 => address) entries; // contractidentifier -> address
|
||||
|
||||
// Implements ERC173
|
||||
event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner);
|
||||
@@ -24,7 +25,7 @@ contract ContractRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements Registry
|
||||
// Irrevocably set a contract registry value
|
||||
function set(bytes32 _identifier, address _address) public returns (bool) {
|
||||
require(msg.sender == owner);
|
||||
require(entries[_identifier] == address(0));
|
||||
@@ -53,19 +54,19 @@ contract ContractRegistry {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Implements RegistryClient
|
||||
// Implements Registry
|
||||
function addressOf(bytes32 _identifier) public view returns (address) {
|
||||
return entries[_identifier];
|
||||
}
|
||||
|
||||
// Implements RegistryClient
|
||||
// Implements Registry
|
||||
function identifierCount() public view returns(uint256) {
|
||||
return identifiers.length;
|
||||
}
|
||||
|
||||
// Implements ERC165
|
||||
function supportsInterface(bytes4 _sum) public pure returns (bool) {
|
||||
if (_sum == 0x12625fe5) { // RegistryClient
|
||||
if (_sum == 0x12625fe5) { // Registry
|
||||
return true;
|
||||
}
|
||||
if (_sum == 0x01ffc9a7) { // ERC165
|
||||
|
||||
Reference in New Issue
Block a user