Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beandao/contracts

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beandao/contracts

Smart Contract Library for beandao production

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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:

Keywords

FAQs

Package last updated on 04 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc