Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xBacked-DAO/reach-safe-math

This is a module built for the Reach framework. It is heavily inspired by the work OpenZepplin has done in the SafeMath.sol util.
https://github.com/xBacked-DAO/reach-safe-math

algorand blockchain defi reach-pkg

Last synced: 3 months ago
JSON representation

This is a module built for the Reach framework. It is heavily inspired by the work OpenZepplin has done in the SafeMath.sol util.

Awesome Lists containing this project

README

        

# reach-safe-math

This is a module built for the [Reach framework](https://reach.sh). It is heavily inspired by the work [OpenZepplin has done in the `SafeMath.sol` util](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol).

## Usage

[Reach Documentation](https://docs.reach.sh/ref-programs-module.html#%28part._ref-programs-import-package%29)

```
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
```

:warning: Note: this does not compile your program, run `./reach compile program.rsh` after the install and add `.reach` to your `.gitignore` file.