fix(chain): harden transfer IDs, repurchase remainder, and seed minting - #269
Merged
Conversation
Close the Pashov high-impact gaps without changing proxy storage layout: multi-lot transfers salt issuance/security ids with an in-memory ordinal, partial repurchases store the remainder certificate in balance_security_id, and manifest seed is one-shot with issued counters matching live holdings. Invariant handler now transfers, repurchases, cancels, retracts, and reissues. Contract comments follow interface NatSpec (onchain spelling).
Document transfer ordinals, repurchase remainder ids, one-shot seed, invariant handler coverage, onchain comment style, and that a compiler bump is a separate PR (rebuild, layout diff, beacon upgrade, re-verify).
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Exclude Foundry deps without skipping TAP libraries. Report is 1 High (false-positive unique-id keccak) and 9 Low; document accepted findings.
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
Closes the three confirmed high-impact Pashov findings without changing proxy storage layout.
transferStocksalts issuance and security ids with an in-memoryissuanceOrdinalso FIFO legs no longer collide.repurchaseStockwrites the remainder certificate intobalance_security_id(bytes16(0)on a full buyback).mintSharesAuthorized/mintActivePositionsare one-shot and must agree: every current stock class, issued ≤ authorized, live lots match issued counters.Invariant handler now transfers, repurchases, cancels, retracts, and reissues. Contract comments are interface NatSpec (spell onchain). Docs record the ledger rules and that a solc 0.8.36 bump is a separate PR (rebuild, storage-layout diff, new impl, beacon upgrade, re-verify).
Closes #268.
Test plan
forge test --no-match-contract CapTableInvariantsforge test --match-contract CapTableInvariants(256 runs, 0 handler reverts)seed.jsstill matches the complete-class seed requirement