Skip to content

Fiddle: gas improvement for fee tracker#12

Merged
krishan711 merged 4 commits into
fix-vault-token-fee-conversionfrom
feetrackergasimprove
Feb 27, 2026
Merged

Fiddle: gas improvement for fee tracker#12
krishan711 merged 4 commits into
fix-vault-token-fee-conversionfrom
feetrackergasimprove

Conversation

@krishan711
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 25, 2026 20:33
@krishan711 krishan711 changed the base branch from main to fix-vault-token-fee-conversion February 25, 2026 20:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes FeeTracker position storage by packing per-(wallet,vault) cost basis and share balances into a single storage slot, aiming to reduce gas costs during deposits/withdrawals while keeping existing getter access patterns.

Changes:

  • Introduce a packed VaultPosition struct (uint128 costBasis, uint128 shares) and store it in a single nested mapping.
  • Update deposit/withdraw accounting to read/write via the packed struct.
  • Preserve the previous external ABI by reintroducing agentVaultCostBasis(...) / agentVaultShares(...) as explicit view functions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/mocks/MockFeeTracker.sol Mirrors the packed vault-position storage in the mock and updates position tracking logic/getters.
src/FeeTracker.sol Packs vault position tracking into a struct mapping and updates all position accounting/getters accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/FeeTracker.sol Outdated
Comment thread test/mocks/MockFeeTracker.sol
@krishan711 krishan711 merged commit 1607957 into fix-vault-token-fee-conversion Feb 27, 2026
@krishan711 krishan711 deleted the feetrackergasimprove branch February 27, 2026 12:58
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