Smart Contract

Simulation Testing (Rust)

Login with NEARBefore we Start This article do not show the possibilities a simulation testing framework can do; it discusses about how to create an MVP simulation testing framework for your project. For more advanced changes, do your own research (DYOR) and check out some links one included in this article. NOTE: Simulation tests will go deprecated as …

Simulation Testing (Rust) Read More »

NEAR Live Contract Review | Part 3: Whitelist and Staking Pool Factory

Login with NEARIntroduction Hello, everyone. Today we’re going to review 2 contracts instead of 1. We will include contracts that involve cross contract calls, and talk about promises, and how they work at NEAR. If you want to learn more about how composability works this is a good session to read. The first contract that …

NEAR Live Contract Review | Part 3: Whitelist and Staking Pool Factory Read More »

Learn NEAR Club banner

NEAR Smart Contracts in RUST – Best Practices

Login with NEARInit once Make sure you check that state doesn’t exists in init using assert!(!env::state_exists(), “The contract is already initialized”); Prevent Default By default near_sdk allows contract to be initialized with default state. Usually, if you have a constructor, you want to prevent default state initialization. impl Default for Contract { fn default() -> Self { env::panic(b”The contract …

NEAR Smart Contracts in RUST – Best Practices Read More »

Scroll to Top