# Autonomous ERCs
## Abstract
Expose a lookup function on-chain to check for any subset of function selectors, as well as an id of the codepath for each function.
This would enable autonomous discovery of new standards in the wild.
## Motivation
Currently, smart contracts have no easy way to check with high confidence of a token's conformance to a given standard either by specification or implementation.
Creating a standard is a lengthy and error prone process despite the hard and valuable effort of ERC editors.
Many standards such as ERC-4626 have partial adherence with edge case failures for any number of reasons with no way to check.
EIP-165 is self-attested, so it does not fix this because contracts can say they conform to a standard without actually conforming.
Implementation guarantees only come from factories which enforce global contract code conformity, which limits use cases that only require a subset of code be identical.
Modularity or proxies can fix this at the expense of gas, while often being a highly complex architecture to integrate with.
This standard would enable new standardization to spontaneously become composable based on on-chain activity only at the interface and implementation level, allowing for a category level increase in composability for smart contract protocols.
## Specification
There are many possible implementations, ideally this could be added in a way that it is retroactively added to all contracts.
There would be one standard function for checking "interface ids" formed by taking the XOR of the function selectors desired.
A second function would return some hashed id of the bytecode for a given function selector. This must be a single function selector due to the risk of collisions on xor'ed interfaces.
## Security Consideration
Function selector collisions introduce some randomness, although in general this is mitigated by when a function is actually attempted to be called with the wrong parameters it will revert.