Enable paymaster to cover gas for whitelist admin too and update swarm specification#101
Merged
Enable paymaster to cover gas for whitelist admin too and update swarm specification#101
Conversation
…aster sponsorship, and FingerprintSize enum - Add new UUID_ONLY TagType for fleet-wide swarms (all tags under a UUID match) - Document sponsored UUID claims via FleetTreasuryPaymaster and IBondTreasury - Replace uint8 fingerprintSize with FingerprintSize enum (BITS_8 | BITS_16) - Add §3.10 UUID_ONLY specification with registration, mutual exclusivity rules, and checkMembership short-circuit - Add §4.4 Sponsored Claim Flow documenting Web2 UX with Web3 ownership (zero friction onboarding) - Add §11 FleetTreasuryPaymaster complete specification covering gas and bond sponsorship - Update §6 Swarm Operations with UUID_ONLY support and correct filter logic - Update §7.2 State Transitions with claimUuidSponsored path - Update §10.6 Deployment Order to include FleetTreasuryPaymaster - Renumber §4.4-4.8 → §4.5-4.9, shift Appendix A → §12
LCOV of commit
|
- Enable `_validateAndPayGeneralFlow` to accept calls to `address(this)` from whitelist admins - This allows admins to have gas-sponsored transactions for operations like `addWhitelistedUsers`, `removeWhitelistedUsers`, and `withdrawTokens` - Admins retain the option to pay gas themselves by omitting the paymaster from transaction parameters - Added 3 new tests to validate the admin-sponsored flow: - test_generalFlowValidation_adminToSelf_success - test_RevertIf_nonAdminToSelf_destinationNotAllowed - test_RevertIf_adminToSelf_paymasterBalanceTooLow - Improved coverage from 91.18% to 97.06% (lines), 89.47% to 97.37% (branches), and 60% to 100% (conditions)
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.
Summary
Updated the Swarm System technical specification to reflect the latest smart contracts, including three major feature additions:
Changes
1. New
UUID_ONLYTag Type (§3.10)0xff(1 byte)checkMembership()short-circuits totruefor UUID_ONLY swarms2. Sponsored Fleet UUID Claims (§4.4, §11)
Added comprehensive documentation for
FleetTreasuryPaymasterandIBondTreasury, enabling:claimUuidSponsored(), gets full on-chain ownership3. FingerprintSize Enum Correction (§2.4, §6.3)
uint8 fingerprintSize (1–16)withFingerprintSizeenum:BITS_8 | BITS_16m = filterLength(BITS_8) orm = filterLength / 2(BITS_16)0xFF(8-bit) or0xFFFF(16-bit)Spec Updates Details
IBondTreasury.solinterfaceclaimUuidSponsored()andhasFleetWideSwarm()to class diagramReferences
src/swarms/FleetIdentityUpgradeable.sol,src/paymasters/FleetTreasuryPaymaster.solsrc/swarms/interfaces/IBondTreasury.sol,src/swarms/interfaces/SwarmTypes.solCloses #[issue-number] (if applicable)