A deployment framework for Suzaku Protocol smart contracts. This repository provides wrapper scripts and configuration examples to simplify the deployment process across different networks.
This deployer framework serves as a thin wrapper around the core deployment scripts found in the suzaku-core repository. It provides:
- Configuration-driven deployments through JSON files
- Deployment scripts for all Suzaku components
- Automatic saving of deployment artifacts
- Multi-network support (Anvil, Fuji, Avalanche)
- Foundry
- Suzaku Core as a dependency (added via remapping in
foundry.toml)
- Clone the repository:
git clone https://github.com/your-org/suzaku-deployer.git
cd suzaku-deployer- Install the dependencies:
forge install- Set up your environment variables in a
.envfile:
PRIVATE_KEY=your_private_key
AVALANCHE_RPC_URL=your_avalanche_rpc_url
FUJI_RPC_URL=your_fuji_rpc_url
SNOWTRACE_API_KEY=your_snowtrace_api_key
The deployment process is divided into several steps that should be executed in sequence:
- Vault Deployment: Deploy vaults using externally provided factories and registries
- Middleware L1 Deployment: Deploy the L1 middleware components
- Rewards Deployment: Deploy the rewards and uptime tracking system
- Validator Deployment: Deploy validators connected to the middleware
- Upgrade Deployment: Upgrade PoA validators to Balancer validators (optional)
Each step saves its deployment artifacts that are used by subsequent steps.
Configuration files are stored in the configs/ directory. Examples are provided for:
- Anvil (Local Development):
anvil-example.json - Avalanche (Mainnet):
avalanche-example.json - Vault Configuration:
vaultExample.json - Middleware Configuration:
middlewareExample.json - Rewards Configuration:
rewardsExample.json - Balancer Upgrade Configuration:
balancerExample.json
These files should be customized for your specific deployment needs.
This framework expects the addresses of factories and registries to be provided in your .env file:
PRIVATE_KEY=your_private_key
AVALANCHE_RPC_URL=your_avalanche_rpc_url
FUJI_RPC_URL=your_fuji_rpc_url
SNOWTRACE_API_KEY=your_snowtrace_api_key
# Factory and Registry addresses
VAULT_FACTORY_ADDRESS=0x...
DELEGATOR_FACTORY_ADDRESS=0x...
SLASHER_FACTORY_ADDRESS=0x...
REGISTRY_ADDRESS=0x...
# Additional private keys for validator deployment
PROXY_ADMIN_OWNER_KEY=your_proxy_admin_owner_private_key
VALIDATOR_MANAGER_OWNER_KEY=your_validator_manager_owner_private_key
# Add other required factory/registry addresses
The deployment scripts are stored in the script/ directory:
script/curator/DeployCurator.s.sol: Deploys a vault with its delegator and slasher componentsscript/l1/DeployMiddleware.s.sol: Deploys L1 middleware componentsscript/l1/DeployRewards.s.sol: Deploys rewards and uptime tracking contractsscript/l1/DeployPoAValidatorManager.s.sol: Deploys PoA validator manager contractsscript/l1/UpgradePoAToBalancer.s.sol: Upgrades PoA validators to Balancer validators
forge script \
script/curator/DeployCurator.s.sol:DeployVaultFull \
--sig "run(string)" "vaultExample.json" \
--broadcast \
--rpc-url fuji \
--private-key "$PRIVATE_KEY" \
--via-ir \
--verify
forge script script/l1/DeployMiddleware.s.sol:DeployMiddlewareL1 \
--sig "run(string)" "middlewareExample.json" \
--broadcast \
--rpc-url fuji \
--private-key "$PRIVATE_KEY" \
--verifyforge script script/l1/DeployRewards.s.sol:DeployRewardsL1 \
--sig "run(string)" "rewardsExample.json" \
--broadcast \
--rpc-url fuji \
--private-key "$PRIVATE_KEY" \
--verifyforge script \
script/l1/DeployPoAValidatorManager.s.sol:DeployPoAValidatorManager \
--sig "run(string,uint256,uint256)" "balancerExample.json" $PROXY_ADMIN_OWNER_KEY $VALIDATOR_MANAGER_OWNER_KEY \
--broadcast \
--rpc-url fuji \
--via-ir \
--verify5. Deploy BalancerValidatorManager, PoASecurityModule and transfer ValidatorManager ownership to BalancerValidatorManager
forge script \
script/l1/UpgradePoAToBalancer.s.sol:DeployUpgradePoAToBalancer \
--sig "run(string,uint256,uint256)" "balancerExample.json" $PROXY_ADMIN_OWNER_KEY $VALIDATOR_MANAGER_OWNER_KEY \
--broadcast \
--rpc-url fuji \
--via-ir \
--verifyDeployment artifacts are saved in the deployments/ directory with the following naming convention:
- Vaults:
vault-{network}-{timestamp}.jsonandvault-{network}-latest.json - Middleware:
middleware-{network}-{timestamp}.jsonandmiddleware-{network}-latest.json - Rewards:
rewards.jsonindeployments/{chainId}/{date}/directory structure - Upgrades:
poAUpgrade.jsonindeployments/{chainId}/{date}/directory structure