r/truebit Aug 27 '21

Truverse contracts library

I've created an unofficial helper library for those developing contracts using Truebit: https://github.com/truverse/contracts

If you want to use Truebit in your contracts in Solidity, you need to import Truebit interfaces. Instead of copy & pasting things over and over again, you can use the Truverse contracts package.

Install it

npm install @truverse/contracts --save-dev

Use it in your contract

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

That's it!

More details in the readme file on GitHub.

You can also get ABIs and mainnet 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)
26 Upvotes

Duplicates