0.2.11 • Published 10 months ago

@oasisprotocol/sapphire-contracts v0.2.11

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

Sapphire Contracts Lib

NPM npm

A library for privacy focused smart contract development.

  • Implementations of OPL smart contracts
  • Sapphire library precompiles and cryptographic primitives
  • Wrapped Rose example

Overview

Installation

$ pnpm install @oasisprotocol/sapphire-contracts

Usage

Once installed, you can import and use the Sapphire contracts as follows:

pragma solidity ^0.8.13;

import "@oasisprotocol/sapphire-contracts/contracts/Sapphire.sol";

contract RandomNumber {
  function generateNumber() public view returns (uint) {
    return uint(bytes32(Sapphire.randomBytes(32, "")));
  }
}

Documentation

See the user's guide for Sapphire and OPL.

The generated API reference is hosted at api.docs.oasis.io.

Generating API docs locally requires Foundry and mdbook-pagetoc. To install them and generate the docs execute:

curl -L https://foundry.paradigm.xyz | bash
cargo install mdbook-pagetoc
pnpm doc

The API docs index will be located in sol/sapphire-contracts/book/index.html.

Contribute

There are many ways you can participate and help build high quality software. Check out the contribution guide!

0.2.11

10 months ago

0.2.10

11 months ago

0.2.9

11 months ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago