Skip to content

About

An educational DeFi project that demonstrates a simplified ETH restaking flow using Solidity and Foundry, focusing on protocol composability and smart contract orchestration.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DeFi Restaking Simulation

Author: Gading Condro Prakoso
Project Type: Pelita Bangsa Academy Bootcamp Mini Project (Blockchain / DeFi)


Restaking Flow

This project simulates a simplified ETH restaking flow in DeFi:

  1. A user sends ETH to the RestakeManager contract.
  2. ETH is staked via a mock Lido contract, minting stETH.
  3. stETH is wrapped into wstETH to simulate non-rebasing behavior.
  4. wstETH is supplied to a mock Aave contract as collateral on behalf of the user.

The entire flow is orchestrated through a single entry-point contract (RestakeManager) to demonstrate DeFi protocol composability.


Contract Overview

Lido.sol

Simulates the Lido staking mechanism.
The submit() function accepts ETH and mints stETH at a 1:1 ratio as a representation of staked ETH.

WstETH.sol

Implements an ERC20 wrapper pattern for stETH.
wstETH represents a fixed-balance wrapped token, improving compatibility with DeFi protocols.

Aave.sol

Simulates a lending protocol by recording supplied collateral.
Only supply() and withdraw() logic are implemented.

RestakeManager.sol

Acts as the main orchestrator of the restaking flow.
It coordinates staking, wrapping, and collateral supply across multiple contracts and includes basic safety mechanisms such as custom errors and an optional pause (circuit breaker).


About

An educational DeFi project that demonstrates a simplified ETH restaking flow using Solidity and Foundry, focusing on protocol composability and smart contract orchestration.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages