Docs Category: 2.smart-contracts

Yield and Resume

Login with NEARNEAR smart contracts can yield execution, until an external service resumes them. In practice, the contract yields a cross-contract call to itself, until an external service executes a function and the contract decides to resume. This is a powerful feature that allows contracts to wait for external events, such as a response from …

Yield and Resume Read More »

SDK Types

Login with NEARLets discuss which types smart contracts use to input and output data, as well as how such data is stored and handled in the contract’s code. ### Native Types Smart contracts can receive, store and return data using JS native types: – `string` – `number` – `boolean` – `Array` – `Map` – `Object` …

SDK Types Read More »

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 »

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 »

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 »

Scroll to Top