Skip to content

Commit

Permalink
add README for evmemulator
Browse files Browse the repository at this point in the history
  • Loading branch information
dessaya committed Sep 20, 2023
1 parent 554d921 commit 81f1658
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
37 changes: 37 additions & 0 deletions tools/evm/evmemulator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# evmemulator

The `evmemulator` tool provides a JSONRPC server with Solo as a backend, allowing
to test Ethereum contracts.

## Example: Uniswap test suite

The following commands will clone and run the Uniswap contract tests against ISC's EVM.

Start the `evmemulator`:

```
evmemulator
```

In another terminal, clone uniswap:

```
git clone https://github.com/Uniswap/uniswap-v3-core.git
yarn install
npx hardhat compile
```

Edit `hardhat.config.ts`, section `networks`:

```
wasp: {
chainId: 1074,
url: 'http://localhost:8545',
},
```

Run the test suite:

```
npx hardhat test --network wasp
```
9 changes: 5 additions & 4 deletions tools/evm/evmemulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ func main() {
evmemulator does the following:
- Starts a Solo environment (a framework for running local ISC chains in-memory)
- Deploys an ISC chain
- Starts an ISC chain in a Solo environment
- Initializes 10 ethereum accounts with funds (private keys and addresses printed after init)
- Starts a JSON-RPC server
- Starts a JSONRPC server
You can connect any Ethereum tool (eg Metamask) to this JSON-RPC server and use it for testing Ethereum contracts running on ISCP.
You can connect any Ethereum tool (eg Metamask) to this JSON-RPC server and use it for testing Ethereum contracts.
Note: chain data is stored in-memory and will be lost upon termination.
`,
),
}
Expand Down

0 comments on commit 81f1658

Please sign in to comment.