Socket
Socket
Sign inDemoInstall

@balancer-labs/v2-pool-utils

Package Overview
Dependencies
2
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @balancer-labs/v2-pool-utils

Utilities for creating Balancer V2 Pools


Version published
Weekly downloads
249
increased by55.63%
Maintainers
5
Created
Weekly downloads
 

Readme

Source

Balancer

Balancer V2 Pool Utilities

NPM Package Docs

This package contains Solidity utilities for developing Balancer V2 Pools, implementing common patterns such as token decimal scaling, caller checks on hooks, etc.

The most useful contracts are BaseGeneralPool and BaseMinimalSwapInfoPool, used as base contracts for Pools with the General and MinimalSwapInfo/TwoTokens specializations respectively.

The recommended pattern is to create new Pools from factory contracts, as that lets other systems reason about Pool logic by checking whether a Pool was deployed from a given factory. BasePoolFactory can be used for this purpose.

Overview

Installation

$ npm install @balancer-labs/v2-pool-utils

Usage

Contracts in this package are meant to be used via inheritance to develop new Pools. The BaseGeneralPool and BaseMinimalSwapInfoPool contracts are abstract, meaning some virtual functions (such as _onJoinPool or _onSwapGivenIn) are not defined: derived contracts must override them and provide an implementation.

See v2-pool-weighted for the implementation of Pools with a Constant Weighted Product invariant using these base contracts.

Licensing

GNU General Public License Version 3 (GPL v3).

FAQs

Last updated on 05 Jun 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc