0

I have a question related to ERC1820 : Pseudo-introspection Registry Contract

in the offical link (http://eips.ethereum.org/EIPS/eip-1820)

in ERC1820Registry implementation contract what is the reason for defining mapping(address => mapping(bytes32 => address)) internal interfaces;

Why can't it defined as mapping(bytes32 => address) which provides the address of contract which implements the given _intefaceHash argument.

I m missing anything imp here?

Regards

0

This standard defines a registry where smart contracts and regular accounts can publish which functionality they implement—either directly or through a proxy contract.

Anyone can query this registry to ask if a specific address implements a given interface and which smart contract handles its implementation.

So the registry contract has to be able to answer the question "Does address 0x123 implement the interface XYZ? And if so, at what address?" The data structure in the standard can naturally answer that question: interfaces[0x123][keccak256("KYZ")].

  • I believe 0x123 is EOA and interfaces[0x123][keccak256("KYZ")] returns the smart contract address? – Devraj Singh Rawat Apr 12 at 1:26
  • 0x123 could be an EOA or a contract. – smarx Apr 12 at 1:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.