hyperlane-monorepo
hyperlane-monorepo copied to clipboard
Migrate from enums to ERC-165 interface detection
Problem
The SDK module readers are littered with try/catch
to distinguish between contracts which share similar but different interfaces. This causes false positive errors and is a hack in lieu of a union discriminator.
Solution
https://eips.ethereum.org/EIPS/eip-165 is designed specifically for this problem. Simply ask the contract if it supports the interface before querying the desired function.
Downsides
- This may be less tenable in other VMs
- This implies relayer changes