commit 428de59a214f2eee31a0a358f8bdb8dd73b56a49
parent c6e3c24a884da87bd006144fd0748f08d6d15540
Author: lash <dev@holbrook.no>
Date: Sat, 25 Mar 2023 12:56:46 +0000
Change solidity contract comments
Diffstat:
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/python/eth_contract_registry/data/Registry.bin b/python/eth_contract_registry/data/Registry.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b5060405162000da438038062000da48339818101604052810190620000379190620002ac565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8151811015620000e05760018282815181106200009c576200009b620002fd565b5b602002602001015190806001815401808255809150506001900390600052602060002001600090919091909150558080620000d79062000365565b9150506200007a565b5050620003b2565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200014c8262000101565b810181811067ffffffffffffffff821117156200016e576200016d62000112565b5b80604052505050565b600062000183620000e8565b905062000191828262000141565b919050565b600067ffffffffffffffff821115620001b457620001b362000112565b5b602082029050602081019050919050565b600080fd5b6000819050919050565b620001df81620001ca565b8114620001eb57600080fd5b50565b600081519050620001ff81620001d4565b92915050565b60006200021c620002168462000196565b62000177565b90508083825260208201905060208402830185811115620002425762000241620001c5565b5b835b818110156200026f57806200025a8882620001ee565b84526020840193505060208101905062000244565b5050509392505050565b600082601f830112620002915762000290620000fc565b5b8151620002a384826020860162000205565b91505092915050565b600060208284031215620002c557620002c4620000f2565b5b600082015167ffffffffffffffff811115620002e657620002e5620000f7565b5b620002f48482850162000279565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600062000372826200035b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620003a757620003a66200032c565b5b600182019050919050565b6109e280620003c26000396000f3fe608060405234801561001057600080fd5b506004361061009a576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100785780638da5cb5b1461011d578063ba44593c1461013b578063bb34534c1461016b578063f2fde38b1461019b5761009a565b806301ffc9a71461009f57806328f2d4da146100cf5780633480c704146100ff575b600080fd5b6100b960048036038101906100b49190610694565b6101cb565b6040516100c691906106dc565b60405180910390f35b6100e960048036038101906100e4919061072d565b6102cd565b6040516100f69190610773565b60405180910390f35b6101076102f1565b604051610114919061079d565b60405180910390f35b6101256102fe565b60405161013291906107f9565b60405180910390f35b6101556004803603810190610150919061086c565b610322565b60405161016291906106dc565b60405180910390f35b610185600480360381019061018091906108ac565b6104d8565b60405161019291906107f9565b60405180910390f35b6101b560048036038101906101b091906108d9565b610515565b6040516101c291906106dc565b60405180910390f35b60006312625fe57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361021f57600190506102c8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361027157600190506102c8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102c357600190506102c8565b600090505b919050565b600181815481106102dd57600080fd5b906000526020600020016000915090505481565b6000600180549050905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461037d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103e957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361042257600080fd5b6000805b60018054905081101561047057846001828154811061044857610447610906565b5b90600052602060002001540361045d57600191505b808061046890610964565b915050610426565b508061047b57600080fd5b826002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600191505092915050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461057057600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6106718161063c565b811461067c57600080fd5b50565b60008135905061068e81610668565b92915050565b6000602082840312156106aa576106a9610637565b5b60006106b88482850161067f565b91505092915050565b60008115159050919050565b6106d6816106c1565b82525050565b60006020820190506106f160008301846106cd565b92915050565b6000819050919050565b61070a816106f7565b811461071557600080fd5b50565b60008135905061072781610701565b92915050565b60006020828403121561074357610742610637565b5b600061075184828501610718565b91505092915050565b6000819050919050565b61076d8161075a565b82525050565b60006020820190506107886000830184610764565b92915050565b610797816106f7565b82525050565b60006020820190506107b2600083018461078e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006107e3826107b8565b9050919050565b6107f3816107d8565b82525050565b600060208201905061080e60008301846107ea565b92915050565b61081d8161075a565b811461082857600080fd5b50565b60008135905061083a81610814565b92915050565b610849816107d8565b811461085457600080fd5b50565b60008135905061086681610840565b92915050565b6000806040838503121561088357610882610637565b5b60006108918582860161082b565b92505060206108a285828601610857565b9150509250929050565b6000602082840312156108c2576108c1610637565b5b60006108d08482850161082b565b91505092915050565b6000602082840312156108ef576108ee610637565b5b60006108fd84828501610857565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061096f826106f7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109a1576109a0610935565b5b60018201905091905056fea26469706673582212206126e2f08911a4f402cd713750d1deb4a0001592bd1ad23817164df0ad38e26a64736f6c63430008120033
-\ No newline at end of file
+60806040523480156200001157600080fd5b5060405162000daa38038062000daa8339818101604052810190620000379190620002ad565b33600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8151811015620000e15760028282815181106200009d576200009c620002fe565b5b602002602001015190806001815401808255809150506001900390600052602060002001600090919091909150558080620000d89062000366565b9150506200007b565b5050620003b3565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200014d8262000102565b810181811067ffffffffffffffff821117156200016f576200016e62000113565b5b80604052505050565b600062000184620000e9565b905062000192828262000142565b919050565b600067ffffffffffffffff821115620001b557620001b462000113565b5b602082029050602081019050919050565b600080fd5b6000819050919050565b620001e081620001cb565b8114620001ec57600080fd5b50565b6000815190506200020081620001d5565b92915050565b60006200021d620002178462000197565b62000178565b90508083825260208201905060208402830185811115620002435762000242620001c6565b5b835b818110156200027057806200025b8882620001ef565b84526020840193505060208101905062000245565b5050509392505050565b600082601f830112620002925762000291620000fd565b5b8151620002a484826020860162000206565b91505092915050565b600060208284031215620002c657620002c5620000f3565b5b600082015167ffffffffffffffff811115620002e757620002e6620000f8565b5b620002f5848285016200027a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600062000373826200035c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620003a857620003a76200032d565b5b600182019050919050565b6109e780620003c36000396000f3fe608060405234801561001057600080fd5b506004361061009a576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100785780638da5cb5b1461011d578063ba44593c1461013b578063bb34534c1461016b578063f2fde38b1461019b5761009a565b806301ffc9a71461009f57806328f2d4da146100cf5780633480c704146100ff575b600080fd5b6100b960048036038101906100b49190610699565b6101cb565b6040516100c691906106e1565b60405180910390f35b6100e960048036038101906100e49190610732565b6102cd565b6040516100f69190610778565b60405180910390f35b6101076102f1565b60405161011491906107a2565b60405180910390f35b6101256102fe565b60405161013291906107fe565b60405180910390f35b61015560048036038101906101509190610871565b610324565b60405161016291906106e1565b60405180910390f35b610185600480360381019061018091906108b1565b6104d9565b60405161019291906107fe565b60405180910390f35b6101b560048036038101906101b091906108de565b610515565b6040516101c291906106e1565b60405180910390f35b60006312625fe57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361021f57600190506102c8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361027157600190506102c8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102c357600190506102c8565b600090505b919050565b600281815481106102dd57600080fd5b906000526020600020016000915090505481565b6000600280549050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461038057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103eb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361042457600080fd5b6000805b60028054905081101561047257846002828154811061044a5761044961090b565b5b90600052602060002001540361045f57600191505b808061046a90610969565b915050610428565b508061047d57600080fd5b8260008086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600191505092915050565b600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461057257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61067681610641565b811461068157600080fd5b50565b6000813590506106938161066d565b92915050565b6000602082840312156106af576106ae61063c565b5b60006106bd84828501610684565b91505092915050565b60008115159050919050565b6106db816106c6565b82525050565b60006020820190506106f660008301846106d2565b92915050565b6000819050919050565b61070f816106fc565b811461071a57600080fd5b50565b60008135905061072c81610706565b92915050565b6000602082840312156107485761074761063c565b5b60006107568482850161071d565b91505092915050565b6000819050919050565b6107728161075f565b82525050565b600060208201905061078d6000830184610769565b92915050565b61079c816106fc565b82525050565b60006020820190506107b76000830184610793565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006107e8826107bd565b9050919050565b6107f8816107dd565b82525050565b600060208201905061081360008301846107ef565b92915050565b6108228161075f565b811461082d57600080fd5b50565b60008135905061083f81610819565b92915050565b61084e816107dd565b811461085957600080fd5b50565b60008135905061086b81610845565b92915050565b600080604083850312156108885761088761063c565b5b600061089685828601610830565b92505060206108a78582860161085c565b9150509250929050565b6000602082840312156108c7576108c661063c565b5b60006108d584828501610830565b91505092915050565b6000602082840312156108f4576108f361063c565b5b60006109028482850161085c565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610974826106fc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109a6576109a561093a565b5b60018201905091905056fea2646970667358221220ebf56b0d691ace31bb97b7f9d4d854a7eee77422ffc21a7cef4d7d7f26358b9864736f6c63430008120033
+\ No newline at end of file
diff --git a/python/eth_contract_registry/data/Registry.metadata.json b/python/eth_contract_registry/data/Registry.metadata.json
@@ -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}
diff --git a/solidity/Registry.sol b/solidity/Registry.sol
@@ -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