Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@balancer-labs/v2-pool-utils
Advanced tools
Readme
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.
$ npm install @balancer-labs/v2-pool-utils
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.
FAQs
Utilities for creating Balancer V2 Pools
The npm package @balancer-labs/v2-pool-utils receives a total of 139 weekly downloads. As such, @balancer-labs/v2-pool-utils popularity was classified as not popular.
We found that @balancer-labs/v2-pool-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.