Refactor Escrowed REP and Fork Migration Path for Security Pools#312
Open
KillariDev wants to merge 7 commits into
Open
Refactor Escrowed REP and Fork Migration Path for Security Pools#312KillariDev wants to merge 7 commits into
KillariDev wants to merge 7 commits into
Conversation
- Move per-vault REP lock accounting from SecurityPool into EscalationGame and transfer deposits through preview/record APIs - Add deposit export/import and residual sweep helpers for fork continuation and unresolved vault state cleanup - Update forker/liquidation/withdrawal paths to rely on escrowed balances, remove stale lock bookkeeping, and align total-balance checks with full REP custody
- Update EscalationGame constructor/init-code flow to inject REP token explicitly for deterministic deployment - Replace locked-rep book-keeping with on-game escrowed-rep accounting and add non-transfer claim/export helpers - Remove SecurityPool escalation lock fields and migrate deposit escrow to ownership-derivative accounting with round-up safety checks - Update forking paths to support own-fork escalation REP partitioning and deterministic rep-to-ownership migration - Adjust factory/address derivation and TS UI/test wiring to match new deployment and claim/export interfaces
- Renamed fork accounting from `repAtFork` to `auctionableRepAtFork` and added `getOwnForkRepBuckets` to expose vault/escalation REP partitions for own-fork tracking - Reworked own-fork escalation migration to consume source/child REP buckets, rename vault migration callback to `claimForkedEscalationDeposits`, and emit separate child-vault vs wallet claim events - Updated Solidity/TS contract tests, simulator helpers, and UI components/types to use the new APIs and naming so fork/auction workflows and pricing logic remain consistent
- add `getOwnForkMigrationStatus` on `SecurityPoolForker` (and interface) and emit child-pool info in escalation-claim event - switch fork auction loading to use new migration-status payload for own-fork REP metrics - move own-fork diagnostics in `ForkAuctionSection` into an `Advanced Diagnostics` accordion - add/update Solidity and UI tests to cover own-fork migration label/visibility and data plumbing
- Relocate peripheral test Solidity mocks/contracts from `solidity/contracts/peripherals/test` to `solidity/contracts/test/peripherals` - Fix Solidity import paths for moved files and relocated peripheral dependencies - Update Solidity TS tests to reference the new `test_peripherals_*` artifact module names
- Introduced `SecurityPoolForkerEscalationForker` and moved escalation-specific fork/deposit migration logic into it - Unified own-fork bookkeeping into `forkDataByPool` by merging bucket fields into `SecurityPoolForkerForkData` - Refactored `SecurityPoolForker` truth-auction and finalize paths into smaller helpers, and updated storage layout test coverage for unified fork-session fields
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
t3code/4f690d1bintomainwith protocol-level refactors that move fork/migration behavior into the on-chain flow and simplify build orchestration.scripts/ensure-contract-artifacts.mts.shared/ts/protocolConfig.ts, updating export surfaces accordingly.ZoltarandEscalationGameconstructor/config constants flow: replaces mutable/constructor-provided fork params with internal constants and updates burn threshold math.escrowedRepByVault) insideEscalationGame.Testing
bun run ensure-contract-artifactsbun run tscbun run testbun run checkbun run knipbun run format