For EVM developers

NEAR by Example

Learn NEAR smart contracts the way you already think — in Solidity. Every concept is shown side by side: the Solidity you know on the left, the NEAR equivalent (Rust) on the right. Compact, complete, and (soon) compile-verified.

The Rosetta table

The quick EVM → NEAR lookup. A blank cell means there’s no direct analog on that side.

Solidity / EVMNEAR
ERC-20NEP-141Fungible token
ERC-721NEP-171NFT
ERC-1155NEP-245Multi-token
addressAccountIdNamed accounts (alice.near), not 20-byte hashes
msg.senderenv::predecessor_account_id()
tx.originenv::signer_account_id()
msg.valueenv::attached_deposit()NearToken (yocto-NEAR)
wei (10^18)yocto-NEAR (10^24)
mapping(k => v)LookupMap / UnorderedMapExplicit, from near_sdk::store
require / revertassert! / env::panic_strRolls back, refunds unused gas
constantconst (module level)
view / pure&self methodA receiver, not a keyword
payable#[payable]
emit Event(...)env::log_str (NEP-297 JSON)
approve + transferFromft_transfer_callTransfer-and-call; no allowance
proxy upgrade patternDeployContract actionNative self-upgrade
EIP-712 / meta-txNEP-366 + access keysNative account abstraction
selfdestruct—No equivalent (accounts deleted explicitly)

Chapters