# Project #3: ERC20+ETH Wrapper

## ERC20 Wrapper

Users can exchange ERC20 TokenA for ERC20 TokenB via a contract called Wrapper. Wrapper contract will do a 1 for 1 exchange. (Similar to WETH contract)

### Objectives

1. Users can send a pre-specified ERC20 token to a Wrapper contract (also an ERC20).
2. Wrapper contract issues an equal number of Wrapper tokens to the sender.
3. Holder of wrapper tokens can claim their original ERC20 tokens, by burning wrapped tokens.

*The functions used will be similar to those in the Vault, but you will notice that now we use tokens as a system of record.*

### Contracts

* Create a mock token (inherit ERC20.sol)
* ERC20Wrapper.sol&#x20;

*ERC20Wrapper.sol will **store** mock tokens and issue out wrapper tokens for the same amount.*

### Testing

Focus will be on the ERC20Wrapper contract.

Testing states:

*

## Stretch Goals

Ether is not an ERC-20 token. Code a Wrapper that takes Ether as it's currency.

### Contract

ETHWrapper.sol

### Testing

StateZeroTest: (user has 1 ETH)

* Test if user can send ether, and receive the corresponding amount of wrapped tokens. (testReceive)

StateUserWithWrappedETHTest: (user has 0.5 ETH, 0.5 WETH)

* Test if user can receive their ETH back, by calling unwrap (testUnwrap)

## Deployment


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://calnix.gitbook.io/eth-dev/learning-solidity/project-3-erc20+eth-wrapper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
