### Install CLI Packages Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Installs the necessary Node.js packages for the project's CLI tools using npm. This command should be run in the project's root directory. ```shell npm install ``` -------------------------------- ### Symbiotic Rewards: Environment Variables Setup (.env) Source: https://github.com/symbioticfi/rewards/blob/main/README.md Sets up environment variables for connecting to Ethereum networks and Etherscan. Requires RPC URLs for Ethereum and Holesky, and an Etherscan API key. These are optional. ```env ETH_RPC_URL= ETH_RPC_URL_HOLESKY= ETHERSCAN_API_KEY= ``` -------------------------------- ### Generate Merkle Roots from Merkle Trees Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Retrieves a Merkle root for each Merkle tree by token. This command requires a `trees.json` file to be present in the `cli/defaultOperatorRewards/data` directory. An example format for `trees.json` is provided. ```shell node cli/defaultOperatorRewards/treesToRoots.js ``` -------------------------------- ### Generate Merkle Roots from Rewards Distribution Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Generates a Merkle root for each rewards distribution by token. This command requires a `distribution.json` file to be present in the `cli/defaultOperatorRewards/data` directory. An example format for `distribution.json` is provided. ```shell node cli/defaultOperatorRewards/distributionToRoots.js ``` -------------------------------- ### Symbiotic Rewards: Build Project with Forge Source: https://github.com/symbioticfi/rewards/blob/main/README.md Compiles the smart contracts for the Symbiotic Rewards project using the Forge build tool. No specific inputs or outputs are detailed, but it's a standard build process. ```shell forge build ``` -------------------------------- ### Deploy DefaultOperatorRewardsFactory Contract Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Deploys the DefaultOperatorRewardsFactory contract using Forge. This script requires the ETH_RPC_URL environment variable to be set. The '--broadcast' flag enables broadcasting the transaction to the network. ```shell source .env forge script script/deploy/genesis/DefaultOperatorRewardsFactory.s.sol:DefaultOperatorRewardsFactoryScript --broadcast --rpc-url=$ETH_RPC_URL ``` -------------------------------- ### Deploy DefaultOperatorRewards Contract Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Deploys the DefaultOperatorRewards contract using Forge. This script requires the ETH_RPC_URL environment variable to be set and the '--broadcast' flag for transaction broadcasting. It uses the 'run()' function to execute the deployment logic. ```shell source .env forge script script/deploy/DefaultOperatorRewards.s.sol:DefaultOperatorRewardsScript --sig "run()" --broadcast --rpc-url=$ETH_RPC_URL ``` -------------------------------- ### Symbiotic Rewards: Format Code with Forge Source: https://github.com/symbioticfi/rewards/blob/main/README.md Formats the codebase for the Symbiotic Rewards project according to predefined style guidelines using Forge. This command ensures code consistency. ```shell forge fmt ``` -------------------------------- ### Generate Merkle Proofs from Merkle Trees for Operator Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Generates proofs for all tokens within Merkle trees for a given operator. This command requires a `trees.json` file in `cli/defaultOperatorRewards/data` and accepts the operator's address as an argument. ```shell node cli/defaultOperatorRewards/treesToProofs.js OPERATOR ``` -------------------------------- ### Deploy DefaultStakerRewardsFactory Source: https://github.com/symbioticfi/rewards/blob/main/specs/StakerRewards.md Deploys the DefaultStakerRewardsFactory contract using Forge. This script broadcasts the deployment to the specified RPC URL after loading environment variables. ```shell forge script script/deploy/genesis/DefaultStakerRewardsFactory.s.sol:DefaultStakerRewardsFactoryScript --broadcast --rpc-url=$ETH_RPC_URL ``` -------------------------------- ### Generate Merkle Proofs for Operator Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Generates Merkle proofs for all tokens in a rewards distribution for a specified operator. This command requires a `distribution.json` file in `cli/defaultOperatorRewards/data` and takes the operator's address as an argument. ```shell node cli/defaultOperatorRewards/distributionToProofs.js OPERATOR ``` -------------------------------- ### Symbiotic Rewards: Test Project with Forge Source: https://github.com/symbioticfi/rewards/blob/main/README.md Executes the test suite for the Symbiotic Rewards project using Forge. This command is used to ensure the code functions as expected. ```shell forge test ``` -------------------------------- ### Symbiotic Rewards: Generate Gas Snapshots with Forge Source: https://github.com/symbioticfi/rewards/blob/main/README.md Generates gas snapshots for the contracts in the Symbiotic Rewards project using Forge. This is useful for analyzing and optimizing gas consumption. ```shell forge snapshot ``` -------------------------------- ### Generate Merkle Trees from Rewards Distribution Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Constructs OZ Merkle tree structures from the rewards distribution and saves them to `cli/defaultOperatorRewards/data/trees.json`. This command requires a `distribution.json` file in the specified data directory. ```shell node cli/defaultOperatorRewards/distributionToTrees.js ``` -------------------------------- ### Reconstruct Rewards Distribution from Merkle Trees Source: https://github.com/symbioticfi/rewards/blob/main/specs/OperatorRewards.md Reconstructs a rewards distribution from OZ Merkle trees and saves it to `cli/defaultOperatorRewards/data/distribution.json`. This command requires a `trees.json` file in the specified data directory. ```shell node cli/defaultOperatorRewards/treesToDistribution.js ``` -------------------------------- ### Source Environment Variables Source: https://github.com/symbioticfi/rewards/blob/main/specs/StakerRewards.md Loads environment variables from a .env file into the current shell session. This is a common practice before executing deployment scripts that rely on environment-specific configurations like RPC URLs. ```shell source .env ``` -------------------------------- ### Deploy DefaultStakerRewards Entity Source: https://github.com/symbioticfi/rewards/blob/main/specs/StakerRewards.md Deploys the DefaultStakerRewards entity contract using Forge. This script requires several arguments including addresses and uint256 values, and specifies the function signature to execute during deployment. It broadcasts the deployment to the specified RPC URL. ```shell forge script script/deploy/DefaultStakerRewards.s.sol:DefaultStakerRewardsScript 0x0000000000000000000000000000000000000000 0 0x0000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000 --sig "run(address,uint256,address,address,address)" --broadcast --rpc-url=$ETH_RPC_URL ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.