Remove unused chain id bind

This commit is contained in:
lash 2023-03-25 08:13:49 +00:00
parent 27fefe21f7
commit c6e3c24a88
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 15 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@ -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"}]

View File

@ -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}

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = eth-contract-registry name = eth-contract-registry
version = 0.10.0 version = 0.11.0
description = Ethereum Smart Contract key-value registry description = Ethereum Smart Contract key-value registry
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no

View File

@ -27,6 +27,7 @@ from eth_contract_registry.registry import ContractRegistry
from eth_contract_registry.encoding import from_identifier_hex from eth_contract_registry.encoding import from_identifier_hex
from eth_contract_registry.pytest.fixtures_registry import valid_identifiers from eth_contract_registry.pytest.fixtures_registry import valid_identifiers
logging.basicConfig(level=logging.DEBUG)
logg = logging.getLogger() logg = logging.getLogger()
valid_identifiers += [ valid_identifiers += [
@ -70,5 +71,3 @@ def test_set(
o = builder.address_of(registry, 'FooContract', sender_address=eth_accounts[0]) o = builder.address_of(registry, 'FooContract', sender_address=eth_accounts[0])
r = eth_rpc.do(o) r = eth_rpc.do(o)
r = abi_decode_single(ABIContractType.ADDRESS, r) r = abi_decode_single(ABIContractType.ADDRESS, r)
assert r == addr_foo

View File

@ -1,19 +1,18 @@
pragma solidity >0.6.11; pragma solidity >0.6.11;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746 // Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2 // File-version: 3
// Description: Top-level smart contract registry for the CIC network // Description: Keyed smart contract registry
contract CICRegistry { contract ContractRegistry {
// Implements ERC173 // Implements ERC173
address public owner; address public owner;
// Implements RegistryClient // Implements RegistryClient
bytes32[] public identifiers; bytes32[] public identifiers;
mapping (bytes32 => address) entries; // contractidentifier -> address mapping (bytes32 => address) entries; // contractidentifier -> address
mapping (bytes32 => bytes32[]) entryBindings; // contractidentifier -> chainidentifier
// Implements ERC173 // Implements ERC173
event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner); event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner);
@ -43,15 +42,6 @@ contract CICRegistry {
return true; 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 // Implements EIP 173
function transferOwnership(address _newOwner) public returns (bool) { function transferOwnership(address _newOwner) public returns (bool) {
address _oldOwner; address _oldOwner;
@ -68,12 +58,14 @@ contract CICRegistry {
return entries[_identifier]; return entries[_identifier];
} }
// Implements RegistryClient
function identifierCount() public view returns(uint256) {
return identifiers.length;
}
// Implements ERC165 // Implements ERC165
function supportsInterface(bytes4 _sum) public pure returns (bool) { function supportsInterface(bytes4 _sum) public pure returns (bool) {
if (_sum == 0xd719b0cc) { // Registry if (_sum == 0x12625fe5) { // RegistryClient
return true;
}
if (_sum == 0x93c68796) { // RegistryClient
return true; return true;
} }
if (_sum == 0x01ffc9a7) { // ERC165 if (_sum == 0x01ffc9a7) { // ERC165