Project structure for writing smart contracts for NEAR in Rust.
- Rust & Cargo
- With the WASM target installed:
rustup target add wasm32-unknown-unknown - cargo-make:
cargo install cargo-make
- With the WASM target installed:
Removes the target and neardev directories.
Runs unit tests using the default target. (Note: behavior may differ from simply running cargo test depending on the target specified in .cargo/config.toml.)
Compiles the smart contract to a WebAssembly binary. The binary path is ./target/wasm32-unknown-unknown/release/<package>.wasm.
Cleans up and optimizes the most recently-built WASM binary. The optimized binary path is ./deploy/<name>.wasm.
Note: In order to optimize the WASM binary, you must have wasm-tools installed:
cargo install wasm-toolswasm-tools is also available on Homebrew:
brew install wasm-tools- Jacob Lindahl jacob.lindahl@near.org @sudo_build