Skip to content

A liquid restaking protocol which enables users to stake LIDO's stETH into EigenLayer to earn extra rewards.

License

Notifications You must be signed in to change notification settings

ValentineCodes/yield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Yield | Liquid Restaking Protocol

A protocol which enables users to stake LIDO's stETH into EigenLayer to earn extra rewards. The system takes stETH deposits and mints the right amount of Yield Token(yETH) based on the user's deposit, taking in consideration the total assets in the system and their appreciation over time based on staking rewards. Users can also withdraw their staked ETH but only after it has been withdrawn from EigenLayer by the admin.

The admin, A Safe MultiSig Wallet, controls features such as pausing Yield Token transfers, withdrawing stETH from EigenLayer, delegating and undelegating operators.

Yield Protocol

Environment Setup

Before you begin, you need to install the following tools:

Then download the challenge to your computer and install dependencies by running:

git clone https://github.com/ValentineCodes/yield.git
cd yield
yarn install

Run tests - Must have data connection due to Holesky testnet fork

yarn test

In the same terminal, deploy contracts to Holesky testnet

Must set the enviromnent variables in foundry as specified in .env.example and the signers in Deploy.s.sol

yarn deploy:verify

in a second terminal, start your frontend:

yarn start

πŸ“± Open http://localhost:3000 to see the app.

In a third terminal window, run your local backend server:

cd yield
yarn backend-local

Configure Owners πŸ–‹

πŸ” The first step is to configure the owners, who will be able to propose, sign and execute transactions.

You can set the signers in the frontend, using the "Owners" tab:

multisig-1

In this tab you can start your transaction proposal to either add or remove owners.

πŸ“ Fill the form and click on "Create Tx".

multisig-2

This will take you to a populated transaction at "Create" page:

multisig-3

Create & sign the new transaction, clicking in the "Create" button:

multisig-4

You will see the new transaction in the pool (this is all offchain).

You won't be able to sign it because on creation it already has one signature (from the frontend account).

Click on the ellipsses button [...] to read the details of the transaction.

multisig-5

⛽️ Give your account some gas at the faucet and execute the transaction.

β˜‘ Click on "Exec" to execute it, will be marked as "Completed" on the "Pool" tab, and will appear in the "Multisig" tab with the rest of executed transactions.

multisig-6a

multisig-6b

Transfer Funds πŸ’Έ

You'll need to fund your Multisig Wallet

You can find the address of the Multisig in the "Multisig" and "Debug Contracts" tabs.

Create a transaction in the "Create" tab to send some funds to one of your signers, or to any other address of your choice:

multisig-7

πŸ–‹ This time we will need a second signature (remember we've just updated the number of signatures required to execute a transaction to 2).

multisig-8

Switch account and sign the transaction with enough owners:

multisig-9

(You'll notice you don't need ⛽️gas to sign transactions).

Execute the transaction to transfer the funds:

multisig-10

Delegate and Undelegate an Operator 🀲

Delegate and Undelegate

πŸ–‹ This will take you to the Pool to sign and execute the transaction

Queue Withdrawal ⏳

πŸ–‹ Withdrawals on EigenLayer take a while to complete. Queued withdrawals will appear like this πŸ‘‡ after being executed.

Queue Withdrawal

Complete Withdrawal βŒ›οΈ

πŸ–‹ After the minWithdrawalDelayBlocks(currently 10) is passed from the time of queue execution, You can complete withdrawal

Complete Withdrawal

Deposit stETH πŸ’°

πŸ–‹ You can deposit stETH into EigenLayer and get some yETH token

Deposit StETH

(This will fail if there's no delegated operator in the system)

Withdraw stETH πŸ€‘

πŸ–‹ You can withdraw your staked stETH by burning your specified yETH tokens

Withdraw StETH

(This will fail if admin has not completely withdrawn staked stETH from EigenLayer)

About

A liquid restaking protocol which enables users to stake LIDO's stETH into EigenLayer to earn extra rewards.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 25