Archives: Docs

Docs

Notes on Serialization

Login with NEARSmart contracts need to be able to communicate complex data in a simple way, while also reading and storing such data into their states efficiently. To achieve such simple communication and efficient storage, smart contracts morph the data from their complex representation into simpler ones. This process of translating complex objects into simpler …

Notes on Serialization Read More »

State

Login with NEARSmart contracts store data in their account’s state, which is public on the chain. The storage starts empty until a contract is deployed and the state is initialized. It is important to know that the account’s code and account’s storage are independent. Updating the code does not erase the state. ### Defining the …

State Read More »

Serialization Protocols

Login with NEARSerialization formats within the SDK define how data structures are translated into bytes which are needed for passing data into methods of the smart contract or storing data in state. For the case of method parameters, JSON (default) and Borsh are supported with the SDK and for storing data on-chain Borsh is used. …

Serialization Protocols Read More »

Reproducible Builds

Login with NEARReproducible builds let different people build the same program and get the exact same outputs as one another. It helps users trust that deployed contracts are built correctly and correspond to the source code. To verify your contract user can build it themselves and check that the binaries are identical. Problem If you …

Reproducible Builds Read More »

Reducing Contract Size

Login with NEARReducing a contract’s size This page is made for developers familiar with lower-level concepts who wish to reduce their contract size significantly, perhaps at the expense of code readability. Some common scenarios where this approach may be helpful: contracts intended to be tied to one’s account management contracts deployed using a factory future …

Reducing Contract Size Read More »

External Interface

Login with NEARSmart contracts expose functions so users can interact with them. There are different types of functions including read-only, private and payable. ### Contract’s Interface All **public** functions in the contract are part of its **interface**. They can be called by anyone, and are the only way to interact with the contract. Exposing trait …

External Interface Read More »

Scroll to Top