Tooling

Build & deploy

Compile to wasm, deploy to a named account you control, then call it. near call changes state; near view reads for free.

The build-and-ship loop maps almost one-to-one to Foundry, with two NEAR-isms: you compile to wasm, and you deploy to a named account you already control rather than to a fresh address.

The deploy loop
Shell
# build
forge build

# deploy (creates a new address)
forge create src/Counter.sol:Counter \
  --rpc-url $RPC --private-key $PK

# change call (a transaction, signed)
cast send $ADDR "increment()" --private-key $PK

# read call (free, no signature)
cast call $ADDR "count()(uint256)"
Shell
# build the contract to wasm
cargo near build

# deploy the wasm to an account you control
near deploy myapp.near ./target/near/contract.wasm

# change call (a transaction, signed & paid by you)
near call myapp.near increment --accountId you.near

# view call (read-only, free, no signature)
near view myapp.near get_count
Coming from EVM

forge build ↔ cargo near build (emits a .wasm). forge create ↔ near deploy — but the target is an existing account you own, not a freshly minted address.

cast send (state-changing, signed) ↔ near call; cast call (read-only, free) ↔ near view. The change-vs-view split is explicit in the command you run.

near (near-cli-rs) is interactive — run it with no arguments to be walked through account, network, and signing. The flags above are the scriptable form for CI.