Skip to content

FleetTreasuryPaymaster — whitelisted contract destinations#102

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

FleetTreasuryPaymaster — whitelisted contract destinations#102
Douglasacost wants to merge 3 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 ee7d665 during checks #635

Summary coverage rate:
  lines......: 32.5% (769 of 2367 lines)
  functions..: 28.9% (108 of 374 functions)
  branches...: 37.9% (139 of 367 branches)

Files changed coverage rate:
                                                  |Lines       |Functions  |Branches    
  Filename                                        |Rate     Num|Rate    Num|Rate     Num
  ======================================================================================
  src/paymasters/BondTreasuryPaymaster.sol        | 0.0%     23| 0.0%     3| 0.0%      5
  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
…ify access control

- Updated `BondTreasuryPaymaster` to inherit from `WhitelistPaymaster`, enhancing gas sponsorship and user/contract whitelisting.
- Removed redundant mappings and functions related to whitelisting, streamlining the contract's logic.
- Adjusted constructor and validation methods to align with the new inheritance structure.
- Updated swarm specification documentation to reflect the changes in contract structure and functionality.
- Modified tests to ensure compatibility with the refactored paymaster, including adjustments to emitted events and revert reasons.
@Douglasacost Douglasacost enabled auto-merge (squash) April 3, 2026 14:27
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