npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@3test/ethereum-utils-contracts

v1.2.0

Published

General utility module with helper smart contracts.

Downloads

6

Readme

General utility module with helper smart contracts.

The 0xcert Framework is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the official documentation for more details.

This module is one of the bricks of the 0xcert Framework. It's written with TypeScript and it's actively maintained. The source code is available on GitHub where you can also find our issue tracker.

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 however the documentation and readability of code is much improved. We hope this will help you to write more error-free code.

Exampe usage:

pragma solidity ^0.5.5;
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 which 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 is a standard for publishing interfaces which 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.