near / near-evm

Obsolete EVM contract experiments. Find current development at: https://github.com/aurora-is-near/aurora-engine
GNU General Public License v3.0
32 stars 11 forks source link

:warning: This repository contains obsolete EVM contract experiments.

Find current development at: https://github.com/aurora-is-near/aurora-engine

NEAR EVM

EVM interpreter as a NEAR smart contract. This uses the EVM interpreter from SputnikVM.

Network Account
LocalNet evm.test.near
BetaNet evm.$MYACCOUNT.betanet
TestNet evm.$MYACCOUNT.testnet

Prerequisites

To develop Rust contracts, change into the top-level directory in this repository, and do the following:

  1. Make sure you have the newest version of the NEAR CLI installed by running:

    npm install -g near-cli
  2. Install Rustup:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  3. Add a WebAssembly target to your Rust toolchain:

    rustup target add wasm32-unknown-unknown

Building

./build.sh

This will build the contract code in res/near_evm.wasm.

Deployment

Deploy the EVM contract:

Testing

  1. Build the EVM contract:

    1. Build the NEAR EVM contract binary:
      ./build.sh
    2. Ensure Truffle is installed:
      npm i -g truffle
    3. Build the test contracts:
      cd tests && ./build.sh
  2. Run the all tests including integration tests:

      cargo test --lib
  3. To run the RPC tests you must run a local NEAR node:

    1. Check out nearcore from GitHub.
    2. Compile and run nearcore:
      cd nearcore && python scripts/start_unittest.py --local --release
      1. Run the tests from this directory in another terminal window:
        cargo test

Troubleshooting

You may need to install nightly if you get an error similar to the following:

error[E0554]: `#![feature]` may not be used on the stable release channel
  1. Install nightly:
    rustup toolchain install nightly
  2. Run the Testing commands again.