New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@oasisprotocol/sapphire-contracts

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oasisprotocol/sapphire-contracts

Solidity smart contract library for confidential contract development

  • 0.2.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
97
increased by193.94%
Maintainers
6
Weekly downloads
 
Created
Source

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 {Sapphire} from "@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!

FAQs

Package last updated on 03 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc