mirror of
git://holbrook.no/eth-contract-registry
synced 2024-12-22 12:27:31 +01:00
Change solidity contract comments
This commit is contained in:
parent
c6e3c24a88
commit
428de59a21
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"bytes32[]","name":"_identifiers","type":"bytes32[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"_newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifiers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"},{"internalType":"address","name":"_address","type":"address"}],"name":"set","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"Registry.sol":"ContractRegistry"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"Registry.sol":{"keccak256":"0x2e406a1c8abbea39883bda84db1b1c61919fae6b2c2c580d6f840d0ba7c4c0d8","license":"AGPL-3.0-or-later","urls":["bzz-raw://bd82ba643988552a1aa287db9f966523670438fb9b77ad221c854922525a1d65","dweb:/ipfs/QmSR8URA2tRDYXxc4ts5K5X6zLNasL4eSgyQBvrPRU8iCy"]}},"version":1}
|
||||
{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"bytes32[]","name":"_identifiers","type":"bytes32[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"_newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifiers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"},{"internalType":"address","name":"_address","type":"address"}],"name":"set","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"Registry.sol":"ContractRegistry"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"Registry.sol":{"keccak256":"0xd780da338908de7c7e81607013647fe3f48c7f10b7387d43221b9140e980ac98","license":"AGPL-3.0-or-later","urls":["bzz-raw://16a14c1a813e04c44fd1f4cc045877e6610c888b52a83c0674f6eb3152c983f4","dweb:/ipfs/QmQyTs6yrCJzApHvQrSsbTVto8AMM9d2eyf5yjVhppsB99"]}},"version":1}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user