Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/xBacked-DAO/reach-safe-math
- Owner: xBacked-DAO
- License: mit
- Created: 2021-09-26T05:26:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-26T00:59:40.000Z (almost 3 years ago)
- Last Synced: 2024-06-23T16:33:48.225Z (5 months ago)
- Topics: algorand, blockchain, defi, reach-pkg
- Language: Shell
- Homepage:
- Size: 11.7 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.