Skip to content

Commit

Permalink
scripts readme
Browse files Browse the repository at this point in the history
  • Loading branch information
haythemsellami committed Jan 9, 2025
1 parent 74bc40f commit e86dc37
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 30 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ forge fmt
forge doc --serve --port 4000
```

## Scripts

You can find `forge scripts` inside the `/script` dir to interact with Euler Earn protocol. For more details, please check the scripts usage document.

## Security

This software is **experimental** and is provided "as is" and "as available".
Expand Down
5 changes: 0 additions & 5 deletions script/AddStrategies.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import {ScriptUtil} from "./ScriptUtil.s.sol";
import {EulerEarn} from "../src/EulerEarn.sol";

/// @title Script to add strategies to an existent Euler Earn vault.
// to run:
// fill .env
// Run: source .env
// fil relevant json file
// Run: forge script ./script/AddStrategies.s.sol --rpc-url arbitrum --broadcast --slow -vvvvvv
contract AddStrategies is ScriptUtil {
error InputsMismatch();

Expand Down
5 changes: 0 additions & 5 deletions script/AdjustAllocationPoints.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import {ScriptUtil} from "./ScriptUtil.s.sol";
import {EulerEarn} from "../src/EulerEarn.sol";

/// @title Script to add strategies to an existent Euler Earn vault.
// to run:
// fill .env
// Run: source .env
// fil relevant json file
// Run: forge script ./script/AdjustAllocationPoints.s.sol --rpc-url arbitrum --broadcast --slow -vvvvvv
contract AdjustAllocationPoints is ScriptUtil {
error InputsMismatch();

Expand Down
5 changes: 0 additions & 5 deletions script/DeployEulerEarn.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import {EulerEarnFactory} from "../src/EulerEarnFactory.sol";
import {ConstantsLib} from "../src/lib/ConstantsLib.sol";

/// @title Script to deploy new Euler Earn vault by calling factory, granting all roles and their admin roles to deployer address.
// to run:
// fill .env
// Run: source .env
// fil relevant json file
// Run: forge script ./script/DeployEulerEarn.s.sol --rpc-url arbitrum --broadcast --slow -vvvvvv
contract DeployEulerEarn is ScriptUtil {
/// @dev EulerEarnFactory contract.
EulerEarnFactory eulerEulerEarnFactory;
Expand Down
5 changes: 0 additions & 5 deletions script/Harvest.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import {ScriptUtil} from "./ScriptUtil.s.sol";
import {EulerEarn} from "../src/EulerEarn.sol";

/// @title Script to add strategies to an existent Euler Earn vault.
// to run:
// fill .env
// Run: source .env
// fil relevant json file
// Run: forge script ./script/Harvest.s.sol --rpc-url arbitrum --broadcast --slow -vvvvvv
contract Harvest is ScriptUtil {
error InputsMismatch();

Expand Down
52 changes: 52 additions & 0 deletions script/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Scripts

In this directory, you can find helper `forge` scripts to interact with Euler Earn protocol.
The scripts allows to:
- Deploy Euler Earn protocol.
- Deploy a new Earn vault.
- Add strategies to an existent Earn vault.
- Remove strategies from an existent Earn vault.
- Rebalance Earn vault.
- Adjust strategies allocation points.
- Harvest

Every script takes inputs via a `ScriptName_input.json` file inside the json directory.

Before running the scripts, please make sure to fill the `.env` file following the `.env.example`. The main env variables for the script to succefully run, are `WALLET_PRIVATE_KEY` and the `NETWORK_RPC_URL`.

After filling the `.env` file, make sure to run: `source .env` in your terminal.

## Deploy Euler Earn protocol

- Fill the `DeployProtocol_input.json` file with the needed inputs.
- Run `forge script ./script/DeployProtocol.s.sol --rpc-url network_name --broadcast --slow`

## Deploy a new Earn vault

- Fill the `DeployEulerEarn_input.json` file with the needed inputs.
- Run `forge script ./script/DeployEulerEarn.s.sol --rpc-url network_name --broadcast --slow`

## Add strategies to an existent Earn vault

- Fill the `AddStrategies_input.json` file with the needed inputs.
- Run `forge script ./script/AddStrategies.s.sol --rpc-url network_name --broadcast --slow`

## Remove strategies from an existent Earn vault

- Fill the `RemoveStrategies_input.json` file with the needed inputs.
- Run `forge script ./script/RemoveStrategies.s.sol --rpc-url network_name --broadcast --slow`

## Rebalance Earn vault

- Fill the `Rebalance_input.json` file with the needed inputs.
- Run `forge script ./script/Rebalance.s.sol --rpc-url network_name --broadcast --slow`

## Adjust strategies allocation points

- Fill the `AdjustAllocationPoints_input.json` file with the needed inputs.
- Run `forge script ./script/AdjustAllocationPoints.s.sol --rpc-url network_name --broadcast --slow`

## Harvest

- Fill the `Harvest_input.json` file with the needed inputs.
- Run `forge script ./script/Harvest.s.sol --rpc-url network_name --broadcast --slow`
5 changes: 0 additions & 5 deletions script/Rebalance.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import {ScriptUtil} from "./ScriptUtil.s.sol";
import {EulerEarn} from "../src/EulerEarn.sol";

/// @title Script to add strategies to an existent Euler Earn vault.
// to run:
// fill .env
// Run: source .env
// fil relevant json file
// Run: forge script ./script/Rebalance.s.sol --rpc-url arbitrum --broadcast --slow -vvvvvv
contract Rebalance is ScriptUtil {
error InputsMismatch();

Expand Down
5 changes: 0 additions & 5 deletions script/RemoveStrategies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import {ScriptUtil} from "./ScriptUtil.s.sol";
import {EulerEarn} from "../src/EulerEarn.sol";

/// @title Script to add strategies to an existent Euler Earn vault.
// to run:
// fill .env
// Run: source .env
// fil relevant json file
// Run: forge script ./script/RemoveStrategies.s.sol --rpc-url arbitrum --broadcast --slow -vvvvvv
contract RemoveStrategies is ScriptUtil {
error InputsMismatch();

Expand Down

0 comments on commit e86dc37

Please sign in to comment.