Add rate-limited ERC-20 transfers sponsoring#18
Merged
Conversation
thaarok
force-pushed
the
jk/free-stablecoins
branch
2 times, most recently
from
June 5, 2026 08:50
802f34e to
ad50422
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the gas-subsidy system to support rate-limited ERC-20 transfer sponsorship via a delegate “extension” contract. It changes the SubsidiesRegistry sponsorship selection API to return a mode + payload (fund-based vs tracked) and introduces a track() callback path for sponsorships that don’t deduct from a fund directly.
Changes:
- Update
ISubsidiesRegistry.chooseFundto return(mode, payload)and addtrack(trackingId, fee)to support tracked sponsorship. - Add
SubsidiesRegistrydelegate support (delegate,setDelegate) to forwardchooseFund/deductFees/trackwhen the base registry can’t sponsor. - Add
FreeTransfersSubsidyExtensionimplementing a leaky-bucket daily limit for ERC-20transfer(...)calls, plus comprehensive tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
contracts/sfc/SubsidiesRegistry.sol |
Adds delegate forwarding, new track() entrypoint, and changes chooseFund return shape to support tracked sponsorship. |
contracts/sfc/FreeTransfersSubsidyExtension.sol |
New UUPS extension contract implementing rate-limited ERC-20 transfer sponsorship via tracking IDs. |
contracts/interfaces/ISubsidiesRegistry.sol |
Introduces subsidy mode constants, updates chooseFund signature, adds track() to the core interface. |
contracts/interfaces/ISubsidiesExtension.sol |
New interface for delegate extensions (chooseFund/deductFees/track). |
test/SubsidiesRegistry.ts |
Updates tests for (mode, payload) return and adds a storage-layout stability check for existing slots. |
test/FreeTransferSubsidyExtension.ts |
New tests covering free-transfer sponsorship, leaky-bucket behavior, and access control. |
ignition/modules/FreeTransferSubsidyExtension.ts |
Adds an Ignition deployment module for the extension (currently has a contract-name mismatch). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
thaarok
force-pushed
the
jk/free-stablecoins
branch
from
June 5, 2026 09:14
1d7db6e to
234742f
Compare
jmpike
reviewed
Jun 10, 2026
thaarok
force-pushed
the
jk/free-stablecoins
branch
from
June 10, 2026 12:51
981aced to
4ae382b
Compare
thaarok
marked this pull request as ready for review
June 12, 2026 13:33
jmpike
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TokenTransferSubsidies - Rate-limited sponsoring of transfers for everybody
SenderProjectSubsidies - Rate-limited sponsoring of transfers of whitelisted senders