A simple NEAR smart contract written in Zig that demonstrates basic greeting functionality.
-
First, install Zig (v0.13.0 recommended)
-
Build the contract:
zig build-exe sleet_hello.zig -target wasm32-freestanding -O ReleaseSmall --export=get_greeting --export=set_greeting -fno-entryThis will create sleet_hello.wasm file.
-
Install near-cli-rs
-
Deploy the contract to your NEAR account:
near deploy --wasmFile sleet_hello.wasm --accountId YOUR_ACCOUNT.nearnear view YOUR_ACCOUNT.near get_greetingnear call YOUR_ACCOUNT.near set_greeting '{"greeting":"Your new greeting"}' --accountId YOUR_ACCOUNT.nearReplace YOUR_ACCOUNT.near with your actual NEAR account name in all commands.
Returns the current greeting stored in the contract. If no greeting is set, returns the default greeting "Hello from Sleet!".
Sets a new greeting. The greeting cannot be empty.
This conrtact is deployed to hello.sleet.testnet and hello.sleet.near if you want to interact with it.
copright 2025 by sleet.near