v3-info
v3-info copied to clipboard
Searching for projects whose names begin with `0x` does not work
Bug Description
On info.uniswap.org, the "Search pools or tokens" box cannot be used to to find projects whose names begin with 0x
.
Steps to Reproduce
- Go to info.uniswap.org.
- Enter the "Search pools or tokens" box.
- Type "0xbtc".
- Confirm "No results".
- Clear the search box.
- Type "xbtc".
- Confirm that there are results.
Expected Behavior Typing "0xbtc" should show results that contain references to the project whose ticker is 0xBTC.
Additional Context
https://github.com/Uniswap/v3-info/blob/master/src/data/search/index.ts#L216
Checking whether the first characters of a string are 0x
seems like too imprecise of a check for whether a value is an Ethereum address. If the intent of the code is to avoid regex matches, could the isAddress
check be extended to include a check of the length of the value?
Fixed in https://github.com/Uniswap/v3-info/pull/222