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

@beandao/contracts

v0.8.0

Published

Smart Contract Library for beandao production

Downloads

44

Readme

bean the DAO Contract library

Helpful library for solidity. Basically, it is assumed that most libraries are used in proxies. Therefore, support for some constructors may be insufficient, but most of them are supported.

Installation

npm install -d @beandao/contracts

Usage

Copy the code below, paste it into Remix, deploy it, and test it. Remix automatically gets the @beandao library from npm.

pragma solidity ^0.8.0;

import "@beandao/contracts/interfaces/IERC165.sol";
import {ERC20, IERC20} from "@beandao/contracts/library/ERC20.sol";
import {ERC2612, IERC2612} from "@beandao/contracts/library/ERC2612.sol";
import {Ownership, IERC173} from "@beandao/contracts/library/Ownership.sol";
import {Multicall, IMulticall} from "@beandao/contracts/library/Multicall.sol";

contract StandardToken is ERC20, ERC2612, Ownership, Multicall, IERC165 {
    constructor(
        string memory tokenName,
        string memory tokenSymbol,
        uint8 tokenDecimals,
        string memory tokenVersion,
        uint256 amount
    ) ERC20(tokenName, tokenSymbol, tokenDecimals) ERC2612(tokenName, tokenVersion) {
        totalSupply = amount;
        balanceOf[msg.sender] = amount;
    }

    function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
        return
            // ERC20
            interfaceId == type(IERC20).interfaceId ||
            // ERC173
            interfaceId == type(IERC173).interfaceId ||
            // ERC2612
            interfaceId == type(IERC2612).interfaceId;
    }
}

included

Abstract Contract

  • Aggregatecall - The contract using this library is set the caller to this contract and calls are execute in order
  • Multicall - This library allows to execute functions specified in the contract in order
  • ERC20 - Standard ERC20 specification implementation
  • ERC721 - Standard ERC721 and ERC721Metadata specification implementation
  • ERC721Enumerable - Standard ERC721Enumerable and ERC721Metadata specification implementation
  • ERC2612 - Provide EIP2612 details aka permit for ERC20 and smooth the approach process by signing
  • ERC4494 - Provide EIP4494 details aka permit for ERC721 and smooth the approach process by signing
  • Initializer - After the contract is deployed, you can configure a function that can only be called once
  • Ownership - It is a single contract ownership and follows the ERC173 specification
  • PermissionTable - Manage the contract address and its callable function signatures as an allow list. It can be managed with up to 256 Roles
  • ReentrantSafe - Prevent the function from running again while it is running
  • Scheduler - Manage task-level scheduling at the time specified by the developer
  • Wizadry - Many Tx's can be compressed into one, and execution can be dynamically changed depending on the running state

Library Contract

  • BeaconDeployer - This is a wrapper that deploy beacon contracts created in yul
  • BeaconProxy - A library that helps deploy Beacon proxy the minimum contract size referring to the implementation through Beacon
  • MinimalProxy - It helps to deploy the Minimal Proxy, which is the EIP 1167 specification.
  • EIP712 - Easy set of functions to support EIP712, signTypedData specifications
  • Witchcraft - A library for magical dynamic ABIs

Support Contract

  • WETH - Wrapped Ether Contract

Acknowledgements

These contracts were inspired by or directly modified from many sources, primarily: