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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@truverse/contracts

v0.0.2

Published

Truebit contract interfaces and ABI.

Downloads

7

Readme

Truebit Contracts

Truebit contract interfaces and ABI.

Interfaces in Solidity

Install this package

npm install @truverse/contracts

Use it in your contract

import "@truverse/contracts/Truebit.sol";

You can also import individual interfaces

import "@truverse/contracts/truebit/TRU.sol";
import "@truverse/contracts/truebit/Purchase.sol";

ABI and adresses in JSON

ABI and addresses

const truebit = require('@truverse/contracts').mainnet

const fs = new web3.eth.Contract(truebit.filesystem.abi, truebit.filesystem.address)
const tru = new web3.eth.Contract(truebit.tru.abi, truebit.tru.address)

ABI

const abi = require('@truverse/contracts/abi')

const fs = new web3.eth.Contract(abi.filesystem)
const tru = new web3.eth.Contract(abi.tru)

Addresses

const abi = require('@truverse/contracts/abi')
const chain = require('@truverse/contracts/chains/mainnet')

const fs = new web3.eth.Contract(abi.filesystem, chain.filesystem)
const tru = new web3.eth.Contract(abi.tru, chain.tru)

Contents

Truebit.sol is a single hand-crafted file that contains the following interfaces

  • Truebit (incentive layer)
  • FileSystem
  • TRU
  • Purchase

There are also automatically generated interfaces in individual files under truebit/

  • Incentive.sol
  • FileSystem.sol
  • TRU.sol
  • Purchase.sol
  • Interactive.sol
  • Judge.sol
  • IPFS.sol

Contract names

| Truebit.sol | truebit/X.sol | abi.json | truebit-eth | | ------------- | --------------- | ----------- | --------------- | | Truebit | Incentive | incentive | incentiveLayer | | FileSystem | FileSystem | filesystem | fileSystem | | TRU | TRU | tru | tru | | Purchase | Purchase | purchase | purchase | | n/a | Interactive | interactive | interactive | | n/a | Judge | judge | judge | | n/a | IPFS | ipfs | IPFSnodeManager |

Chains

| Chain | ID | Aliases | | ----------- | ----- | ---------------------- | | Ethereum | 1 | 1, mainnet, main | | Goerli | 5 | 5, goerli, görli |

Generation

Install abi-to-sol which is already in devDependencies

npm install

Generate Solidity interface files

VERSION="=0.5.0"
LICENSE="Apache-2.0"
jq .incentive   abi.json | npx abi-to-sol -V $VERSION -L $LICENSE Incentive   > truebit/Incentive.sol
jq .tru         abi.json | npx abi-to-sol -V $VERSION -L $LICENSE TRU         > truebit/TRU.sol
jq .purchase    abi.json | npx abi-to-sol -V $VERSION -L $LICENSE Purchase    > truebit/Purchase.sol
jq .filesystem  abi.json | npx abi-to-sol -V $VERSION -L $LICENSE FileSystem  > truebit/FileSystem.sol
jq .interactive abi.json | npx abi-to-sol -V $VERSION -L $LICENSE Interactive > truebit/Interactive.sol
jq .judge       abi.json | npx abi-to-sol -V $VERSION -L $LICENSE Judge       > truebit/Judge.sol
jq .ipfs        abi.json | npx abi-to-sol -V $VERSION -L $LICENSE IPFS        > truebit/IPFS.sol

# some bug in abi-to-sol that does not like >=0.5.0
sed -i '' -e 's/=0.5.0/>=0.5.0/g' $(find ./truebit -type f -name '*.sol')

License

Truebit is not open source but their previous codebase was released under Apache 2.0.

The generated interface files in this repository are licensed under Apache 2.0.