This is a module built for the Reach framework. It is heavily inspired by the work OpenZepplin has done in the SafeMath.sol
util.
import * as safeMath from '@xBacked-DAO/reach-safe-math';
Alternatively
import { tryDiv } from '@xBacked-DAO/reach-safe-math';
Then, to install the packages so compilation works use the install-pkgs
flag like below.
./reach compile program.rsh --install-pkgs
./reach compile program.rsh
after the install and add .reach
to your .gitignore
file.