Skip to content

✨♻️🥢: add FeeVaultSplitter.sol and FeeVaultSplitter.t.sol, update Gasback.sol and Gasback.t.sol#19

Open
j6i wants to merge 5 commits into
Vectorized:mainfrom
shape-network:j6i/add-splitter
Open

✨♻️🥢: add FeeVaultSplitter.sol and FeeVaultSplitter.t.sol, update Gasback.sol and Gasback.t.sol#19
j6i wants to merge 5 commits into
Vectorized:mainfrom
shape-network:j6i/add-splitter

Conversation

@j6i

@j6i j6i commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Description

  • ✨: add FeeVaultSplitter.sol, used to split incoming sequencer fees from the BaseFeeVault
  • add FeeVaultSplitter.t.sol to test FeeVaultSplitter.sol
  • ♻️: updates to Gasback.sol
    • update accrued calculation
    • remove minVaultBalance, accruedRecipient, setAccruedRecipient, withdrawAccruedToAccruedRecipient
    • add baseFeeVaultShareNumerator, setBaseFeeVaultShareNumerator, _expectedBaseFeeVaultShareNumerator
    • lower gasbackRatioNumerator
  • add @openzeppelin-contracts-4.9.5/ dep
  • 🥢: fix "accural" misspelling (accural -> accrual)

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Ran forge fmt?
  • Ran forge snapshot?
  • Ran forge test?

Pull requests with an incomplete checklist will be thrown out.

@Vectorized Vectorized left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replicating baseFeeVaultShareNumerator across two contracts feels unclean tho.

I’m imagining a Solidity function triggerBaseFeeVaultWithdraw(uint expectedSelfBalanceAfter) external onlySelf that calls withdraw() on the baseFeeBault.

  • and reverts if the self.balance < expectedSelfBalanceAfter.
  • and passes if the self.balance >= expectedSelfBalanceAfter .

This function would then be called in Gasback’s receive() when funds are needed via a pop(call(…, which will make the inner revert silently pass as long as enough gas is given.

Logic in Gasback feels correct. Not sure about logic in the splitter.

Comment thread src/FeeVaultSplitter.sol Outdated
@j6i

j6i commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Replicating baseFeeVaultShareNumerator across two contracts feels unclean tho.

I’m imagining a Solidity function triggerBaseFeeVaultWithdraw(uint expectedSelfBalanceAfter) external onlySelf that calls withdraw() on the baseFeeBault.

  • and reverts if the self.balance < expectedSelfBalanceAfter.
  • and passes if the self.balance >= expectedSelfBalanceAfter .

This function would then be called in Gasback’s receive() when funds are needed via a pop(call(…, which will make the inner revert silently pass as long as enough gas is given.

Logic in Gasback feels correct. Not sure about logic in the splitter.

made some updates, lmk what you think

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