Skip to content

sCrypt-Inc/scrypt-ts-lib

Repository files navigation

CI-Test Build Status

scrypt-ts-lib

A collection of contracts and libraries for writing smart contracts with scrypt-ts.

Learn more about how to write smart contracts with sCrypt at https://scrypt.io.

Installation

Install scrypt-ts-lib to your project with this command:

npm install scrypt-ts-lib

Usage

You can use the contracts or libraries by importing them like this:

import { Mimc7 } from "scrypt-ts-lib";

or

import { Mimc7 } from "scrypt-ts-lib/dist/hash/mimc7";

Then use them in a contract like:

class MyContract extends SmartContract {
  @method
  public unlock(x: bigint, k: bigint, h: bigint) {
    // call imported library method
    assert(Mimc7.hash(x, k) == h);
  }
}

Contributing

Pull requests are welcome.

About

A library for building smart contracts with `scrypt-ts`.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages