Correct identifier array interface name

This commit is contained in:
lash
2023-03-25 16:48:40 +00:00
parent c1d95613e9
commit 5a81927fa1
5 changed files with 30 additions and 10 deletions

View File

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