Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
WIP: smart contract docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fiando committed Nov 24, 2024
1 parent 4f07a8d commit 4172549
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Eduena

## Eduena Frontend
[Eduena Frontend](https://github.com/Eduena-Endownment-Fund/eduena-web)

## Eduena Smart Contract

The `Eduena` smart contract is an ERC20 token that allows users to deposit and withdraw USDe tokens, stake them to earn yield, and distribute yield. It includes the following key functions:
Expand All @@ -6,8 +11,8 @@ The `Eduena` smart contract is an ERC20 token that allows users to deposit and w

#### Functions

- **deposit(uint256 amount)**: Allows users to deposit a specified amount of USDe tokens. The equivalent amount of Eduena tokens (EDN) is minted and assigned to the user.
- **withdraw(uint256 shares)**: Allows users to withdraw a specified amount of Eduena tokens (EDN). The equivalent amount of USDe tokens is transferred back to the user.
- **deposit(uint256 amount)**: Allows users to deposit a specified amount of USDe tokens and it immediately staked to sUSDe. The equivalent amount of Eduena tokens (EDN) is minted and assigned to the user.
- **withdraw(uint256 shares)**: Allows users to withdraw a specified amount of Eduena tokens (EDN). The equivalent amount of sUSDe tokens is transferred back to the user.
- **distribute(address recipient, uint256 amount)**: Distributes a specified amount of yield to a recipient.
- **updateYield()**: Updates the yield based on the current asset value in USDe.

Expand All @@ -27,7 +32,7 @@ The `Eduena` smart contract is an ERC20 token that allows users to deposit and w
- **ExceedsUnclaimedYield()**: Thrown when the amount exceeds the unclaimed yield.
- **NotEligibleForScholarship()**: Thrown when a user is not eligible for a scholarship.

### Testing
#### Testing

The `EduenaTest` contract in `test/Eduena.t.sol` includes tests for the deposit and withdrawal functionalities.

Expand All @@ -42,5 +47,4 @@ function testWithdraw() public {
function testDistributeScholarship() public {
// Test distribute scholarship functionality
}
```
}

0 comments on commit 4172549

Please sign in to comment.