Allow Delegators to Approve ∞

Motivation

Currently Delegators must approve the ability for The Graph’s staking contract to allocate tokens each time they want to initiate delegating tokens to an Indexer. This increases transaction fees by the number of Indexers Delegators choose to delegate to, which is a behaviour encouraged by The Graph. Allowing Delegators to approve an infinite allocation once greatly reduces transaction fees, even if it’s not the first time they perform an approval transaction.

Implementation

Today, the Delegation dApp does not explicitly display the ability to complete approval transactions. The Delegation dApp could provide options to manually initiate a token approval transaction first, and then follow-up with the delegation deposit transaction. Here is a mockup of how this could look:

This would allow someone who has been delegating for some time, and is comfortable doing so, to approve ∞ and no longer have to complete any further approval transactions.

I won’t profess to understand how this is done at the smart contract level, but it is very common place on other platforms and dApps and would be a welcome change for Delegators who are looking to engage with The Graph network for a long period of time.

14 Likes

Derek, what a pleasant surprise to see you here with such a detailed proposal :slight_smile: :raised_hands:
I like it! I know there were some discussions about this during the testnet, but I have to check where we are with it.

1 Like

As a delegator who likes to spread his GRT around, I would greatly appreciate this functionality.

3 Likes

I’m not a fan of multiple transactions and also doesn’t like to leave any approved amount for security reasons.
But it would be nice to delegate with one transaction that will contain approve and delegate in it, Uniswap is doing so and it feels great.
There was some discussion about it during testnet, but can’t find it right away.
Here is a bit of description in this post.

2 Likes

I like the idea. It will be possible to attract more new delegators.

Can you explain the security risks to having funds pre-approved for delegation? What added layer of security is there in having them unapproved if approving them is just a transaction like delegating them?

When you approve amount to smart-contract it means they can use it without your notice. There were many hacks when smart-contract had vulnerabilities and hackers just transferred all approved tokens from customer wallets.
I understand that contracts were audited and are safe to use, but I would like to see best practices applied.

2 Likes

Thanks for the explanation!

Best practices is a term I don’t like. What’s best today could be foolish tomorrow. :slight_smile:

I also don’t agree with your characterization that approving infinity means the smart contract that move the tokens without my notice. A transaction must still be initiated from my wallet, and I’m not aware of how The Graph’s smart contract would do that and approve the gas fees without my knowledge.

However, even today, if I delegate 5000 GRT one day and then 3000 GRT the next day, that next day I’m still asked once again to approve the token once more, wasting (in my opinion) ETH.

2 Likes

transferFrom method can be used to transfer approved tokens, so gas will be paid from contract balance or hackers (depends on vulnerability if any)

100% support the idea. Great way to save some transaction costs. I’m using Ledger and agree that I need to approve the transaction on the HW already anyway, so the additional approval step today seems redundant. Not sure if that is the same across all wallets though.

2 Likes

Hey everyone - any more discussion on this? This and/or a means for Delegators to transfer their GRT to another indexer as opposed to withdrawing it would also be a great convenience.

Approve infinite is already there for all transactions :slight_smile:

2 Likes

Thanks! Guess I must have approved my 3 delegations prior to this change. Just now going through the undelegate / withdrawal process.

Update: This has been implemented!

5 Likes