Skip to content

Commit

Permalink
Merge branch 'master' into weighted-reentrancy
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Ignacio Ubeira committed Mar 5, 2024
2 parents 0ef85bf + ac63d64 commit 1a2848d
Show file tree
Hide file tree
Showing 1,350 changed files with 9,513 additions and 13,300,147 deletions.
29 changes: 0 additions & 29 deletions .github/PULL_REQUEST_TEMPLATE/deployment-preparation-template.md

This file was deleted.

15 changes: 0 additions & 15 deletions .github/PULL_REQUEST_TEMPLATE/deployment-template.md

This file was deleted.

4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ runs:
using: composite
steps:
- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18.15
- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
id: cache
with:
path: '**/node_modules'
Expand Down
6 changes: 0 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<!-- If this is deployment-related, please go the the Preview tab and select the appropriate sub-template. -->
<!-- Otherwise, delete everything before #Description -->

* [Deployment preparation template](?expand=1&template=deployment-preparation-template.md)
* [Deployment template](?expand=1&template=deployment-template.md)

# Description

<!-- Describe the changes introduced in this pull request. -->
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
Expand All @@ -24,7 +24,7 @@ jobs:
single-pair-swap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
Expand All @@ -37,7 +37,7 @@ jobs:
multihop-swap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
Expand All @@ -50,7 +50,7 @@ jobs:
join-exit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
Expand All @@ -63,7 +63,7 @@ jobs:
relayer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
Expand Down
73 changes: 11 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
77 changes: 0 additions & 77 deletions .github/workflows/deployment-checks.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -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.
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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):

Expand Down
Loading

0 comments on commit 1a2848d

Please sign in to comment.