Network Contract
Register your network using the NetworkRegistry smart contract. The registered address serves as your management address for interacting with Symbiotic vaults to accept stake allocations.
We provide a network repository that simplifies registration and makes management more secure. It includes the Network.sol contract and tooling to manage it.
The Network.sol contract extends OpenZeppelin's TimelockController.sol with additional functionality to define delays for (exact target | exact selector) or (any target | exact selector) pairs.
Prerequisites
Deploy Network and Register
The deployment scripts support two scenarios:
- Deploy a network only (opt into vaults later)
- Deploy a network with vault opt-ins
Pure Network Deployment
Open DeployNetwork.s.sol and configure these settings:
// Name of the Network
string NAME = "My Network";
// Default minimum delay (will be applied for any action that doesn't have a specific delay yet)
uint256 DEFAULT_MIN_DELAY = 3 days;
// Cold actions delay (a delay that will be applied for major actions like upgradeProxy and setMiddleware)
uint256 COLD_ACTIONS_DELAY = 14 days;
// Hot actions delay (a delay that will be applied for minor actions like setMaxNetworkLimit and setResolver)
uint256 HOT_ACTIONS_DELAY = 0;
// Admin address (will become executor, proposer, and default admin by default)
address ADMIN = 0x0000000000000000000000000000000000000000;
// Optional
// Metadata URI of the Network
string METADATA_URI = "";
// Salt for deterministic deployment
bytes11 SALT = "SymNetwork";Network Deployment With Opt-ins
Open DeployNetworkForVaults.s.sol and configure these settings:
// Name of the Network
string NAME = "My Network";
// Default minimum delay (will be applied for any action that doesn't have a specific delay yet)
uint256 DEFAULT_MIN_DELAY = 3 days;
// Cold actions delay (a delay that will be applied for major actions like upgradeProxy and setMiddleware)
uint256 COLD_ACTIONS_DELAY = 14 days;
// Hot actions delay (a delay that will be applied for minor actions like setMaxNetworkLimit and setResolver)
uint256 HOT_ACTIONS_DELAY = 0;
// Admin address (will become executor, proposer, and default admin by default)
address ADMIN = 0x0000000000000000000000000000000000000000;
// Vault address to opt-in to (multiple vaults can be set)
address[] VAULTS = [0x0000000000000000000000000000000000000000];
// Maximum amount of delegation that network is ready to receive (multiple vaults can be set)
uint256[] MAX_NETWORK_LIMITS = [0];
// Resolver address (optional, is applied only if VetoSlasher is used) (multiple vaults can be set)
address[] RESOLVERS = [0x0000000000000000000000000000000000000000];
// Optional
// Subnetwork Identifier (multiple subnetworks can be used, e.g., to have different resolvers for the same network)
uint96 SUBNETWORK_ID = 0;
// Metadata URI of the Network
string METADATA_URI = "";
// Salt for deterministic deployment
bytes11 SALT = "SymNetwork";Manage Your Network
Use these five predefined action scripts:
- SetMaxNetworkLimit - set a new maximum network limit for the vault
- SetResolver - set the resolver for the vault (only if the vault uses VetoSlasher)
- SetMiddleware - set the middleware
- UpgradeProxy - upgrade the proxy (network itself)
- ArbitraryCall - make a call to any contract with any data
All actions follow a similar pattern. Here's how to use SetMaxNetworkLimit as an example:
Open SetMaxNetworkLimit.s.sol and configure these settings:
// Address of the Network
address NETWORK = 0x0000000000000000000000000000000000000000;
// Address of the Vault
address VAULT = 0x0000000000000000000000000000000000000000;
// Maximum amount of delegation that network is ready to receive
uint256 MAX_NETWORK_LIMIT = 0;
// Delay for the action to be executed
uint256 DELAY = 0;
// Optional
// Subnetwork Identifier (multiple subnetworks can be used, e.g., to have different max network limits for the same network)
uint96 SUBNETWORK_IDENTIFIER = 0;
// Salt for TimelockController operations
bytes32 SALT = "SetMaxNetworkLimit";Edit the configuration fields, then choose an operation:
runS()- schedule an actionrunE()- execute an actionrunSE()- schedule and execute an action (only if the delay is zero)
Run the operation:
-
To execute the script with an EOA:
bashforge script script/actions/SetMaxNetworkLimit.s.sol:SetMaxNetworkLimit --sig "runS()" --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast -
To get transaction calldata for a Safe multisig:
bashforge script script/actions/SetMaxNetworkLimit.s.sol:SetMaxNetworkLimit --sig "runS()" --rpc-url <RPC_URL> --sender <MULTISIG_ADDRESS> --unlockedThe logs will show a
callDatafield like this:Expected outputcallData:0x01d5062a00000000000000000000000025ed2ee6e295880326bdeca245ee4d8b72c8f103000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000005365744d61784e6574776f726b4c696d697400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004423f752d500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002b6700000000000000000000000000000000000000000000000000000000In Safe Transaction Builder:
- Enable "Custom data"
- Enter the Network's address as the target address
- Use the
callData(e.g.,0x01d5062a0000000000000000000000...) received earlier as theData (Hex encoded)
Update Delays
Every network action is protected by a delay (from zero to infinity).
Use these update delay scripts for the actions above, plus additional ones:
- SetMaxNetworkLimitUpdateDelay
- SetResolverUpdateDelay
- SetMiddlewareUpdateDelay
- UpgradeProxyUpdateDelay
- HotActionsUpdateDelay - update a delay for SetMaxNetworkLimitUpdateDelay and SetResolverUpdateDelay
- ColdActionsUpdateDelay - update a delay for SetMiddlewareUpdateDelay and UpgradeProxyUpdateDelay
- DefaultUpdateDelay - update a delay for unconstrained actions
- ArbitraryUpdateDelay - update a delay for an arbitrary call:
- set a delay for the exact target address and the exact selector
- set a delay for any target address and the exact selector (by setting target address to
0x0000000000000000000000000000000000000000)
For usage examples, see Manage Your Network.
Dashboard
The Network.sol contract inherits OpenZeppelin's TimelockController, which inherits AccessControl. You can't determine the full state (operation statuses or role holders) using only RPC calls.
Use the Network Dashboard to:
- Get delays for all operations
- Get holders of any role
- Get scheduled/executed operations
- Schedule/execute arbitrary actions
