EVM interpreter as a NEAR smart contract.
It uses the EVM interpreter from parity-ethereum.
To develop Rust contracts you would need to:
- Install Rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Add wasm target to your toolchain (if you already have installed Rust make sure to switch to
rustup default stable
):
rustup target add wasm32-unknown-unknown
$ ./build.sh
This will build the contract code in res/near_evm.wasm
.
Deploy contract on TestNet:
- Make sure you have the newest version of near-shell installed by running:
npm install -g near-shell
-
If you are using TestNet, call
near login
(if you are using local node useNODE_ENV=development
before commands below). -
Create contract's account, e.g. we will use
evm
:
near create_account evm --masterAccount=<account you used in near login/test.near for local>
- Deploy the compiled contract from
res/near_evm.wasm
at the building step:
near deploy --accountId=evm --wasmFile=res/near_evm.wasm
- TODO: hackery to actually deploy your EVM contract
- Build the evm contract
- Ensure truffle is installed
npm i -g truffle
- Build the test contracts
cd src/tests && ./build.sh
- build the Near EVM contract binary
cd ../.. && ./build.sh
- Run the all tests including integration test
cargo test --lib
- To run the RPC tests:
- Run a local NEAR node
- check out
nearcore
from github - compile and run
nearcore
-cd nearcore && python scripts/start_unittest.py --local --release
- Run the tests from this directory in another terminal window:
cargo test
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
- Install
nightly
rustup toolchain install nightly
- Run the Testing commands again