Add QueueForecastFacet and InterestAdminFacet - #1
Merged
Conversation
Two deploy-slim facets for post-launch selector registration. Instead of inheriting the full declaration chain they mirror only the storage slots they touch, padded to the exact positions of the deployed diamond layout (23.2KB to 2.7KB and 13.6KB to 0.9KB deploy bytecode). QueueForecastFacet.solveForAmountAfterFulfill(x, y) quotes a solve for y against the queue as it would look after a solver-optimal fill of x, and additionally returns the per-order amounts and the partial take, which a UI cannot read from chain state that does not exist yet. Verified by a differential fuzz: the forecast quoted before equals solveForAmount(y) quoted after a real fulfillOrderBulk(x) executed. InterestAdminFacet.setCashedInterest(user, amount) is the master-only setter for the settled interest bucket (lost-key rescues, grants, write-offs). It keeps the totalCashedInterest accumulator in lockstep with the delta in both directions, touches only the settled bucket, and sits behind the same supplyChangeByOwnerNotAllowed latch as mintSupply and burnSupply. check_storage_layout.sh gains a pinned-subset phase: every non-filler entry of a slim facet must match the committed layout snapshot by label, slot, offset and type, so pinning drift fails CI. Both facets are live and registered on all nine vaults via the timelocked selector proposals.
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.
Publishes the two post-launch facets that are already live and registered on all nine vaults, so the public repo matches the deployed selector surface.
What is included
solveForAmountAfterFulfill(x, y): quotes a solve for y against the queue as it would look after a solver-optimal fill of x, and returns the per-order amounts and the partial take. A UI cannot compute this from chain state that does not exist yet.setCashedInterest(user, amount): master-only setter for the settled interest bucket (lost-key rescues, grants, write-offs). Keeps thetotalCashedInterestaccumulator in lockstep and sits behind the samesupplyChangeByOwnerNotAllowedlatch asmintSupply/burnSupply.queueForecastSelectors,interestAdminSelectors) and one new event.check_storage_layout.shpinned-subset phase: slim-facet entries must match the committed layout snapshot by label, slot, offset and type.Verification
forge buildclean on this branchscript/check_storage_layout.shpasses: diamond + 17 facets identical, 2 slim facets pinned correctly, snapshot matches