umbra-protocol
umbra-protocol copied to clipboard
On withdraw modal, warn if withdrawing to a token contract
We'd add this check here: https://github.com/ScopeLift/umbra-protocol/blob/a9ee536c46d7e28c990b536b03986ac860358a88/frontend/src/utils/address.ts#L99
Potential ways to implement:
- Have the backend maintain a static list of token addresses, and the frontend will use a new endpoint to ask if the destination address is a token
- The frontend can directly query the contract for "name", "symbol", "decimals", and fields, and if all 3 exist it's likely a token. Alternatively just query for name and symbol which should also cover NFTs
I think I lean toward the second option to reduce reliance on the backend
To start, perhaps we just only check against the address being withdrawn to simplify the logic
I will pick this one up this week
This should be resolved now