@powerpool/balancer-v2-pool-utils

2.0.3 • Public • Published

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 if a Pool was deployed from a given factory. BasePoolFactory and BasePoolSplitCodeFactory (for large contracts) 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).

Readme

Keywords

none

Package Sidebar

Install

npm i @powerpool/balancer-v2-pool-utils

Weekly Downloads

1

Version

2.0.3

License

GPL-3.0-only

Unpacked Size

309 kB

Total Files

55

Last publish

Collaborators

  • defi-dev
  • polipaul777