Repository metrics
- Stars
- (54 stars)
- PR merge metrics
- (PR metrics pending)
Description
Due to the way that contract addresses are calculated by the CREATE opcode, it's possible for the same contract address to be used across multiple chains for deployment of entirely different contract code and hence purposes.
Similarly, a user might choose to use an EoA on one chain for an entirely different purpose to how they use it on another chain.
Therefore, there is value in rolod0x optionally supporting different address -> name mappings per chain.
Unfortunately there is no general solution for determining the context of which chain is being referred to when an address is mentioned on a web page. However there are plenty of common use cases where it is easy to determine the chain simply from the URL, e.g. most block explorers have a unique DNS domain per chain like mumbai.polygonscan.com, and Gnosis Safe includes the network as a prefix of the URL's first path segment:
https://app.safe.global/eth:0x.../homehttps://app.safe.global/matic:0x.../home
So we should add some intelligence which figures out the web page's chainId where possible, and then supports chain-specific mappings.
This would require a new optional chainId field per entry in the mapping, which in turn requires an extension to the existing text format. If the chainId for an entry is empty, then that address/label mapping applies across all chains. Perhaps a new YAML format is the better way to go here, e.g.
addresses:
- 0x424b294940C93043899D4fE381859085492d34e6
- label: ToucanCrosschainMessenger proxy
network: mumbai
- label: CarbonOffsetBatches v1.3.0-5 impl
network: alfajores
There could be a special network * or DEFAULT as a fallback, and if that's not present, it could fall back to joining all other labels together into a single string like ToucanCrosschainMessenger proxy (mumbai) / CarbonOffsetBatches v1.3.0-5 impl (alfajores).
UPDATE: recently remembered the existence of chainlists.org, and filed #244 for the task of producing a good JSON schema.
Also, https://chainid.network/chains.json looks very useful.