contract-registry

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

commit 5a81927fa1d974fa5cbfbd1b72d80310224c824a
parent c1d95613e909329eabf08e080ee1df41cb79459a
Author: lash <dev@holbrook.no>
Date:   Sat, 25 Mar 2023 16:48:40 +0000

Correct identifier array interface name

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/eth_contract_registry/interface.py | 20++++++++++++++++++++
Msolidity/Registry.sol | 14+++++++-------
5 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/python/eth_contract_registry/data/Registry.bin b/python/eth_contract_registry/data/Registry.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b5060405162000de238038062000de28339818101604052810190620000379190620002ad565b33600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8151811015620000e15760028282815181106200009d576200009c620002fe565b5b602002602001015190806001815401808255809150506001900390600052602060002001600090919091909150558080620000d89062000366565b9150506200007b565b5050620003b3565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200014d8262000102565b810181811067ffffffffffffffff821117156200016f576200016e62000113565b5b80604052505050565b600062000184620000e9565b905062000192828262000142565b919050565b600067ffffffffffffffff821115620001b557620001b462000113565b5b602082029050602081019050919050565b600080fd5b6000819050919050565b620001e081620001cb565b8114620001ec57600080fd5b50565b6000815190506200020081620001d5565b92915050565b60006200021d620002178462000197565b62000178565b90508083825260208201905060208402830185811115620002435762000242620001c6565b5b835b818110156200027057806200025b8882620001ef565b84526020840193505060208101905062000245565b5050509392505050565b600082601f830112620002925762000291620000fd565b5b8151620002a484826020860162000206565b91505092915050565b600060208284031215620002c657620002c5620000f3565b5b600082015167ffffffffffffffff811115620002e757620002e6620000f8565b5b620002f5848285016200027a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600062000373826200035c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620003a857620003a76200032d565b5b600182019050919050565b610a1f80620003c36000396000f3fe608060405234801561001057600080fd5b506004361061009a576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100785780638da5cb5b1461011d578063ba44593c1461013b578063bb34534c1461016b578063f2fde38b1461019b5761009a565b806301ffc9a71461009f57806328f2d4da146100cf5780633480c704146100ff575b600080fd5b6100b960048036038101906100b491906106d1565b6101cb565b6040516100c69190610719565b60405180910390f35b6100e960048036038101906100e4919061076a565b6102cd565b6040516100f691906107b0565b60405180910390f35b6101076102f1565b60405161011491906107da565b60405180910390f35b6101256102fe565b6040516101329190610836565b60405180910390f35b610155600480360381019061015091906108a9565b610324565b6040516101629190610719565b60405180910390f35b610185600480360381019061018091906108e9565b610511565b6040516101929190610836565b60405180910390f35b6101b560048036038101906101b09190610916565b61054d565b6040516101c29190610719565b60405180910390f35b60006312625fe57c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361021f57600190506102c8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361027157600190506102c8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102c357600190506102c8565b600090505b919050565b600281815481106102dd57600080fd5b906000526020600020016000915090505481565b6000600280549050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461038057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103eb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361042457600080fd5b6000805b60028054905081101561047257846002828154811061044a57610449610943565b5b90600052602060002001540361045f57600191505b808061046a906109a1565b915050610428565b508061047d57600080fd5b8260008086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550837f3465c39c7e9b14641553cf015fbfe670207bd64c689d17806d885bda47899feb846040516104fe9190610836565b60405180910390a2600191505092915050565b600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105aa57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6106ae81610679565b81146106b957600080fd5b50565b6000813590506106cb816106a5565b92915050565b6000602082840312156106e7576106e6610674565b5b60006106f5848285016106bc565b91505092915050565b60008115159050919050565b610713816106fe565b82525050565b600060208201905061072e600083018461070a565b92915050565b6000819050919050565b61074781610734565b811461075257600080fd5b50565b6000813590506107648161073e565b92915050565b6000602082840312156107805761077f610674565b5b600061078e84828501610755565b91505092915050565b6000819050919050565b6107aa81610797565b82525050565b60006020820190506107c560008301846107a1565b92915050565b6107d481610734565b82525050565b60006020820190506107ef60008301846107cb565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610820826107f5565b9050919050565b61083081610815565b82525050565b600060208201905061084b6000830184610827565b92915050565b61085a81610797565b811461086557600080fd5b50565b60008135905061087781610851565b92915050565b61088681610815565b811461089157600080fd5b50565b6000813590506108a38161087d565b92915050565b600080604083850312156108c0576108bf610674565b5b60006108ce85828601610868565b92505060206108df85828601610894565b9150509250929050565b6000602082840312156108ff576108fe610674565b5b600061090d84828501610868565b91505092915050565b60006020828403121561092c5761092b610674565b5b600061093a84828501610894565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109ac82610734565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036109de576109dd610972565b5b60018201905091905056fea2646970667358221220d72f3817d60cb0275d6d71dcacacd6bd79ba385579039d1c9ce0818c631fb69764736f6c63430008120033 -\ No newline at end of file +60806040523480156200001157600080fd5b5060405162000e9538038062000e958339818101604052810190620000379190620002ad565b33600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060005b8151811015620000e15760028282815181106200009d576200009c620002fe565b5b602002602001015190806001815401808255809150506001900390600052602060002001600090919091909150558080620000d89062000366565b9150506200007b565b5050620003b3565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200014d8262000102565b810181811067ffffffffffffffff821117156200016f576200016e62000113565b5b80604052505050565b600062000184620000e9565b905062000192828262000142565b919050565b600067ffffffffffffffff821115620001b557620001b462000113565b5b602082029050602081019050919050565b600080fd5b6000819050919050565b620001e081620001cb565b8114620001ec57600080fd5b50565b6000815190506200020081620001d5565b92915050565b60006200021d620002178462000197565b62000178565b90508083825260208201905060208402830185811115620002435762000242620001c6565b5b835b818110156200027057806200025b8882620001ef565b84526020840193505060208101905062000245565b5050509392505050565b600082601f830112620002925762000291620000fd565b5b8151620002a484826020860162000206565b91505092915050565b600060208284031215620002c657620002c5620000f3565b5b600082015167ffffffffffffffff811115620002e757620002e6620000f8565b5b620002f5848285016200027a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600062000373826200035c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620003a857620003a76200032d565b5b600182019050919050565b610ad280620003c36000396000f3fe608060405234801561001057600080fd5b506004361061009a576000357c010000000000000000000000000000000000000000000000000000000090048063ba44593c11610078578063ba44593c1461010b578063bb34534c1461013b578063d56b7d4e1461016b578063f2fde38b1461019b5761009a565b806301ffc9a71461009f5780633480c704146100cf5780638da5cb5b146100ed575b600080fd5b6100b960048036038101906100b49190610707565b6101cb565b6040516100c6919061074f565b60405180910390f35b6100d76102cd565b6040516100e49190610783565b60405180910390f35b6100f56102da565b60405161010291906107df565b60405180910390f35b6101256004803603810190610120919061085c565b610300565b604051610132919061074f565b60405180910390f35b6101556004803603810190610150919061089c565b6104ed565b60405161016291906107df565b60405180910390f35b610185600480360381019061018091906108f5565b610529565b6040516101929190610931565b60405180910390f35b6101b560048036038101906101b0919061094c565b61054d565b6040516101c2919061074f565b60405180910390f35b600063effbf6717c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361021f57600190506102c8565b6301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361027157600190506102c8565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036102c357600190506102c8565b600090505b919050565b6000600280549050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461035c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103c757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361040057600080fd5b6000805b60028054905081101561044e57846002828154811061042657610425610979565b5b90600052602060002001540361043b57600191505b8080610446906109d7565b915050610404565b508061045957600080fd5b8260008086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550837f3465c39c7e9b14641553cf015fbfe670207bd64c689d17806d885bda47899feb846040516104da91906107df565b60405180910390a2600191505092915050565b600080600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6002818154811061053957600080fd5b906000526020600020016000915090505481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d790610a7c565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001915050919050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6106e4816106af565b81146106ef57600080fd5b50565b600081359050610701816106db565b92915050565b60006020828403121561071d5761071c6106aa565b5b600061072b848285016106f2565b91505092915050565b60008115159050919050565b61074981610734565b82525050565b60006020820190506107646000830184610740565b92915050565b6000819050919050565b61077d8161076a565b82525050565b60006020820190506107986000830184610774565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006107c98261079e565b9050919050565b6107d9816107be565b82525050565b60006020820190506107f460008301846107d0565b92915050565b6000819050919050565b61080d816107fa565b811461081857600080fd5b50565b60008135905061082a81610804565b92915050565b610839816107be565b811461084457600080fd5b50565b60008135905061085681610830565b92915050565b60008060408385031215610873576108726106aa565b5b60006108818582860161081b565b925050602061089285828601610847565b9150509250929050565b6000602082840312156108b2576108b16106aa565b5b60006108c08482850161081b565b91505092915050565b6108d28161076a565b81146108dd57600080fd5b50565b6000813590506108ef816108c9565b92915050565b60006020828403121561090b5761090a6106aa565b5b6000610919848285016108e0565b91505092915050565b61092b816107fa565b82525050565b60006020820190506109466000830184610922565b92915050565b600060208284031215610962576109616106aa565b5b600061097084828501610847565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006109e28261076a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610a1457610a136109a8565b5b600182019050919050565b600082825260208201905092915050565b7f4552525f41585800000000000000000000000000000000000000000000000000600082015250565b6000610a66600783610a1f565b9150610a7182610a30565b602082019050919050565b60006020820190508181036000830152610a9581610a59565b905091905056fea264697066735822122081456b15942d8461ceb2be38986f6401eabbdb3e60e259a16c776ef942698a6864736f6c63430008120033 +\ 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":"bytes32","name":"_key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AddressKey","type":"event"},{"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"}] +[{"inputs":[{"internalType":"bytes32[]","name":"_identifiers","type":"bytes32[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AddressKey","type":"event"},{"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":"uint256","name":"","type":"uint256"}],"name":"identifier","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"bytes32","name":"_key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AddressKey","type":"event"},{"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":"0xaf103e9a3b2799c32eaa66fb411922235e92dd9cc23ea9f36b3dd75788f71bbe","license":"AGPL-3.0-or-later","urls":["bzz-raw://345551dbbf0a05fe4cee85c3d2bdf44013b36b64470c63d5af37e993b6fd6aaf","dweb:/ipfs/QmQqpBf8UfBBBhtRtX5vYiBViuXDWAFvyjCzXQkw53QWFS"]}},"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":"bytes32","name":"_key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AddressKey","type":"event"},{"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":"uint256","name":"","type":"uint256"}],"name":"identifier","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identifierCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"0x5e3faff7b6f6451b4e924784ad8732e1f4fdd4b49de85c1f64a8b185b39fa5bd","license":"AGPL-3.0-or-later","urls":["bzz-raw://c33a89bb4aa9200fac7cb354aa9499961d11f7d4d387a536f8b9910c45d7fc87","dweb:/ipfs/QmZnK2CtsRME2WW59TT1EqmrgDNz3CaL6GRDxaQoGL2h1R"]}},"version":1} diff --git a/python/eth_contract_registry/interface.py b/python/eth_contract_registry/interface.py @@ -43,6 +43,26 @@ class Registry(TxFactory): return o + def identifier(self, contract_address, idx, sender_address=ZERO_ADDRESS, id_generator=None): + j = JSONRPCRequest(id_generator) + o = j.template() + o['method'] = 'eth_call' + enc = ABIContractEncoder() + enc.method('identifier') + enc.typ(ABIContractType.UINT256) + enc.bytes32(idx) + data = add_0x(enc.encode()) + tx = self.template(sender_address, contract_address) + tx = self.set_code(tx, data) + o['params'].append(self.normalize(tx)) + o = j.finalize(o) + return o + + + def identifier_count(self, contract_address, sender_address=ZERO_ADDRESS, id_generator=None): + return self.call_noarg('identifierCount', contract_address, sender_address=ZERO_ADDRESS, id_generator=None) + + @classmethod def parse_address_of(self, v): return abi_decode_single(ABIContractType.ADDRESS, v) diff --git a/solidity/Registry.sol b/solidity/Registry.sol @@ -13,7 +13,7 @@ contract ContractRegistry { address public owner; // Implements Registry - bytes32[] public identifiers; + bytes32[] public identifier; // Implements ERC173 event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner); @@ -24,7 +24,7 @@ contract ContractRegistry { constructor(bytes32[] memory _identifiers) { owner = msg.sender; for (uint i = 0; i < _identifiers.length; i++) { - identifiers.push(_identifiers[i]); + identifier.push(_identifiers[i]); } } @@ -35,8 +35,8 @@ contract ContractRegistry { require(_address != address(0)); bool found = false; - for (uint i = 0; i < identifiers.length; i++) { - if (identifiers[i] == _identifier) { + for (uint i = 0; i < identifier.length; i++) { + if (identifier[i] == _identifier) { found = true; } } @@ -53,7 +53,7 @@ contract ContractRegistry { function transferOwnership(address _newOwner) public returns (bool) { address _oldOwner; - require(msg.sender == owner); + require(msg.sender == owner, 'ERR_AXX'); _oldOwner = owner; owner = _newOwner; emit OwnershipTransferred(_oldOwner, _newOwner); @@ -67,12 +67,12 @@ contract ContractRegistry { // Implements Registry function identifierCount() public view returns(uint256) { - return identifiers.length; + return identifier.length; } // Implements ERC165 function supportsInterface(bytes4 _sum) public pure returns (bool) { - if (_sum == 0x12625fe5) { // Registry + if (_sum == 0xeffbf671) { // Registry return true; } if (_sum == 0x01ffc9a7) { // ERC165