-
Notifications
You must be signed in to change notification settings - Fork 38
Integration refactoring #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Turned config vars into constants
This reverts commit 81d2b1f.
Sherlock AI FindingsThe automated tool identified the following potential security issues in the codebase. Please review the details for each issue in the linked dashboard.
Next Steps: Review the linked issues in the dashboard and address high-severity bugs first. Contact the team if you need assistance. Full report available at: https://ai.sherlock.xyz/runs/e5a228ed-5359-41cd-8fc9-505977ca53ab |
1kresh
approved these changes
Oct 29, 2025
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.
PR Type
Enhancement, Tests
Description
• Major refactoring to introduce inheritance-based architecture with abstract base contracts
• Created
SymbioticCoreInitBaseandSymbioticCoreBindingsBaseabstract contracts to eliminate code duplication• Refactored integration scripts and tests to inherit from base classes, removing over 1600 lines of duplicated code
• Added comprehensive deployment base contracts for vaults, hints, and core components
• Improved test organization by introducing local variable structs in delegator and vault tests
• Added base/contracts submodule dependency
• Disabled IR compilation in Foundry configuration
• Simplified
SymbioticInitcontracts by removing counter functionalityDiagram Walkthrough
File Walkthrough
10 files
SymbioticCoreInitBase.sol
Add comprehensive SymbioticCoreInitBase abstract contracttest/integration/base/SymbioticCoreInitBase.sol
• Created a new abstract base contract
SymbioticCoreInitBasewithcomprehensive Symbiotic Core initialization functionality
• Added
extensive helper methods for vault, operator, network, staker, and
curator management
• Implemented configuration constants for epoch
durations, token amounts, and delegation limits
• Included signature
generation and validation methods for opt-in/opt-out operations
SymbioticCoreInit.sol
Refactor SymbioticCoreInit to use base contractscript/integration/SymbioticCoreInit.sol
• Refactored to inherit from
SymbioticCoreInitBaseinstead ofduplicating functionality
• Simplified the contract by removing
hundreds of lines of duplicated code
• Updated import to use
SymbioticCoreBindingsScriptinstead ofSymbioticCoreBindings• Added
broadcast helper method implementations for different caller modes
SymbioticInit.sol
Simplify SymbioticInit by removing counter functionalityscript/integration/SymbioticInit.sol
• Updated import from
SymbioticCountertoSymbioticUtils• Removed
inheritance from
SymbioticCounterclass• Removed
SYMBIOTIC_SEEDconfiguration variable and
runmethod• Simplified contract to focus
only on token dealing functionality
SymbioticInit.sol
Update SymbioticInit test to use SymbioticUtilstest/integration/SymbioticInit.sol
• Updated import from
SymbioticCountertoSymbioticUtils• Removed
inheritance from
SymbioticCounterclass• Removed
SYMBIOTIC_SEEDconfiguration variable
• Kept timestamp and block configuration
constants
SymbioticCoreInit.sol
Major refactoring to use base class inheritance patterntest/integration/SymbioticCoreInit.sol
• Removed extensive configuration constants and helper methods (over
1100 lines)
• Added import for
SymbioticCoreInitBasebase class•
Refactored contract to inherit from
SymbioticCoreInitBaseinstead ofimplementing everything directly
• Kept only essential methods like
_getStaker_SymbioticCoreand broadcast helper methodsSymbioticCoreBindings.sol
Refactor to use base class with broadcast modifier overridetest/integration/SymbioticCoreBindings.sol
• Removed all implementation methods (over 500 lines of binding
functions)
• Added import for
SymbioticCoreBindingsBasebase class•
Refactored to inherit from base class with only a
broadcastmodifieroverride
• Simplified contract to minimal implementation using
inheritance pattern
SymbioticCoreBindings.sol
Refactor SymbioticCoreBindings to inherit from base classscript/integration/SymbioticCoreBindings.sol
• Replaced concrete implementation with inheritance from
SymbioticCoreBindingsBase• Removed all function implementations (~500
lines of code)
• Added a simple
broadcastmodifier that wrapsvm.startBroadcastandvm.stopBroadcast• Changed class name from
SymbioticCoreBindingstoSymbioticCoreBindingsScriptSymbioticCoreBindingsBase.sol
Create abstract base class for SymbioticCore bindingstest/integration/base/SymbioticCoreBindingsBase.sol
• Created new abstract base class containing all the core binding
functions
• Moved all function implementations from the original
SymbioticCoreBindingsclass• Added abstract
broadcastmodifier to beimplemented by child classes
• Provides common functionality for both
test and script contexts
DeployVaultBase.sol
Create base contract for vault deployment scriptsscript/deploy/base/DeployVaultBase.sol
• Created new base contract for vault deployment functionality
• Added
comprehensive parameter structs for vault, delegator, and slasher
configuration
• Implemented deployment logic with role management and
ownership transfer validation
• Provides reusable deployment
infrastructure for different vault types
DeployVaultTokenizedBase.sol
Create specialized base for tokenized vault deploymentscript/deploy/base/DeployVaultTokenizedBase.sol
• Created specialized deployment base for tokenized vaults
• Extended
DeployVaultBasewith tokenized-specific parameters (nameandsymbol)•
Overrode vault version to return 2 and customized parameter encoding
for tokenized vaults
1 files
.gitmodules
Add base contracts submodule.gitmodules
• Added new git submodule entry for
lib/contractspointing tobase/contracts repository
6 files
Slasher.t.sol
Refactor test methods to use structured local variablestest/slasher/Slasher.t.sol
• Added local variable structs
TestSlashSubnetworksLocalVariablesandTestSlashWithBurnerGasLocalVariables• Refactored complex test methods
to use structured local variables instead of function parameters
•
Improved code organization and readability by grouping related
variables into structs
• Enhanced test method structure with better
variable scoping
NetworkRestakeDelegator.t.sol
Refactor test functions to use local variable structstest/delegator/NetworkRestakeDelegator.t.sol
• Added
SlashWithHookLocalVariablesstruct to organize local variablesin test functions
• Refactored
test_SlashWithHookBaseandtest_SlashWithHookGasto use struct for variable management• Improved
code organization by grouping related variables into a single struct
FullRestakeDelegator.t.sol
Refactor test functions to use local variable structstest/delegator/FullRestakeDelegator.t.sol
• Added
SlashWithHookLocalVariablesstruct to organize local variablesin test functions
• Refactored
test_SlashWithHookBaseandtest_SlashWithHookGasto use struct for variable management• Improved
code organization by grouping related variables into a single struct
VaultTokenized.t.sol
Refactor vault test functions with local variable structstest/vault/VaultTokenized.t.sol
• Added
TestCreate2LocalVariablesandGetVaultAndDelegatorAndSlasherLocalVariablesstructs• Refactored
test_Create2and_getVaultAndDelegatorAndSlasherfunctions to usestruct-based variable organization
• Improved code readability by
grouping related variables into structured data types
OperatorSpecificDelegator.t.sol
Refactor delegator test functions with variable structstest/delegator/OperatorSpecificDelegator.t.sol
• Added
SlashWithHookLocalVariablesstruct for organizing testvariables
• Refactored
test_SlashWithHookandtest_SlashWithHookGasfunctions to use struct-based approach
• Improved code organization
and readability in test functions
OperatorNetworkSpecificDelegator.t.sol
Refactor delegator test functions and fix timestamp handlingtest/delegator/OperatorNetworkSpecificDelegator.t.sol
• Added
SlashWithHookLocalVariablesstruct for test variableorganization
• Refactored
test_SlashWithHookandtest_SlashWithHookGasfunctions to use struct-based variable management
• Fixed timestamp
calculation to use
vm.getBlockTimestamp()instead of complexblock.timestamp operations
2 files
DeployHintsBase.s.sol
Add deployment script for hints base contractsscript/deploy/base/DeployHintsBase.s.sol
• Added new deployment script for hints contracts
• Implements
deployment of
OptInServiceHints,VaultHints,BaseDelegatorHints, andBaseSlasherHints• Includes logging functionality for deployed
contract addresses
• Provides structured deployment workflow for hint
system components
foundry.toml
Disable IR compilation in Foundry configurationfoundry.toml
• Changed
via_irsetting fromtruetofalse• Disabled intermediate
representation compilation optimization
74 files