Skip to content

ERC-4626 is an Ethereum token standard designed to create a uniform interface for yield-bearing vaults. It builds upon the ERC-20 token standard and provides a framework for tokens that represent shares of a vault containing underlying yield-generating assets

Notifications You must be signed in to change notification settings

Jamill-hallak/ERC-4626-implementation-Ethers-V6

Repository files navigation

ERC-4626 Implementation with Unit Tests

This project implements the ERC-4626 Tokenized Vault Standard using Solidity. It includes comprehensive unit tests to verify the functionalities of the vault contract. The project uses Hardhat and TypeScript for the development and testing environment.

Contracts

MyERC4626Vault

A vault contract that implements the ERC-4626 standard. It allows for deposits, withdrawals, minting, and redeeming of shares in exchange for underlying assets.

TestERC20

A simple ERC20 token contract used for testing purposes.

Project Setup

  1. Clone the repository:
    git clone https://github.com/Jamill-hallak/ERC-4626-implementation.git
    cd ERC-4626-implementation
    npm install
    Compile contracts:
    npx hardhat compile
    Run unit tests:
    npx hardhat test
    
    

The unit tests cover various functionalities of the MyERC4626Vault contract, including deposits, withdrawals, minting, and redeeming of shares.

Example Output

Below is a screenshot of the successful unit tests: Screenshot 2024-07-19 004841

File Structure

  • contracts/ MyERC4626Vault.sol : Implementation of the ERC-4626 vault.

    TestERC20.sol : Simple ERC20 token for testing.

  • test/ MyERC4626Vault.test.ts : Unit tests for the vault contract.

License

This project is licensed under the MIT License.

About

ERC-4626 is an Ethereum token standard designed to create a uniform interface for yield-bearing vaults. It builds upon the ERC-20 token standard and provides a framework for tokens that represent shares of a vault containing underlying yield-generating assets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published