Git Product home page Git Product logo

balancer-core-v2's Introduction

Balancer

Balancer V2

CI Status License

This repository contains Balancer Protocol V2's core smart contract, the Vault, along with auxiliary contracts such as the WeightedPoolFactory.

For a high-level introduction to Balancer V2, see Introducing Balancer V2: Generalized AMMs.

Structure

Active development occurs in this repository, which means some contracts in it may not be production-ready. Proceed with proper care.

Directories

  • contracts: source code for all smart contracts in the system.
    • vault stores the Vault contract, which is split across many files for separation of concerns and clarity.
    • pools keeps the code for the different Pool types and related contracts, such as factories.
    • test holds contracts that are only used for testing purposes, often with lax access control patterns and other unsafe properties.
  • test: unit tests for each smart contract, using ethers and waffle chai matchers. The helpers subdirectory holds utilities used to simplify writing assertions, deploying test contracts, etc., with the overall goal of making tests more ergonomic and less verbose.
  • lib: miscellaneous files used for deployment, gas benchmarking, testing and so on.

This repository will soon be migrated into a monorepo, making the different contracts, interfaces and libraries easier to use by third parties. Stay tuned!

Security

Multiple independent reviews and audits were performed by Certora, OpenZeppelin and Trail of Bits. The latest reports from these engagements are located in the audits directory.

Bug bounties apply to most of the smart contracts hosted in this repository: head to Balancer V2 Bug Bounties to learn more.

Licensing

Most of the source code is licensed under the GNU General Public License Version 3 (GPL v3): see LICENSE.

Exceptions

  • All files under contracts/lib/openzeppelin, are based on the OpenZeppelin Contracts library, and as such are licensed under the MIT License: see LICENSE.
  • contracts/lib/math/LogExpMath.sol is licensed under the MIT License.
  • All other files under lib and test are unlicensed.

NeonEVM

In your .env file, add these -


DEPLOYER_PRIVATE_KEY=
CONTROLLER_PRIVATE_KEY=
CREATOR_PRIVATE_KEY=
OTHER_PRIVATE_KEY=

The basic deployment: Authorizer, Vault, WETH and Weighted Pools


yarn hardhat deploy --network neonDevnet

# replace deployed addresses in lib/scripts/gas-measurement/contracts.ts

# Run these scripts for gas measurement

$ yarn measure-gas-deployment --network neonDevnet
$ yarn measure-gas-multihop --network neonDevnet
$ yarn measure-gas-join-exit --network neonDevnet
$ yarn measure-gas-single-pair --network neonDevnet


balancer-core-v2's People

Contributors

nventuro avatar facuspagnuolo avatar dmf7z avatar gtaschuk avatar endymionjkb avatar mikemcdonald avatar tomafrench avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.