hats-finance / Euro-Dollar-0xa4ccd3b6daa763f729ad59eae75f9cbff7baf2cd

Audit competition repository for Euro-Dollar (0xa4ccd3b6daa763f729ad59eae75f9cbff7baf2cd)
https://hats.finance
MIT License
0 stars 0 forks source link

Eurodollar Protocol

System overview

The Eurodollar Protocol consists of two types of tokens, USDE a compliant USD stablecoin and InvestToken (EUI), for compliant yield tokens, and a price oracle, which allows seamless conversion between the two tokens. The system is designed to be compliant with EU regulation regarding stablecoins (MICA) and security tokens (MIFID2).

The solutions utilizes OpenZeppelin contracts for the tokens, to ensure upgradeability is implemented.

USDE

The stablecoin ERC20 token contract. Implements following functionality:

InvestToken

The yield-bearing ERC4626 token contract. Implements following functionality:

YieldOracle

Smart-contract for providing the conversion price between the stablecoin and an yield bearing token. Implements following functionality:

Validator

Smart-contract keeping track of the transfer persmission state of an address. Each address can be in 1 of 3 states:

These states have corresponding set functions (allowing one or more accounts) and are relevant for the view functions:

Getting Started

Prerequisites

Installation

  1. Install dependencies:
    forge install

Building

  1. Compile the contracts:
    forge build

Deployment

  1. Copy .env.example to .env and set your private key.

  2. Check script/Deploy.s.sol if you want to modify parameters.

  3. Run deployment script. For example, testing locally (anvil environment):

    forge script script/Deploy.s.sol
    --fork-url http://localhost:8545
    --broadcast