From 81f1658008aec00d88242e568d4f7f5a6682117b Mon Sep 17 00:00:00 2001 From: Diego Essaya Date: Wed, 20 Sep 2023 18:50:57 -0300 Subject: [PATCH] add README for evmemulator --- tools/evm/evmemulator/README.md | 37 +++++++++++++++++++++++++++++++++ tools/evm/evmemulator/main.go | 9 ++++---- 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 tools/evm/evmemulator/README.md diff --git a/tools/evm/evmemulator/README.md b/tools/evm/evmemulator/README.md new file mode 100644 index 0000000000..a325ca7f68 --- /dev/null +++ b/tools/evm/evmemulator/README.md @@ -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 +``` diff --git a/tools/evm/evmemulator/main.go b/tools/evm/evmemulator/main.go index 36d407783b..d1df4224e3 100644 --- a/tools/evm/evmemulator/main.go +++ b/tools/evm/evmemulator/main.go @@ -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. `, ), }