i'm building a webapp. i want to show what "type" an address is to the user. i.e. EOA, ERC-20, ERC-721, uniswap, etc. The list of actions available to the user depends on the "address type"
May 27, 2022, 8:36 AM
ok, that definitely adds context to things
So I think Grim's solution is as good as it gets, here is a more verbose explanation: https://ethereum.stackexchange.com/questions/102597/detect-if-destination-is-a-uniswap-v3-pool
May 27, 2022, 8:39 AM
If its off chain, you can make a query on uni v3 info website
Don't know if they have api though
Like this
https://info.uniswap.org/#/pools/0x5777d92f208679db4b9778590fa3cab3ac9e2168
https://info.uniswap.org/#/pools/0x5777d92f208679db4b9778590fa3cab3ac9e2168
May 27, 2022, 8:40 AM
they do have an API where you can supply addresses (https://docs.uniswap.org/protocol/V2/reference/API/queries). but idk how it behaves w different networks. i can't see a network option anywhere, so it's probably always the mainnet. relying on some web service isn't good anyway
yeah, i'll use that solution. it's actually better than my ERC-20 contract detection because using this, there is a double-check with the factory. thank you!
May 27, 2022, 8:44 AM