Skip to content

Commit

Permalink
Merge pull request #11 from morpho-org/feat/add-readme
Browse files Browse the repository at this point in the history
feat: add README
  • Loading branch information
MerlinEgalite authored Oct 17, 2024
2 parents e5dff0a + 71f9250 commit 58fa5a2
Showing 1 changed file with 20 additions and 44 deletions.
64 changes: 20 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,42 @@
## Foundry
# Morpho Token

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
This repository contains the latest version of the Morpho protocol’s ERC20 token, designed to enhance functionality, security, and compatibility within the Morpho ecosystem. This new version introduces upgradability and onchain delegation features, allowing for greater flexibility and adaptability over time. Additionally, it includes a wrapper contract to facilitate a seamless migration from the previous token version, enabling users to transition their assets with minimal friction.

Foundry consists of:
## Upgradability

- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
The Morpho Token leverages the eip-1967 to enable upgrade of the logic. This will allow new features to be added in the future.

## Documentation
## Delegation

https://book.getfoundry.sh/
The Morpho Token enables onchain voting power delegation. The contract keeps track of all the addresses current voting power, which allows onchain votes thanks to storage proofs (on specific voting contracts).

## Usage

### Build

```shell
$ forge build
```

### Test

```shell
$ forge test
```
## Migration

### Format
### Wrapper Contract

```shell
$ forge fmt
```
The `Wrapper` contract is designed to facilitate the migration of legacy tokens to the new token version at a 1:1 ratio. By implementing `depositFor` and `withdrawTo` functions, this contract ensures compliance with `ERC20WrapperBundler` from the [Morpho bundler](https://github.com/morpho-org/morpho-blue-bundlers) contracts, enabling one-click migrations that simplify the transition process.
The `Wrapper` contract will hold the migrated legacy tokens.

### Gas Snapshots
### Migration Flow

```shell
$ forge snapshot
```
N.B. The `Wrapper` contract must be deployed before the new token's initialization.

### Anvil
At the token's initialization, 1B tokens will be minted for the `Wrapper` contract, which will initially hold the entire supply.

```shell
$ anvil
```
Any legacy token holder will then be able to migrate their tokens by calling the `depositFor` function of the `Wrapper` contract (Having previously approved the migration amount to the wrapper).

### Deploy
Migrated legacy tokens can be recovered thanks to the `withdrawTo`, that allows to revert a migration.

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```
## Usage

### Cast
### Install dependencies

```shell
$ cast <subcommand>
$ forge install
```

### Help
### Test

```shell
$ forge --help
$ anvil --help
$ cast --help
$ forge test
```

0 comments on commit 58fa5a2

Please sign in to comment.