Skip to content

FleetTreasuryPaymaster — whitelisted contract destinations#102

Open
Douglasacost wants to merge 2 commits intomainfrom
feat/fleet-paymastering
Open

FleetTreasuryPaymaster — whitelisted contract destinations#102
Douglasacost wants to merge 2 commits intomainfrom
feat/fleet-paymastering

Conversation

@Douglasacost
Copy link
Copy Markdown
Collaborator

Extends FleetTreasuryPaymaster so gas sponsorship is not limited to fleetIdentity only: allowed to addresses are tracked in isWhitelistedContract. fleetIdentity is seeded at deploy and cannot be removed. Documentation and tests are updated accordingly.

Sponsors need to pay gas for user transactions targeting other protocol contracts (for example SwarmRegistryUniversal) while keeping the same user whitelist and ETH balance checks, without deploying a separate WhitelistPaymaster.

  • Introduced isWhitelistedContract mapping to manage allowed destinations for gas sponsorship.
  • Added functions to add and remove whitelisted contracts, with checks to prevent removal of fleetIdentity.
  • Updated validation logic in _validateAndPayGeneralFlow to accommodate new contract whitelist.
  • Enhanced documentation in the swarm specification to reflect these changes.
  • Added tests for whitelisted contract functionality and validation scenarios.

…nd validation improvements

- Introduced `isWhitelistedContract` mapping to manage allowed destinations for gas sponsorship.
- Added functions to add and remove whitelisted contracts, with checks to prevent removal of `fleetIdentity`.
- Updated validation logic in `_validateAndPayGeneralFlow` to accommodate new contract whitelist.
- Enhanced documentation in the swarm specification to reflect these changes.
- Added tests for whitelisted contract functionality and validation scenarios.
@Douglasacost Douglasacost requested a review from aliXsed March 26, 2026 14:43
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

LCOV of commit b624d7d during checks #634

Summary coverage rate:
  lines......: 32.0% (769 of 2400 lines)
  functions..: 28.4% (108 of 380 functions)
  branches...: 37.0% (139 of 376 branches)

Files changed coverage rate:
                                                  |Lines       |Functions  |Branches    
  Filename                                        |Rate     Num|Rate    Num|Rate     Num
  ======================================================================================
  src/paymasters/BondTreasuryPaymaster.sol        | 0.0%     56| 0.0%     9| 0.0%     14
  test/paymasters/BondTreasuryPaymaster.t.sol     | 0.0%     12| 0.0%     5|    -      0

- Introduced `BondTreasuryPaymaster` for managing gas sponsorship and bond consumption for whitelisted contracts.
- Implemented functions for adding/removing whitelisted users and contracts, with appropriate access control.
- Enhanced validation logic for sponsored bond consumption and gas payments.
- Updated swarm specification documentation to reflect the new paymaster.
- Added comprehensive tests for the new paymaster functionality, including validation and access control scenarios.
@Douglasacost Douglasacost requested a review from aliXsed April 1, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants