Build Neo N3 smart contracts with familiar Solana Anchor-style syntax. Production-ready framework with 100% Neo N3 feature coverage, comprehensive NEP standards support, and enterprise-grade security.
Write Neo N3 contracts with Anchor patterns you already know
#![no_std]
#![no_main]
use neo_contract::prelude::*;
declare_id!("MyNeoContract");
#[program]
pub mod my_contract {
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
let storage = Storage::get_context();
Storage::put(
storage,
ByteString::from_literal("owner"),
ctx.accounts.owner.key
);
Runtime::log(ByteString::from_literal("Initialized"));
Ok(())
}
pub fn transfer(ctx: Context<Transfer>, amount: Int256) -> Result<()> {
require!(
ctx.accounts.from.key == ctx.accounts.authority.key,
ContractError::Unauthorized
);
// Transfer logic here
emit!(TransferEvent {
from: ctx.accounts.from.key,
to: ctx.accounts.to.key,
amount,
});
Ok(())
}
}
#[derive(Accounts)]
pub struct Initialize<'info> {
pub owner: Signer<'info>,
}
#[derive(Accounts)]
pub struct Transfer<'info> {
pub authority: Signer<'info>,
pub from: Account<'info>,
pub to: Account<'info>,
}
#[event]
pub struct TransferEvent {
pub from: H160,
pub to: H160,
pub amount: Int256,
}
#[error_code]
pub enum ContractError {
#[msg("Unauthorized access")]
Unauthorized,
}
100% feature coverage with elegant Solana-style developer experience
Familiar #[program], Context<T>, and #[derive(Accounts)] patterns from Solana Anchor
Complete Neo N3 Oracle service integration for external data feeds
Full interoperability with all Neo N3 native contracts
Complete implementation of Neo Enhancement Proposals
Built-in security patterns and comprehensive validation
Integrated compiler for Neo Executable Format generation
Modular design for maximum flexibility and performance
Core library with Neo N3 runtime, storage, and native contract bindings
Procedural macros for Solana-style syntax and code generation
WASM to NEF bytecode translator with manifest generation
14 production-ready examples covering all use cases
Learn by example with 14 comprehensive smart contracts
Start building Neo N3 smart contracts in minutes
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
git clone https://github.com/r3e-network/neo-contract-rs
cd neo-contract-rs
cd examples/01-hello-world
cargo build --target wasm32-unknown-unknown --release
../../target/release/neo-compiler compile target/wasm32-unknown-unknown/release/hello_world.wasm
neoxp create
neoxp wallet create alice
neoxp contract deploy hello_world.nef alice
Everything you need to master Neo N3 development
Join the growing community of developers building the future of blockchain with Neo N3 and Rust