contract-registry

Ethereum Smart Contract key-value registry
Log | Files | Refs

commit c6e3c24a884da87bd006144fd0748f08d6d15540
parent 27fefe21f78f7f76fd8e689e6137749b66b53fef
Author: lash <dev@holbrook.no>
Date:   Sat, 25 Mar 2023 08:13:49 +0000

Remove unused chain id bind

Diffstat:
Mpython/eth_contract_registry/data/Registry.bin | 4++--
Mpython/eth_contract_registry/data/Registry.json | 2+-
Mpython/eth_contract_registry/data/Registry.metadata.json | 2+-
Mpython/setup.cfg | 2+-
Mpython/tests/test_basic.py | 3+--
Msolidity/Registry.sol | 28++++++++++------------------
6 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/python/eth_contract_registry/data/Registry.bin b/python/eth_contract_registry/data/Registry.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b5060405162000f1c38038062000f1c8339818101604052810190620000379190620002ac565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8151811015620000e05760018282815181106200009c576200009b620002fd565b5b602002602001015190806001815401808255809150506001900390600052602060002001600090919091909150558080620000d79062000365565b9150506200007a565b5050620003b2565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200014c8262000101565b810181811067ffffffffffffffff821117156200016e576200016d62000112565b5b80604052505050565b600062000183620000e8565b905062000191828262000141565b919050565b600067ffffffffffffffff821115620001b457620001b362000112565b5b602082029050602081019050919050565b600080fd5b6000819050919050565b620001df81620001ca565b8114620001eb57600080fd5b50565b600081519050620001ff81620001d4565b92915050565b60006200021c620002168462000196565b62000177565b90508083825260208201905060208402830185811115620002425762000241620001c5565b5b835b818110156200026f57806200025a8882620001ee565b84526020840193505060208101905062000244565b5050509392505050565b600082601f830112620002915762000290620000fc565b5b8151620002a384826020860162000205565b91505092915050565b600060208284031215620002c557620002c4620000f2565b5b600082015167ffffffffffffffff811115620002e657620002e5620000f7565b5b620002f48482850162000279565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600062000372826200035b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620003a757620003a66200032c565b5b600182019050919050565b610b5a80620003c26000396000f3fe608060405234801561001057600080fd5b506004361061009a576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100785780638da5cb5b1461012f578063ba44593c1461014d578063bb34534c1461017d578063f2fde38b146101ad5761009a565b806301ffc9a71461009f57806328f2d4da146100cf5780636d5de9f0146100ff575b600080fd5b6100b960048036038101906100b491906107f6565b6101dd565b6040516100c6919061083e565b60405180910390f35b6100e960048036038101906100e4919061088f565b610331565b6040516100f691906108d5565b60405180910390f35b6101196004803603810190610114919061091c565b610355565b604051610126919061083e565b60405180910390f35b610137610460565b604051610144919061099d565b60405180910390f35b610167600480360381019061016291906109e4565b610484565b604051610174919061083e565b60405180910390f35b61019760048036038101906101929190610a24565b61063a565b6040516101a4919061099d565b60405180910390f35b6101c760048036038101906101c29190610a51565b610677565b6040516101d4919061083e565b60405180910390f35b600063d719b0cc7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610231576001905061032c565b6393c687967c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610283576001905061032c565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102d5576001905061032c565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610327576001905061032c565b600090505b919050565b6001818154811061034157600080fd5b906000526020600020016000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103b057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361041c57600080fd5b600360008481526020019081526020016000208290806001815401808255809150506001900390600052602060002001600090919091909150556001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104df57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461054b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361058457600080fd5b6000805b6001805490508110156105d25784600182815481106105aa576105a9610a7e565b5b9060005260206000200154036105bf57600191505b80806105ca90610adc565b915050610588565b50806105dd57600080fd5b826002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600191505092915050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106d257600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6107d38161079e565b81146107de57600080fd5b50565b6000813590506107f0816107ca565b92915050565b60006020828403121561080c5761080b610799565b5b600061081a848285016107e1565b91505092915050565b60008115159050919050565b61083881610823565b82525050565b6000602082019050610853600083018461082f565b92915050565b6000819050919050565b61086c81610859565b811461087757600080fd5b50565b60008135905061088981610863565b92915050565b6000602082840312156108a5576108a4610799565b5b60006108b38482850161087a565b91505092915050565b6000819050919050565b6108cf816108bc565b82525050565b60006020820190506108ea60008301846108c6565b92915050565b6108f9816108bc565b811461090457600080fd5b50565b600081359050610916816108f0565b92915050565b6000806040838503121561093357610932610799565b5b600061094185828601610907565b925050602061095285828601610907565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006109878261095c565b9050919050565b6109978161097c565b82525050565b60006020820190506109b2600083018461098e565b92915050565b6109c18161097c565b81146109cc57600080fd5b50565b6000813590506109de816109b8565b92915050565b600080604083850312156109fb576109fa610799565b5b6000610a0985828601610907565b9250506020610a1a858286016109cf565b9150509250929050565b600060208284031215610a3a57610a39610799565b5b6000610a4884828501610907565b91505092915050565b600060208284031215610a6757610a66610799565b5b6000610a75848285016109cf565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ae782610859565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610b1957610b18610aad565b5b60018201905091905056fea2646970667358221220ec3f6c5948f12d149cbdd2760ca8c25e64e9eed2e9c1ba6a5942bffb9db55b4364736f6c63430008120033 -\ No newline at end of file +60806040523480156200001157600080fd5b5060405162000da438038062000da48339818101604052810190620000379190620002ac565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8151811015620000e05760018282815181106200009c576200009b620002fd565b5b602002602001015190806001815401808255809150506001900390600052602060002001600090919091909150558080620000d79062000365565b9150506200007a565b5050620003b2565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200014c8262000101565b810181811067ffffffffffffffff821117156200016e576200016d62000112565b5b80604052505050565b600062000183620000e8565b905062000191828262000141565b919050565b600067ffffffffffffffff821115620001b457620001b362000112565b5b602082029050602081019050919050565b600080fd5b6000819050919050565b620001df81620001ca565b8114620001eb57600080fd5b50565b600081519050620001ff81620001d4565b92915050565b60006200021c620002168462000196565b62000177565b90508083825260208201905060208402830185811115620002425762000241620001c5565b5b835b818110156200026f57806200025a8882620001ee565b84526020840193505060208101905062000244565b5050509392505050565b600082601f830112620002915762000290620000fc565b5b8151620002a384826020860162000205565b91505092915050565b600060208284031215620002c557620002c4620000f2565b5b600082015167ffffffffffffffff811115620002e657620002e5620000f7565b5b620002f48482850162000279565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600062000372826200035b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620003a757620003a66200032c565b5b600182019050919050565b6109e280620003c26000396000f3fe608060405234801561001057600080fd5b506004361061009a576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100785780638da5cb5b1461011d578063ba44593c1461013b578063bb34534c1461016b578063f2fde38b1461019b5761009a565b806301ffc9a71461009f57806328f2d4da146100cf5780633480c704146100ff575b600080fd5b6100b960048036038101906100b49190610694565b6101cb565b6040516100c691906106dc565b60405180910390f35b6100e960048036038101906100e4919061072d565b6102cd565b6040516100f69190610773565b60405180910390f35b6101076102f1565b604051610114919061079d565b60405180910390f35b6101256102fe565b60405161013291906107f9565b60405180910390f35b6101556004803603810190610150919061086c565b610322565b60405161016291906106dc565b60405180910390f35b610185600480360381019061018091906108ac565b6104d8565b60405161019291906107f9565b60405180910390f35b6101b560048036038101906101b091906108d9565b610515565b6040516101c291906106dc565b60405180910390f35b60006312625fe57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361021f57600190506102c8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361027157600190506102c8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102c357600190506102c8565b600090505b919050565b600181815481106102dd57600080fd5b906000526020600020016000915090505481565b6000600180549050905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461037d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103e957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361042257600080fd5b6000805b60018054905081101561047057846001828154811061044857610447610906565b5b90600052602060002001540361045d57600191505b808061046890610964565b915050610426565b508061047b57600080fd5b826002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600191505092915050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461057057600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6106718161063c565b811461067c57600080fd5b50565b60008135905061068e81610668565b92915050565b6000602082840312156106aa576106a9610637565b5b60006106b88482850161067f565b91505092915050565b60008115159050919050565b6106d6816106c1565b82525050565b60006020820190506106f160008301846106cd565b92915050565b6000819050919050565b61070a816106f7565b811461071557600080fd5b50565b60008135905061072781610701565b92915050565b60006020828403121561074357610742610637565b5b600061075184828501610718565b91505092915050565b6000819050919050565b61076d8161075a565b82525050565b60006020820190506107886000830184610764565b92915050565b610797816106f7565b82525050565b60006020820190506107b2600083018461078e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006107e3826107b8565b9050919050565b6107f3816107d8565b82525050565b600060208201905061080e60008301846107ea565b92915050565b61081d8161075a565b811461082857600080fd5b50565b60008135905061083a81610814565b92915050565b610849816107d8565b811461085457600080fd5b50565b60008135905061086681610840565b92915050565b6000806040838503121561088357610882610637565b5b60006108918582860161082b565b92505060206108a285828601610857565b9150509250929050565b6000602082840312156108c2576108c1610637565b5b60006108d08482850161082b565b91505092915050565b6000602082840312156108ef576108ee610637565b5b60006108fd84828501610857565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061096f826106f7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109a1576109a0610935565b5b60018201905091905056fea26469706673582212206126e2f08911a4f402cd713750d1deb4a0001592bd1ad23817164df0ad38e26a64736f6c63430008120033 +\ No newline at end of file diff --git a/python/eth_contract_registry/data/Registry.json b/python/eth_contract_registry/data/Registry.json @@ -1 +1 @@ -[{"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":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"},{"internalType":"bytes32","name":"_reference","type":"bytes32"}],"name":"bind","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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"}] +[{"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"}] 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":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"},{"internalType":"bytes32","name":"_reference","type":"bytes32"}],"name":"bind","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","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":"CICRegistry"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"Registry.sol":{"keccak256":"0x68d1247a7776b5e3099c175b8108cc5b82950d5372888fdf38a76715d02eaa57","license":"GPL-3.0-or-later","urls":["bzz-raw://4f4dab8d265dc89ba26c3f9b90eedeb190af46575361dd9bc24fc44a80eded36","dweb:/ipfs/QmQe2NfXMfqDMacnenJaoW29iaM5nqdzYsiZVZgqMy64zb"]}},"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":"0x2e406a1c8abbea39883bda84db1b1c61919fae6b2c2c580d6f840d0ba7c4c0d8","license":"AGPL-3.0-or-later","urls":["bzz-raw://bd82ba643988552a1aa287db9f966523670438fb9b77ad221c854922525a1d65","dweb:/ipfs/QmSR8URA2tRDYXxc4ts5K5X6zLNasL4eSgyQBvrPRU8iCy"]}},"version":1} diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-contract-registry -version = 0.10.0 +version = 0.11.0 description = Ethereum Smart Contract key-value registry author = Louis Holbrook author_email = dev@holbrook.no diff --git a/python/tests/test_basic.py b/python/tests/test_basic.py @@ -27,6 +27,7 @@ from eth_contract_registry.registry import ContractRegistry from eth_contract_registry.encoding import from_identifier_hex from eth_contract_registry.pytest.fixtures_registry import valid_identifiers +logging.basicConfig(level=logging.DEBUG) logg = logging.getLogger() valid_identifiers += [ @@ -70,5 +71,3 @@ def test_set( o = builder.address_of(registry, 'FooContract', sender_address=eth_accounts[0]) r = eth_rpc.do(o) r = abi_decode_single(ABIContractType.ADDRESS, r) - assert r == addr_foo - diff --git a/solidity/Registry.sol b/solidity/Registry.sol @@ -1,19 +1,18 @@ pragma solidity >0.6.11; // Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746 -// SPDX-License-Identifier: GPL-3.0-or-later -// File-version: 2 -// Description: Top-level smart contract registry for the CIC network +// SPDX-License-Identifier: AGPL-3.0-or-later +// File-version: 3 +// Description: Keyed smart contract registry -contract CICRegistry { +contract ContractRegistry { // Implements ERC173 address public owner; // Implements RegistryClient bytes32[] public identifiers; mapping (bytes32 => address) entries; // contractidentifier -> address - mapping (bytes32 => bytes32[]) entryBindings; // contractidentifier -> chainidentifier // Implements ERC173 event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner); @@ -43,15 +42,6 @@ contract CICRegistry { return true; } - // Implements Registry - function bind(bytes32 _identifier, bytes32 _reference) public returns (bool) { - require(msg.sender == owner); - require(entries[_identifier] != address(0)); - - entryBindings[_identifier].push(_reference); - return true; - } - // Implements EIP 173 function transferOwnership(address _newOwner) public returns (bool) { address _oldOwner; @@ -68,12 +58,14 @@ contract CICRegistry { return entries[_identifier]; } + // Implements RegistryClient + function identifierCount() public view returns(uint256) { + return identifiers.length; + } + // Implements ERC165 function supportsInterface(bytes4 _sum) public pure returns (bool) { - if (_sum == 0xd719b0cc) { // Registry - return true; - } - if (_sum == 0x93c68796) { // RegistryClient + if (_sum == 0x12625fe5) { // RegistryClient return true; } if (_sum == 0x01ffc9a7) { // ERC165