npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@arrng/contracts

v1.5.0

Published

arrng solidity contracts package

Readme

arrng contract package

A library to implement arrng for verifiable rng in blockchain apps. aarng implements an oracle to serve signed randomness from random.org to a number of chains, including:

  • mainnet
  • blessnet
  • arbitrum one
  • optimism
  • polygon
  • eth sepolia
  • blessnet sepolia

For more details please see https://www.arrng.io/.

Overview

Installation

$ npm install @arrng/contracts

An alternative to npm is to use the GitHub repository (arrng/arrng-contracts) to retrieve the contracts.

Usage

Once installed, use arrng by importing the consumer contract. Either pass in the arrng controller address on your constructor or use the hardcoded address below.

aarng is at 0x000000000000507620846e6A03237350fD7eD4d5 on all supported chains.

pragma solidity ^0.8.0;

import "@arrng/contracts/ArrngConsumer.sol";

contract MyArrngConsumer is ArrngConsumer {
    constructor() ArrngConsumer(0x000000000000507620846e6A03237350fD7eD4d5) {
    }
}

If you're new to smart contract development, we recommend heading to openzeppelin for a great guide to Developing Smart Contracts, to learn about creating a new project and compiling your contracts.

To request randomness from arrng (for example one number):

iD = arrngController.requestRandomWords {value: msg.value} (1);

The iD returned is a uint256 which uniquely identifies your request on that chain. You will need to send enough native token (e.g. ETH) for the response with the random number. This is served by api.arrng.io. See https://www.arrng.io/ for details.

The arrng oracle will wait for six confirmations before responding. To receive the response and use it in your contract you will need to include the fullfillRandomWords internal function.

See an example contract at https://github.com/arrng/arrng-contracts/blob/main/contracts/mock/MockConsumer.sol.