Skip to main content

Cookbook

Deploy and call a smart contract via Nil.js

These short recipes demonstrate how to use Nil.js to deploy and call a smart contract.

Use the faucet service

These recipes demonstrate how to call the Faucet service via Nil.js.

Use Nil.js on the server

It is possible to use Nil.js in a Node.js environment, making it possible to perform server-side operations on =nil;. The Cookbook provides a simple Node.js project that handles new wallet creation entirely server-side.

Implement an 'English Auction'

The 'English Auction' is a smart contract that allows users to place bids over a certain period of time. When this time elapses, the address that placed the highest bid receives the NFT stored inside the auction contract.

Create a swap contract and custom currencies

This series of recipes show how to create a swap contract that can reliably exchange one custom currency with another even if the contracts representing these currencies are located on different shards.

The swap contract adopts order book-like mechanics by matching swap requests from different wallets. When requests are matched, the contract processes them and takes care of any excess tokens by sending them back to the request originators.

Create a multi-signature wallet

These recipes demonstrate how a multi-signature wallet can work on top of =nil;. The contract has all the usual characteristics of a multi-signature wallet while beign able to send the default token and custom currencies across different shards.