| 
1 |  | -## Foundry  | 
 | 1 | +# Euler Devland  | 
2 | 2 | 
 
  | 
3 |  | -**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**  | 
 | 3 | +Devland is a framework for running a simple testing blockchain (anvil) and installing a basic instance of the Euler contracts for development and testing purposes.  | 
4 | 4 | 
 
  | 
5 |  | -Foundry consists of:  | 
 | 5 | +* Fast and deterministic: The entire environment can be created and installed in a second or two. This lets you setup testing/dev scenarios and instantly reset them to the starting conditions, which is helpful for development. By editing the file `script/DeployDev.sol` you can create self-contained scenarios and send them to other devs, who can get started instantly.  | 
 | 6 | +* Lightweight: It does not use forge-style nested submodules. Instead, each project is checked out exactly once in a `libflat` directory, and then remappings are used to map depenencies for each project. This means that each repo is only checked out once, saving time and diskspace. However, it also means that only a single version of a dependency can be installed, globally.  | 
6 | 7 | 
 
  | 
7 |  | --   **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).  | 
8 |  | --   **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.  | 
9 |  | --   **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.  | 
10 |  | --   **Chisel**: Fast, utilitarian, and verbose solidity REPL.  | 
 | 8 | +## Usage  | 
11 | 9 | 
 
  | 
12 |  | -## Documentation  | 
 | 10 | +### Installation  | 
13 | 11 | 
 
  | 
14 |  | -https://book.getfoundry.sh/  | 
 | 12 | +First [install foundry](https://getfoundry.sh/) then run:  | 
15 | 13 | 
 
  | 
16 |  | -## Usage  | 
 | 14 | +    ./install.sh  | 
17 | 15 | 
 
  | 
18 |  | -### Build  | 
 | 16 | +### Run anvil  | 
19 | 17 | 
 
  | 
20 |  | -```shell  | 
21 |  | -$ forge build  | 
22 |  | -```  | 
 | 18 | +    ./run.sh  | 
23 | 19 | 
 
  | 
24 |  | -### Test  | 
 | 20 | +If all goes well, your RPC will be available on the standard `http://127.0.0.1:8545` endpoint.  | 
25 | 21 | 
 
  | 
26 |  | -```shell  | 
27 |  | -$ forge test  | 
28 |  | -```  | 
 | 22 | +### Private keys  | 
29 | 23 | 
 
  | 
30 |  | -### Format  | 
 | 24 | +The default is just to use the standard anvil mnemonic. For example this is user 0:  | 
31 | 25 | 
 
  | 
32 |  | -```shell  | 
33 |  | -$ forge fmt  | 
34 |  | -```  | 
 | 26 | +* Private key: `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`  | 
 | 27 | +* Address: `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266`  | 
35 | 28 | 
 
  | 
36 |  | -### Gas Snapshots  | 
 | 29 | +Import the above private key into metamask, and then change network to Foundry (chain id 31337).  | 
37 | 30 | 
 
  | 
38 |  | -```shell  | 
39 |  | -$ forge snapshot  | 
40 |  | -```  | 
41 | 31 | 
 
  | 
42 |  | -### Anvil  | 
 | 32 | +## Extras  | 
43 | 33 | 
 
  | 
44 |  | -```shell  | 
45 |  | -$ anvil  | 
46 |  | -```  | 
 | 34 | +Devland also sets up some configuration files for the dev network. They are in the same format as production for ease of integration:  | 
47 | 35 | 
 
  | 
48 |  | -### Deploy  | 
 | 36 | +* `dev-ctx/EulerChains.json` - A chain manifest in the same format as [EulerChains.json](https://github.com/euler-xyz/euler-interfaces/blob/master/EulerChains.json)  | 
 | 37 | +* `dev-ctx/labels/31337/products.json` - A `products.json` in the same format as [euler-labels](https://github.com/euler-xyz/euler-labels/blob/master/1/products.json)  | 
 | 38 | +* `dev-ctx/addresses/31337/CoreAddresses.json` - Address files in the same format as [euler-interfaces](https://github.com/euler-xyz/euler-interfaces/blob/master/addresses/1/CoreAddresses.json)  | 
 | 39 | +* `dev-ctx/priceapi/31337/prices.json` - A sample output from the [prices API](https://app.euler.finance/api/v1/price?chainId=1).  | 
49 | 40 | 
 
  | 
50 |  | -```shell  | 
51 |  | -$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>  | 
52 |  | -```  | 
53 | 41 | 
 
  | 
54 |  | -### Cast  | 
55 | 42 | 
 
  | 
56 |  | -```shell  | 
57 |  | -$ cast <subcommand>  | 
58 |  | -```  | 
 | 43 | +## Deploy MaglevLens:  | 
59 | 44 | 
 
  | 
60 |  | -### Help  | 
 | 45 | +For now, this repo also contains some lens code, until it can find a better home. To deploy, put a `WALLET_PRIVATE_KEY` into `.env` and then run:  | 
61 | 46 | 
 
  | 
62 |  | -```shell  | 
63 |  | -$ forge --help  | 
64 |  | -$ anvil --help  | 
65 |  | -$ cast --help  | 
66 |  | -```  | 
 | 47 | +    forge script ./script/DeployMaglevLens.s.sol --rpc-url $RPC_URL --broadcast --slow  | 
0 commit comments