-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into weighted-reentrancy
- Loading branch information
Showing
1,350 changed files
with
9,513 additions
and
13,300,147 deletions.
There are no files selected for viewing
29 changes: 0 additions & 29 deletions
29
.github/PULL_REQUEST_TEMPLATE/deployment-preparation-template.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
- name: Lint | ||
|
@@ -24,7 +24,7 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
- name: Build | ||
|
@@ -35,7 +35,7 @@ jobs: | |
test-solidity-utils: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -56,7 +56,7 @@ jobs: | |
test-standalone-utils: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -77,7 +77,7 @@ jobs: | |
test-vault: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -98,7 +98,7 @@ jobs: | |
test-pool-utils: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -119,7 +119,7 @@ jobs: | |
test-pool-weighted: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -140,7 +140,7 @@ jobs: | |
test-pool-stable: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -161,7 +161,7 @@ jobs: | |
test-pool-linear: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -182,7 +182,7 @@ jobs: | |
test-liquidity-mining: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up environment | ||
|
@@ -203,7 +203,7 @@ jobs: | |
test-governance-scripts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up environment | ||
uses: ./.github/actions/setup | ||
- name: Compile | ||
|
@@ -212,54 +212,3 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Test | ||
run: yarn workspace @balancer-labs/v2-governance-scripts test | ||
|
||
test-fork: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.15 | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: '**/node_modules' | ||
key: yarn-v1-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install | ||
run: yarn --immutable | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
- name: Build Balancer JS | ||
run: yarn workspace @balancer-labs/balancer-js build | ||
- name: Compile | ||
run: yarn build # Ideally we wouldn't depend on the packages of other artifacts, but we use some of their mocks | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Forked Network Cache | ||
# Hardhat caches node requests when working with forked networks (e.g. when querying contract code, storage, | ||
# etc.) to save time in future runs. We cache this directory across runs. | ||
# This cache action is special for a couple reasons, which originate from a) it not occupying much disk size, | ||
# and b) the cache never being invalid (as past blockchain data is immutable). We therefore: | ||
# - save the cache even on action failure (which may be caused due to a timeout), even if this could result in | ||
# some wasted space. For this we use the always-upload-cache fork of the basic action. | ||
# - use a different key on every single run, causing for the cache to always be saved. | ||
# - use a wildcard as a restore key, which will cause all stored keys to match and the most recent one to be | ||
# selected. | ||
uses: pat-s/[email protected] | ||
id: cache-forked-network | ||
with: | ||
path: 'pkg/deployments/cache/hardhat-network-fork/**' | ||
key: hardhat-network-fork-${{ github.run_number }}-${{ github.run_attempt }} | ||
restore-keys: | | ||
hardhat-network-fork- | ||
- name: Prepare Config | ||
run: yarn workspace @balancer-labs/v2-deployments ci:prepare-config | ||
env: | ||
MAINNET_RPC_ENDPOINT: ${{ secrets.ALCHEMY_MAINNET_ARCHIVE_ENDPOINT }} | ||
POLYGON_RPC_ENDPOINT: ${{ secrets.ALCHEMY_POLYGON_ARCHIVE_ENDPOINT }} | ||
ARBITRUM_RPC_ENDPOINT: ${{ secrets.ALCHEMY_ARBITRUM_ARCHIVE_ENDPOINT }} | ||
OPTIMISM_RPC_ENDPOINT: ${{ secrets.ALCHEMY_OPTIMISM_ARCHIVE_ENDPOINT }} | ||
GOERLI_RPC_ENDPOINT: ${{ secrets.GOERLI_ARCHIVE_ENDPOINT }} | ||
- name: Test | ||
run: yarn workspace @balancer-labs/v2-deployments test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ | |
[![CI Status](https://github.com/balancer-labs/balancer-v2-monorepo/workflows/CI/badge.svg)](https://github.com/balancer-labs/balancer-v2-monorepo/actions) | ||
[![License](https://img.shields.io/badge/License-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0) | ||
|
||
This repository contains the Balancer Protocol V2 core smart contracts, including the `Vault` and standard Pools, along with their tests, configuration, and deployment information. | ||
This repository contains the Balancer Protocol V2 core smart contracts, including the `Vault` and standard Pools, along with their tests. | ||
Deployment configuration and information can be found at the [`balancer-deployments` repository](https://github.com/balancer/balancer-deployments). | ||
|
||
For a high-level introduction to Balancer V2, see [Introducing Balancer V2: Generalized AMMs](https://medium.com/balancer-protocol/balancer-v2-generalizing-amms-16343c4563ff). | ||
|
||
|
@@ -18,7 +19,6 @@ Active development occurs in this repository, which means some contracts in it m | |
|
||
### Packages | ||
|
||
- [`v2-deployments`](./pkg/deployments): addresses and ABIs of all Balancer V2 deployed contracts, for mainnet and various test networks. | ||
- [`v2-interfaces`](./pkg/interfaces): Solidity interfaces for all contracts. | ||
- [`v2-vault`](./pkg/vault): the [`Vault`](./pkg/vault/contracts/Vault.sol) contract and all core interfaces, including [`IVault`](./pkg/interfaces/contracts/vault/IVault.sol) and the Pool interfaces: [`IBasePool`](./pkg/interfaces/contracts/vault/IBasePool.sol), [`IGeneralPool`](./pkg/interfaces/contracts/vault/IGeneralPool.sol) and [`IMinimalSwapInfoPool`](./pkg/interfaces/contracts/vault/IMinimalSwapInfoPool.sol). | ||
- [`v2-pool-weighted`](./pkg/pool-weighted): the [`WeightedPool`](./pkg/pool-weighted/contracts/WeightedPool.sol), and [`LiquidityBootstrappingPool`](./pkg/pool-weighted/contracts/lbp/LiquidityBootstrappingPool.sol) contracts, along with their associated factories. | ||
|
@@ -65,7 +65,7 @@ $ yarn workspace @balancer-labs/balancer-js build # build balancer-js first | |
$ yarn build # compile all contracts | ||
``` | ||
|
||
Most tests are standalone and simply require installation of dependencies and compilation. Some packages however have extra requirements. Notably, the [`v2-deployments`](./pkg/deployments) package must have access to mainnet archive nodes in order to perform fork tests. For more details, head to [its readme file](./pkg/deployments/README.md). | ||
Most tests are standalone and simply require installation of dependencies and compilation. | ||
|
||
In order to run all tests (including those with extra dependencies), run: | ||
|
||
|
@@ -102,7 +102,7 @@ $ yarn test-fuzz | |
|
||
Multiple independent reviews and audits were performed by [Certora](https://www.certora.com/), [OpenZeppelin](https://openzeppelin.com/) and [Trail of Bits](https://www.trailofbits.com/). The latest reports from these engagements are located in the [`audits`](./audits) directory. | ||
|
||
Bug bounties apply to most of the smart contracts hosted in this repository: head to [Balancer V2 Bug Bounties](https://docs.balancer.fi/reference/contracts/security.html#bug-bounty) to learn more. Alternatively, send an email to [email protected]. | ||
Bug bounties apply to most of the smart contracts hosted in this repository: head to [Balancer V2 Bug Bounties](https://docs.balancer.fi/reference/contracts/security.html#bug-bounty) to learn more. | ||
|
||
All core smart contracts are immutable, and cannot be upgraded. See page 6 of the [Trail of Bits audit](https://github.com/balancer-labs/balancer-v2-monorepo/blob/master/audits/trail-of-bits/2021-04-02.pdf): | ||
|
||
|
Oops, something went wrong.