# @0xcert/ethereum-utils-contracts

> General utility module with helper smart contracts.

Latest version **2.1.1** (published 2021-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @0xcert/ethereum-utils-contracts
pnpm add @0xcert/ethereum-utils-contracts
yarn add @0xcert/ethereum-utils-contracts
bun add @0xcert/ethereum-utils-contracts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-03-15 |
| First published | 2018-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 312.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 340 |
| Maintainers | xpepermint, moman |
| Keywords | 0xcert, framework, protocol, asset, value, values, currency, token, non-fungible, fungible, erc-721, erc-20, blockchain, javascript, typescript, nodejs, vuejs, nuxtjs, npm, libraries, smart-contract, ethereum, zxc |

## Links

- npm: https://www.npmjs.com/package/@0xcert/ethereum-utils-contracts
- Repository: https://github.com/0xcert/framework
- Homepage: https://github.com/0xcert/framework#readme
- Issues: https://github.com/0xcert/framework/issues
- npm.io page: https://npm.io/package/@0xcert/ethereum-utils-contracts

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2021-03-15
- 2.1.0 — 2021-01-14
- 2.0.3 — 2020-08-12
- 2.0.2 — 2020-05-04
- 2.0.1 — 2020-03-06
- 2.0.1-beta0 — 2020-03-05
- 2.0.0 — 2020-03-02
- 2.0.0-beta5 — 2020-02-22
- 2.0.0-beta4 — 2020-02-19
- 2.0.0-beta3 — 2020-02-05
- 2.0.0-beta2 — 2020-01-30
- 2.0.0-beta1 — 2020-01-20
- 2.0.0-beta — 2020-01-17
- 2.0.0-alpha17 — 2020-01-14
- 2.0.0-alpha16 — 2020-01-13
- … 60 more at https://npm.io/package/@0xcert/ethereum-utils-contracts/versions

## README

<img src="../../assets/cover-sub.png" />

> General utility module with helper smart contracts.

The [0xcert Framework](https://docs.0xcert.org) is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the [official documentation](https://docs.0xcert.org) for more details.

This module is one of the bricks of the [0xcert Framework](https://docs.0xcert.org). It's written with [TypeScript](https://www.typescriptlang.org) and it's actively maintained. The source code is available on [GitHub](https://github.com/0xcert/framework) where you can also find our [issue tracker](https://github.com/0xcert/framework/issues).

# Ethereum Utility Contracts

This module includes Solidity contracts which should be useful for any smart contract project.

## Safe math -- `safe-math.sol`

This library includes basic arithmetic operations for unsigned 256-bit integers. This is a modern, gas-efficient implementation which also includes error reporting.

This implementation is based on the [openzeppelin-solidity](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol) however the documentation and readability of the code is much improved. We hope this will help you to write more error-free code.

Example usage:

```solidity
pragma solidity ^0.5.6;
import "https://github.com/0xcert/framework/packages/0xcert-ethereum-utils-contracts/src/contracts/math/safe-math.sol";

contract MilitaryStrengthAdder
{
  using SafeMath for uint256;
    
  function add(
    uint256 _addend1,
    uint256 _addend2
  )
    external
    pure
    returns (uint256 sum)
  {
    return _addend1.add(_addend2);
  }
}
```

## Abilities -- `abilitable.sol`

This is a permissions model where you may assign different forms of permission on your contract to any address. Typically these permissions will be used to allow administrative tasks on a smart contract.

## Ownership -- `ownable.sol` and `claimable.sol`

These are two ownership models that you can use for any smart contract. Ownable uses a single owner model that can be transferred unilaterally to a new owner. Claimable extends this model to a two-step transfer process, first the existing must send and the new owner must receive, the ownership privilege.

## Address utilities -- `address-utils.sol`

This allows you to check whether any address is a normal account or if it is a smart contract. Please note that a normal account can become a smart contract (`CREATE`) and a smart contract can become a normal account (`SELFDESTRUCT`).

## ERC-165 -- `erc165.sol` and `supports-interface.sol`

[ERC-165](https://eips.ethereum.org/EIPS/eip-165) is a standard for publishing interfaces that your smart contract supports. If you are implementing a standard interface then it is best practice for your contract to identify this with ERC-165. This makes it simple for other contracts to detect how it works so they can cooperate as expected.

# Build

By default, the contracts in this package are built for Constantinople EVM. If you would like to use these smart contracts for `Wanchain` or other blockchains using EVM for a different version, you will need to rebuild them for the desired version.

---
_Source: https://npm.io/package/@0xcert/ethereum-utils-contracts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
