-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Track ERC20 Allowances #1831
Comments
@DefiDebauchery thanks for the really well documented issue. I understand your concern and motivation for the issue, but I don't think we are implementing it:
Let me know if my reasoning looks good to you, and thanks again for contributing. |
It's true that other services track allowances, but just like the portfolio services you mention, they often work on a whitelist, and can sometimes miss tokens that we (or any Safe owner) would care about. I know there's a ton of token spam, but I do hope Safe does not decide to abandon token indexing. For Beefy specifically, where we are managing 18+ Safes all on different chains, having that de facto source of truth through the API is fairly critical; we use this data to power internal tooling, and we'd similarly use Allowance data. In the end, I understand that it's a big ask, especially in the midst of preparing for 4337. I do hope that Safe will at least hold this open for evaluation after those higher priorities have been tackled. |
Wouldn't you be able to switch to another source of truth like a blockexplorer or a specialized solution like Zerion? |
What is needed?
Since the TXS is already tracking token spending (transfer), indexing Approvals and reconciling them with subsequent Transfers would be useful.
Background
The Bungee security issue on Jan 16th caused us at Beefy to scramble to determine if any of our Safes were potentially impacted by outstanding approvals. While we generally keep our approvals tied to our expected short-term usage, not everyone might (given the effort required to get signers for repeated transactions). This highlighted a greater desire to keep a better eye on Approval data.
While third-party tools exist to track such data, Safe is nearly halfway there with its token Transfer indexing. By also indexing Approval events and reconciling them with these Transfers, Safe could provide users an in-house, at-a-glance overview of forgotten Approvals, and thus potential security vectors.
Endpoint
I don't think there's any need for a separate endpoint; simply adding a new
Approvals
(orSpenders
?) Model and key, containingaddress => value
pairs within each token inSafeBalanceResponse
, would be effective.Implementation Details
I'm admittedly not as well-versed in the TXS infrastructure as I'd like, but my high-level thoughts would be the following:
Approval
events that match the indexed Safeowner
.spender
, adding or updating thevalue
as a database entry. Because Safe is already tracking unique transactions, I don't think this table needs to uniquely catalog each balance change, but could exist as a simple key-value pair.spender
, much like the smart contract itself would do.This would pave the way for providing a live view of approved
spenders
and remaining allowance within the API, and thus the UI. This may require that the output of/v1/.../balances
report tokens with zero balance if there are non-zero Approvals.Challenges
The text was updated successfully, but these errors were encountered: