EVM interpreter as a NEAR smart contract.
It uses the EVM interpreter from SputnikVM.
To develop Rust contracts you would need to:
- Install Rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Add a WebAssembly target to your Rust toolchain:
rustup target add wasm32-unknown-unknown --toolchain stable
$ ./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 the NEAR CLI installed by running:
npm install -g near-cli
-
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 you must 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
- Check out
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