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

biblioteca

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biblioteca

![](https://raw.githubusercontent.com/FilosofiaCodigo/Biblioteca/master/img/header.png)

  • 0.0.10
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

Alchemy Supercharged

workflow

Maximize interoperability for your smart contracts with the integrations library for decentralized protocols.

📜 Contracts

OriginContractReleasedUnit TestsAudit
Uniswap V2 Fee Token
Uniswap V2 AutoSwap Token
Balancer V2 Fee Token
Uniswap V3 Fee Token
OpenZeppelin NFT Collection
Azuki NFT Collection
Aave Interface
Sudoswap Interface

🤔 Why Biblioteca?

Our ultimate goal is to simplify access to information and bring people together through web3. That's why we are so passionate about building a library that connects people and protocols. We encourage you to experiment with the library yourself by launching the examples or to study the underliying prococols by exploring the Unit Tests. If you would like to contribute, PRs are welcome!

🛡️ Running Tests & Coverage

npx hardhat test
npx hardhat coverage

🗎 Generate Documentation

npx hardhat docgen

📝 Take note

  • This contracts are based on OpenZeppelin libraries but changed private variables to internal for flexibility
  • All contracts are Ownable
  • All percentage numbers are 2 digit decimals (e.g. 150 percent is 1.5%)

⚠️ Important!

Many libraries are not audited. Use at your own risk! Also, PRs and upstream changes very welcome.

🪙 ERC20 Tokens

Uniswap V2 Fee Token

ERC20 token that takes fees on P2P, buy and sell on Uniswap V2 and transfer them to a Vault.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "biblioteca/contracts/ERC20/UniswapV2FeeToken.sol";

contract MyUniswapV2FeeToken is UniswapV2FeeToken
{
    constructor() UniswapV2FeeToken(
        "My Token", "MTKN",                         // Name and Symbol
        1_000_000_000 ether,                        // 1 billion supply
        100, 200, 50,                               // Fees: 1% buy 2% sell 0.5% P2P
        msg.sender,                                 // Fee Receiver
        0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, // Router Address: Uniswap V2
        0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) // Base Token Address: USDC
    {
    }
}

See full API documentation.

Uniswap V2 AutoSwap Token

ERC20 token that takes fees on P2P, buy and sell on Uniswap V2, converts them to Base Tokens and transfer them to a Vault.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "biblioteca/contracts/ERC20/UniswapV2AutoSwapToken.sol";

contract MyUniswapV2AutoSwapToken is UniswapV2AutoSwapToken
{
    constructor() UniswapV2AutoSwapToken(
        "My Token", "MTKN",                         // Name and Symbol
        1_000_000_000 ether,                        // 1 billion supply
        100, 200, 50,                               // Fees: 1% buy 2% sell 0.5% P2P
        msg.sender,                                 // AutoSwap Receiver
        0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, // Router Address: Uniswap V2
        0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, // Base Token Address: USDC
        100)                                        // 1% in tokens before swap percent
    {
    }
}

See full API documentation.

Balancer V2 Fee Token

ERC20 token that takes fees on P2P, buy and sell on Balancer and transfer them to a Vault.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "biblioteca/contracts/ERC20/BalancerV2FeeToken.sol";

contract MyBalancerFeeToken is BalancerV2FeeToken
{
    constructor() BalancerV2FeeToken(
        "My Token", "MTKN",     // Name and Symbol
        1_000_000_000 ether,    // 1 billion supply
        100, 200, 50,           // Fees: 2% buy 1% sell 0.5% P2P
        msg.sender)             // Fee Receiver
    {
    }
}

See full API documentation.

Uniswap V3 Fee Token

ERC20 token that takes fees on P2P, and buy on Uniswap V3 and transfer them to a Vault.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "biblioteca/contracts/ERC20/UniswapV3FeeToken.sol";

contract MyUniswapV3FeeToken is UniswapV3FeeToken
{
    constructor() UniswapV3FeeToken(
        "My Token", "MTKN",                         // Name and Symbol
        1_000_000_000 ether,                        // 1 billion supply
        100, 200,                                   // Fees: 1% buy 2% P2P
        msg.sender,                                 // Vault Address
        0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2, // Base token: WETH
        1000)                                       // Initial rate: 1 WETH = 1000 tokens
    {
    }
}

See full API documentation.

🖼️ NFT Collections

OpenZeppelin NFT Collection

NFT collection with a mint price and max supply. Uses OpenZeppelin library wich is more adopted and save transfer gas fees compared to Azuki's ERC721a.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "biblioteca/contracts//ERC721/OpenZeppelinNFTCollection.sol";

contract MyOpenZeppelinNFTCollection is OpenZeppelinNFTCollection
{
    constructor() OpenZeppelinNFTCollection(
        "My NFT Collection", "MNFT",    // Name and Symbol
        "https://raw.githubusercontent.com/FilosofiaCodigo/nft-collection-api/master/metadata/",    // Base Metadata URI
        10_000,         // 10,000 max supply
        0.01 ether)     // 0.01 eth mint price
    {
    }
}

Azuki ERC721a NFT Collection

NFT collection with a mint price and max supply. Uses ERC721a library wich is more newer and save batch mint gas fees compared to OpenZeppelin's ERC721 implementation.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "biblioteca/contracts//ERC721/ERC721aCollection.sol";

contract MyERC721aCollection is ERC721aCollection
{
    constructor() ERC721aCollection(
        "My NFT Collection", "MNFT",    // Name and Symbol
        "https://raw.githubusercontent.com/FilosofiaCodigo/nft-collection-api/master/metadata/",    // Base Metadata URI
        10_000,         // 10,000 max supply
        0.01 ether)     // 0.01 eth mint price
    {
    }
}

Keywords

FAQs

Package last updated on 05 Feb 2023

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