Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yearn linear pool integration #5

Open
wants to merge 306 commits into
base: balancer-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
306 commits
Select commit Hold shift + click to select a range
6015118
FF semantics in tests (#1710)
EndymionJkb Sep 14, 2022
3d1e814
refactor: remove BaseMinimalSwapInfoPool (#1758)
TomAFrench Sep 14, 2022
e0b8088
Adding benchmark for relayer multicall (#1752)
Sep 14, 2022
6461702
Using the same storage slot for read-only and temporary chained refer…
Sep 14, 2022
2e4a7ee
Removing unnecessary debug log from VaultActions test. (#1764)
Sep 14, 2022
aa22d06
Push weighted join and exit types into a library (#1759)
TomAFrench Sep 14, 2022
feafc9e
Flatten `_isOnlyOwnerAction` (#1757)
TomAFrench Sep 14, 2022
e66b5f2
Removing return values from VaultActions. (#1765)
Sep 14, 2022
8fb97f2
refactor: flatten _doJoin (#1760)
TomAFrench Sep 14, 2022
9e6aa98
Extend PoolRegLib (#1770)
nventuro Sep 14, 2022
e261569
Avoid double zero duration check in `calculateValueChangeProgress` (#…
TomAFrench Sep 15, 2022
da8a21e
Fix deployments package (#1773)
nventuro Sep 15, 2022
ccb2f51
Cache token weight in _onSwapGivenIn/Out (#1769)
TomAFrench Sep 15, 2022
cd36506
Adding Foundry support (#1771)
Sep 15, 2022
c02afc7
Pull _poolState up into ManagedPool (#1774)
TomAFrench Sep 15, 2022
99b11e9
Add `ManagedPoolSwapFees` contract (#1755)
TomAFrench Sep 15, 2022
4f0ab44
Adding Foundry install instructions to README. (#1775)
Sep 15, 2022
eec64ad
Recursive submodules ci (#1780)
Sep 15, 2022
c2b4c37
style: rearrange functions (#1777)
TomAFrench Sep 15, 2022
dab7f2b
refactor: remove unused constants (#1781)
TomAFrench Sep 15, 2022
757b9ce
Inline `getSwapEnabled()` inside swap hooks (#1778)
TomAFrench Sep 15, 2022
611206b
feat: automatically renormalize weight sum on gradual weight change (…
TomAFrench Sep 15, 2022
1f07236
Update `_startGradualWeightChange` to return updated pool state (#1779)
TomAFrench Sep 15, 2022
0a26766
refactor: rename WeightCompression to ValueCompression (#1783)
EndymionJkb Sep 16, 2022
ab6a15c
docs: typos and readability (#1784)
EndymionJkb Sep 16, 2022
0d62d62
Add some random fuzz tests (#1782)
nventuro Sep 16, 2022
93827a3
Replace ManagedPoolStorageLib tests with foundry fuzzing (#1776)
TomAFrench Sep 16, 2022
483b7f5
[Batch Relayer V4] AaveWrapping test (#1715)
Sep 16, 2022
610c921
Misc changes to ManagedPool/BasePool (#1786)
TomAFrench Sep 16, 2022
23534c4
Reaper linear pool and supporting utilities (#1717)
danielmkm Sep 16, 2022
dc39688
Move ManagedPool swap, join, exit logic to ManagedPoolAMMLogic (#1787)
TomAFrench Sep 16, 2022
609570b
refactor: remove BaseWeightedPool (#1788)
TomAFrench Sep 16, 2022
a349d2b
[Deployments] Batch relayer V4 preparation. (#1706)
Sep 16, 2022
7a27590
Deploy relayer v4 (#1791)
nventuro Sep 16, 2022
4085a05
Update readme.md
nventuro Sep 16, 2022
6072112
Make base pool better (#1790)
TomAFrench Sep 19, 2022
e50a39f
Remove unused imports (#1795)
TomAFrench Sep 19, 2022
0c8cd11
Remove `_getTotalTokens` internal getter (#1794)
TomAFrench Sep 19, 2022
02532e4
Expose getter for expected compression error on ValueCompression.sol …
TomAFrench Sep 19, 2022
5d0c7e1
Upgrade ignore-warnings (#1789)
nventuro Sep 19, 2022
5aa5a86
Replace maths functions with branches with assembly (#1785)
TomAFrench Sep 19, 2022
1765c29
Basepool bytecode reduction (#1799)
TomAFrench Sep 19, 2022
8039f98
Bump `hardhat-ignore-warnings` and silence shadowing-opcode warnings …
TomAFrench Sep 20, 2022
28fcee8
Pass asset manager in addToken (#1802)
nventuro Sep 20, 2022
dcef4bc
Migrate add/remove tests (#1804)
nventuro Sep 20, 2022
ad3ece6
refactor: add a constant for DELEGATE_OWNER (#1807)
TomAFrench Sep 20, 2022
89379e3
Refactor remove token (#1808)
nventuro Sep 21, 2022
6316fc9
Fix test
nventuro Sep 21, 2022
3e1a4a4
Don't assume that invariantRatioWithFees >= FixedPoint.ONE (#1819)
TomAFrench Sep 22, 2022
75ee30e
Update WeightedMath.sol
nventuro Sep 22, 2022
f643c90
refactor: remove unnecessary safemath (#1820)
TomAFrench Sep 22, 2022
3cfdd89
Add shortcircuit for calculating powDown(FixedPoint.ONE, y) in `_comp…
TomAFrench Sep 22, 2022
b0fab61
Remove management swap fees from ManagedPool (#1800)
TomAFrench Sep 22, 2022
427e06c
WeightedMath lint (#1822)
EndymionJkb Sep 22, 2022
b99d89c
chore: silence "shadowing-opcode" warning in foundry (#1823)
TomAFrench Sep 22, 2022
9d5c2f5
Add fuzz tests for RecoveryMode (#1806)
EndymionJkb Sep 22, 2022
666b128
Managed pool settings tests (#1798)
TomAFrench Sep 22, 2022
6b040dd
Add fuzz tests for ManagedPoolTokenLib (#1797)
TomAFrench Sep 22, 2022
ff1c5f7
Add single token version of `_calcBptOutGivenExactTokensIn` (#1821)
TomAFrench Sep 22, 2022
4dc55e6
Collect AUM fees on adding/removing tokens (#1824)
TomAFrench Sep 22, 2022
0d0023e
(Managed) Base pool test (#1805)
Sep 22, 2022
8851c5b
Remove unused BasePool args (#1826)
nventuro Sep 22, 2022
b3142e0
Deleting stale comment in ProtocolFeeCache. (#1827)
Sep 22, 2022
67cf620
Wrap Vault.getPoolToken in a virtual internal function (#1829)
TomAFrench Sep 23, 2022
01e7e3b
docs: improve documentation of WeightedMath.t.sol (#1838)
EndymionJkb Sep 26, 2022
91dfb4d
Small optimisations in GradualValueChange (#1840)
TomAFrench Sep 26, 2022
6172389
Add tokens to UpdateWeightsGradually (#1832)
EndymionJkb Sep 26, 2022
fcecf1a
Recovery Mode consistency (#1837)
EndymionJkb Sep 26, 2022
3d4594c
feat: enforce allowlist on pool initialization (#1828)
TomAFrench Sep 26, 2022
4411ceb
Refactor pool registration so that it happens on outermost layer (#1836)
TomAFrench Sep 26, 2022
164e064
Update ManagedPool tests to be based around swap/join/exit actions (#…
TomAFrench Sep 26, 2022
89725b6
Add groundwork for composable swaps (#1830)
TomAFrench Sep 26, 2022
af1d9cf
Rename controller to owner in ManagedPool (#1831)
EndymionJkb Sep 26, 2022
f867cf0
test: remove test for swapping behaviour from ManagedPoolSettings tes…
TomAFrench Sep 26, 2022
3193d66
Make weights normalized (#1842)
nventuro Sep 26, 2022
592b053
Add exitSwap implementation and fuzz test (#1843)
TomAFrench Sep 26, 2022
4444ca9
test: update some stale helpers in tests (#1849)
TomAFrench Sep 27, 2022
c66423f
fix: use _getPoolTokens in add/remove token functions (#1852)
TomAFrench Sep 27, 2022
736d1d9
Misc add/remove token changes (#1853)
nventuro Sep 27, 2022
75667d3
feat: pass virtualSupply to _beforeJoinExit (#1851)
TomAFrench Sep 27, 2022
9fbc89d
Add composable pool registration to PoolRegistrationLib (#1835)
TomAFrench Sep 27, 2022
9b644f0
Relax error on added token
nventuro Sep 27, 2022
e5f552e
Add getters for the ManagedPool's actualSupply (#1850)
TomAFrench Sep 27, 2022
298e9b0
feat: add virtual _getVirtualSupply getter (#1854)
TomAFrench Sep 27, 2022
0cff04f
Add some groundwork for composable tests (#1847)
TomAFrench Sep 27, 2022
9458439
Add fuzz tests for in place array BPT dropping (#1848)
TomAFrench Sep 27, 2022
5a6990b
refactor: remove obsolete constant (#1857)
TomAFrench Sep 28, 2022
6fe16df
Circuit Breaker data (#1792)
EndymionJkb Sep 28, 2022
24c2c27
Removing setSwapFeePercentage in managed pool. (#1846)
Sep 28, 2022
0c25b30
style: linter (#1860)
TomAFrench Sep 28, 2022
c63ff2c
refactor: merge return values from _collectAumManagementFees (#1858)
TomAFrench Sep 28, 2022
1a9313f
Add updateBoundRatios (#1861)
EndymionJkb Sep 28, 2022
9ff3512
Inline `_beforeJoinExit` (#1855)
TomAFrench Sep 28, 2022
5fe43a4
Addressing managed pool settings outstanding comments (#1864)
Sep 28, 2022
48ece4c
Replace references to total supply in tests with virtual supply (#1865)
TomAFrench Sep 29, 2022
e0b546f
Add ComposablePoolLib (#1863)
TomAFrench Sep 29, 2022
02ce0c7
Make ManagedPool composable (#1856)
TomAFrench Sep 29, 2022
5629fdc
Composable review notes (#1868)
TomAFrench Sep 29, 2022
db748b8
Add joinSwaps to ManagedPool (#1867)
TomAFrench Sep 29, 2022
6546cc9
Composable exits (#1870)
TomAFrench Sep 29, 2022
15b6a70
Add test for return value of collectAUMManagementFees (#1869)
TomAFrench Sep 29, 2022
cb63eff
Protocol fee cache ids: fee type remappings (#1833)
Sep 29, 2022
2e08c0a
Circuit breaker interactions (#1834)
EndymionJkb Sep 30, 2022
9ae7614
refactor: move library calls into helper function (#1874)
TomAFrench Sep 30, 2022
fcc39e3
Rename ProtocolAUMFees (#1871)
EndymionJkb Sep 30, 2022
704cbf8
Adjust managed pool limits (#1872)
nventuro Sep 30, 2022
e2644f7
refactor: clarify _collectAumManagementFees argument (#1886)
EndymionJkb Sep 30, 2022
ebed789
Rename ManagedPoolTokenLib to reflect storage (#1885)
EndymionJkb Oct 1, 2022
7b0725c
refactor: remove unnecessary ReentrancyGuard (#1884)
EndymionJkb Oct 1, 2022
6df4753
refactor: make getSwapFeePercentage external (#1881)
TomAFrench Oct 1, 2022
eeab800
refactor: only call resolveStartTime on external calls (#1883)
TomAFrench Oct 1, 2022
34b11c6
Reduce bytecode through solidity silliness (#1882)
TomAFrench Oct 3, 2022
360387b
Rename `setCircuitBreakerFields` to `setCircuitBreaker` (#1888)
TomAFrench Oct 3, 2022
ff5cc37
Fix circuit breaker lib failing test (#1879)
nventuro Oct 3, 2022
241619d
Add intense fuzzing profile for CI (#1889)
TomAFrench Oct 3, 2022
8c98013
Remove getInvariant (#1877)
nventuro Oct 3, 2022
d47879d
Ensure that AUM fee is set to zero in recovery mode (#1890)
TomAFrench Oct 3, 2022
9d9337a
refactor: move recovery mode event to RecoveryMode (#1893)
TomAFrench Oct 3, 2022
6a623ac
Bytecode improvement: ProtocolFeeCache structs (#1891)
Oct 3, 2022
2f5f366
Add swap rounding tests (#1875)
nventuro Oct 3, 2022
7c5c9c5
Properly override recovery mode exit in ManagedPool (#1880)
TomAFrench Oct 3, 2022
cd9524d
Merge AUM fee getters (#1892)
TomAFrench Oct 3, 2022
585731d
Make ManagedPool LP allowlist more flexible (#1899)
EndymionJkb Oct 4, 2022
ab7bad0
refactor: use initializeTokenState method in constructor (#1900)
TomAFrench Oct 4, 2022
6a07753
Pure virtuals in ManagedPoolSettings (#1898)
EndymionJkb Oct 4, 2022
1ed8fee
Even more flexible allowlist (#1901)
EndymionJkb Oct 4, 2022
4297329
reduce storage accesses (#1902)
nventuro Oct 4, 2022
495c7a5
Separate CircuitBreaker storage from logic (#1897)
EndymionJkb Oct 4, 2022
2e27c07
Updating fee collection timestamp every time aum fees are collected (…
Oct 9, 2022
2c4d727
Join exit rounding fuzz tests (#1896)
nventuro Oct 9, 2022
45c291d
Reverse varyDecimals (#1913)
EndymionJkb Oct 10, 2022
338bd52
Support incoming unscaled bptPrice (#1906)
EndymionJkb Oct 10, 2022
ce1aefa
Use weight instead of weight complement (CB) (#1904)
EndymionJkb Oct 10, 2022
b0a65df
Single-sided circuit breaker checks (#1905)
EndymionJkb Oct 10, 2022
526546d
fix: add missing import (#1914)
EndymionJkb Oct 10, 2022
a60005d
Remove unused double-sided breakers (#1909)
EndymionJkb Oct 10, 2022
eb49358
Check circuit breakers on a regular swap (#1907)
EndymionJkb Oct 10, 2022
d52d768
Update comments in outmost swap/join/exit hooks (#1915)
TomAFrench Oct 10, 2022
d112f2c
Check circuit breakers on join/exits (#1908)
EndymionJkb Oct 11, 2022
20045fc
Add joinswap and exitswap comments
nventuro Oct 11, 2022
eb2d9cd
Update ManagedPool.sol
nventuro Oct 17, 2022
28c45d2
Update readme.md
nventuro Oct 18, 2022
5571a83
Use SafeERC20 for approvals (#1916)
Oct 19, 2022
deb34ef
Fix weight generation to prevent flaky tests (#1923)
nventuro Oct 19, 2022
d9ca1f1
refactor: remove LogCompression (#1924)
TomAFrench Oct 19, 2022
90afe9c
refactor: inline scaling factors (#1925)
TomAFrench Oct 19, 2022
06b00f5
Scale balances to accommodate low-decimal tokens (#1922)
EndymionJkb Oct 19, 2022
c17588b
style: linter (#1928)
TomAFrench Oct 19, 2022
ef20385
refactor: standardize "not implemented" error (#1927)
TomAFrench Oct 19, 2022
c16d5d4
Remove base recovery mode implementation (#1926)
TomAFrench Oct 20, 2022
59f0ca1
Create external WeightedMath contract (#1921)
Oct 20, 2022
3c599f7
Make calcAdjustedBound external (#1930)
Oct 20, 2022
2173577
test: add smoke tests for circuit breakers in ManagedPool (#1929)
EndymionJkb Oct 20, 2022
099e388
Fix: match MockVault `PoolBalanceChanged` event with `IVault` event. …
Oct 21, 2022
4580a9b
Move add/remove token logic into an external library. (#1876)
TomAFrench Oct 21, 2022
e142a73
Move managed docs to interface (#1903)
nventuro Oct 21, 2022
54bcb7d
Documentation updates (#1933)
EndymionJkb Oct 21, 2022
a0e88c6
Refactor: `BaseManagedPoolFactory` --> `ManagedPoolFactory` (#1937)
Oct 21, 2022
42696f1
Increase max tokens (#1938)
EndymionJkb Oct 24, 2022
1d646fa
Match `Swap` event from `MockVault` with `IVault` event. (#1936)
Oct 24, 2022
3e99500
Deployment preparation: managed pool (#1866)
Oct 25, 2022
08e816b
Update readme.md
nventuro Oct 25, 2022
df23705
Update deployments readme (#1944)
Oct 25, 2022
7610a7c
Revamp of readme files (#1943)
EndymionJkb Oct 25, 2022
a5c81fe
Ignore silenced solc warnings on all packages (#1946)
nventuro Oct 25, 2022
5f50588
Update npm packages (#1945)
nventuro Oct 26, 2022
a44127d
Remove unused helper file (#1949)
nventuro Oct 26, 2022
e3fb9a5
Make interface pragmas more permissive (#1947)
nventuro Oct 26, 2022
506897e
Remove IAssetManager (#1948)
nventuro Oct 26, 2022
bf632be
Check action ID uniqueness when creating new ones. (#1950)
Oct 26, 2022
3f7d61d
Add recovery mode tests for `BaseWeightedPool`. (#1942)
Oct 26, 2022
4c8e1f5
PR template (#1934)
EndymionJkb Oct 26, 2022
bddef99
Add latest ToB audit (#1952)
nventuro Oct 27, 2022
21dc0f2
Great Pool Migration (prep) (#1954)
EndymionJkb Oct 27, 2022
e791860
Rebase LinearPool (#1955)
EndymionJkb Oct 28, 2022
26794aa
ProtocolFeeSplitter (#1918)
bxmmm1 Oct 31, 2022
72ba2ee
Update README.md (#1963)
nventuro Oct 31, 2022
1db13b8
fix: flaky circuit breaker test (#1956)
EndymionJkb Oct 31, 2022
66f0b33
L2 Gauge Checkpointer (#1570)
Nov 1, 2022
ebe1741
Authorizer refactor preparation (tests) (#1965)
EndymionJkb Nov 1, 2022
eb76f35
Merge branch 'balancer-master' into yearn-linear-pool
danielmkm Nov 2, 2022
cc968be
store the rateScaleFactor as it never changes
danielmkm Nov 2, 2022
0fcfc80
fix lint errors
danielmkm Nov 2, 2022
79250ab
Add managed pool action ids (#1970)
nventuro Nov 2, 2022
3b091d2
Upgrade hardhat (#1974)
nventuro Nov 2, 2022
68a5a4a
chore: silence hardhat warnings in distributors package (#1975)
TomAFrench Nov 2, 2022
9b68267
refactor: replace UNHANDLED_BY_LINEAR_POOL with UNIMPLEMENTED (#1976)
EndymionJkb Nov 2, 2022
0b5e10d
Rebase LBP (#1961)
EndymionJkb Nov 2, 2022
30fade3
Update hardhat verifier (#1968)
nventuro Nov 2, 2022
420b883
Provide a 'contract' argument to extract-artifacts (#1951)
Nov 3, 2022
743a5f1
refactor: use constants rather than literals in poolState decoding (#…
TomAFrench Nov 3, 2022
896f3d0
Add note about Node / Yarn versions in README. (#1987)
Nov 7, 2022
4371d9e
Update dependencies (#1985)
Nov 7, 2022
4ebbfd9
Update node engine in main package.json. (#1989)
Nov 7, 2022
d68a83c
ESLint + prettier update (#1988)
Nov 8, 2022
fd06144
Adaptor entrypoint (#1977)
Nov 8, 2022
d24834f
Add Certora ComposableStablePool report (#1967)
nventuro Nov 8, 2022
f5b0322
Add `IL2GaugeCheckpointer` to interfaces changelog. (#1995)
Nov 8, 2022
bb40ac9
Use complete task names in deployment scripts to avoid collisions. (#…
Nov 9, 2022
453c47e
Changelog update (#2000)
Nov 10, 2022
2289007
wBTC should have 8 decimals, not 6
danielmkm Nov 11, 2022
8986e95
Improve AuthorizerAdaptorEntrypoint docs (#2003)
nventuro Nov 11, 2022
6dd6892
Fix linter (#2006)
nventuro Nov 11, 2022
98572e0
update trail of bits broken link and date to reflect the date from th…
biancabuzea200 Nov 14, 2022
d3d6873
Deployment preparation: adaptor entrypoint (#1991)
Nov 14, 2022
8f5d7ae
Add Gnosis and BNB deployments (#1969)
nventuro Nov 14, 2022
aa992dd
Deployment: Authorizer Adaptor Entrypoint (#2009)
Nov 14, 2022
551df1b
Add ExternalCallLib which checks revert data for malicious data (#2004)
TomAFrench Nov 15, 2022
9c24690
Add IRateProviderPool (#2005)
nventuro Nov 15, 2022
a9bcfc3
Split LBP contract into LBP and LBPSettings (#1979)
TomAFrench Nov 15, 2022
c02894a
Add index.ts for `deployments/src` (#2014)
TomAFrench Nov 15, 2022
2c5c8b1
Use hardhat network helpers (#2016)
nventuro Nov 16, 2022
ae345be
Improve deployment signers (#2017)
nventuro Nov 16, 2022
751f00b
Remove wrong dependency (#2018)
nventuro Nov 16, 2022
3a02da9
YearnShareValueHelper and Fork tests (#10)
danielmkm Nov 17, 2022
98157c2
fix lint errors
danielmkm Nov 17, 2022
fa1460b
Make fork tests runnable
danielmkm Nov 17, 2022
74afb21
remove comment
danielmkm Nov 17, 2022
d701551
Introduce PoolRecoveryEnabler (#2013)
nventuro Nov 17, 2022
d249d60
Lint fix. (#2021)
Nov 17, 2022
d908fb4
Add new AaveLinearPool deployment (#2012)
TomAFrench Nov 17, 2022
a92aff6
Move LBP storage handling to library (#2015)
TomAFrench Nov 22, 2022
a494af6
Fuzz helpers (#2022)
EndymionJkb Nov 22, 2022
89b815d
Create recovery helper deployment (#2033)
nventuro Nov 22, 2022
6be4bfe
Add tokens task (#2024)
nventuro Nov 22, 2022
552a311
style: fix linter (#2036)
TomAFrench Nov 22, 2022
f1e452c
Fix recovery readme (#2037)
nventuro Nov 22, 2022
6fd2dd9
Aave linear pool versioning (#2032)
Nov 22, 2022
0d155b6
Do deployment (#2035)
nventuro Nov 22, 2022
a50715b
Make unnecessarily async functions sync (#2030)
TomAFrench Nov 22, 2022
7b0f617
Update linear build info (#2041)
nventuro Nov 23, 2022
a7008b7
Add Version unit test. (#2038)
Nov 23, 2022
d13ee43
docs: remove deprecated networks from jsdoc (#2029)
TomAFrench Nov 23, 2022
9f79fc1
Rename IPoolVersion --> IFactoryCreatedPoolVersion. (#2045)
Nov 23, 2022
09d147e
Verify AaveLinearPool on deployment (#2040)
nventuro Nov 23, 2022
9ef3ced
Adaptor entrypoint events (#2051)
Nov 23, 2022
368ba4d
Remove Protocol Fee Splitter task (#2054)
nventuro Nov 24, 2022
fd343fb
chore: add missing action-ids (#2025)
TomAFrench Nov 24, 2022
e2e63ed
Expose deployment artifacts from deployments package rather than ABI …
TomAFrench Nov 24, 2022
ac58b6c
chore: update deployment readmes to point to artifact files rather th…
TomAFrench Nov 24, 2022
ef70351
(Re) deployment preparation: `AuthorizerAdaptorEntrypoint` (#2060)
Nov 24, 2022
82bb157
Merge branch 'balancer-master' into yearn-linear-pool
danielmkm Nov 25, 2022
428d6b6
Add version support, port share value helper logic into contract
danielmkm Nov 28, 2022
6362799
update YearnLinearPool tests to work with share value helper
danielmkm Nov 28, 2022
9ff001f
fix lint errors
danielmkm Nov 28, 2022
3920ca6
Add description note
danielmkm Nov 28, 2022
3780b5b
Update docs to match the original implementation
danielmkm Dec 3, 2022
cad93a6
add latest build-info
danielmkm Dec 5, 2022
1054494
remove share value helper references
danielmkm Dec 5, 2022
7dd3620
add versions to the deployment
danielmkm Dec 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,16 @@ jobs:
- name: Benchmark Merkle Claim
run: yarn workspace @balancer-labs/v2-benchmarks measure-merkle-claim

relayer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Benchmark Balancer Relayer - multicall
run: yarn workspace @balancer-labs/v2-benchmarks measure-relayer

env:
CI: true
94 changes: 78 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: CI

env:
CI: true
FOUNDRY_PROFILE: 'intense'

on:
push:
branches:
Expand Down Expand Up @@ -30,111 +34,172 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-solidity-utils test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-solidity-utils test-fuzz

test-standalone-utils:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-standalone-utils test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-standalone-utils test-fuzz

test-vault:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-vault test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-vault test-fuzz

test-pool-utils:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-pool-utils test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-pool-utils test-fuzz

test-pool-weighted:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-pool-weighted test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-pool-weighted test-fuzz

test-pool-stable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-pool-stable test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-pool-stable test-fuzz

test-pool-linear:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-pool-linear test

test-asset-managers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspaces foreach --verbose --include @balancer-labs/v2-asset-manager-* run test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-pool-linear test-fuzz

test-distributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-distributors test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-distributors test-fuzz

test-liquidity-mining:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up environment
uses: ./.github/actions/setup
- name: Compile
run: yarn build
- name: Test
run: yarn workspace @balancer-labs/v2-liquidity-mining test
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: yarn workspace @balancer-labs/v2-liquidity-mining test-fuzz

test-governance-scripts:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -166,8 +231,8 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
- name: Build Balancer JS
run: yarn workspace @balancer-labs/balancer-js build
- name: Build v2-distributors
run: yarn workspace @balancer-labs/v2-distributors build
- name: Compile
run: yarn build # Ideally we wouldn't depend on the packages of other artifacts, but we use some of their mocks
- 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 accross runs.
Expand All @@ -194,6 +259,3 @@ jobs:
OPTIMISM_RPC_ENDPOINT: ${{ secrets.ALCHEMY_OPTIMISM_ARCHIVE_ENDPOINT }}
- name: Test
run: yarn workspace @balancer-labs/v2-deployments test

env:
CI: true
4 changes: 4 additions & 0 deletions .github/workflows/deployment-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
POLYGON_RPC_ENDPOINT: ${{ secrets.POLYGON_INFURA_ENDPOINT }}
ARBITRUM_RPC_ENDPOINT: ${{ secrets.ARBITRUM_INFURA_ENDPOINT }}
OPTIMISM_RPC_ENDPOINT: ${{ secrets.OPTIMISM_INFURA_ENDPOINT }}
BINANCE_RPC_ENDPOINT: ${{ secrets.BINANCE_INFURA_ENDPOINT }}
GNOSIS_RPC_ENDPOINT: ${{ secrets.GNOSIS_INFURA_ENDPOINT }}
GOERLI_RPC_ENDPOINT: ${{ secrets.GOERLI_INFURA_ENDPOINT }}
- name: Check Deployment Addresses
run: yarn workspace @balancer-labs/v2-deployments check-deployments
Expand All @@ -55,6 +57,8 @@ jobs:
POLYGON_RPC_ENDPOINT: ${{ secrets.POLYGON_INFURA_ENDPOINT }}
ARBITRUM_RPC_ENDPOINT: ${{ secrets.ARBITRUM_INFURA_ENDPOINT }}
OPTIMISM_RPC_ENDPOINT: ${{ secrets.OPTIMISM_INFURA_ENDPOINT }}
BINANCE_RPC_ENDPOINT: ${{ secrets.BINANCE_INFURA_ENDPOINT }}
GNOSIS_RPC_ENDPOINT: ${{ secrets.GNOSIS_INFURA_ENDPOINT }}
GOERLI_RPC_ENDPOINT: ${{ secrets.GOERLI_INFURA_ENDPOINT }}
- name: Check Action IDs
run: yarn workspace @balancer-labs/v2-deployments check-action-ids
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ cache/
dist/
pkg/balancer-js/src/typechain/*

# Forge
forge-artifacts/
forge-cache/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "pvt/lib/forge-std"]
path = pvt/lib/forge-std
url = https://github.com/foundry-rs/forge-std
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ Active development occurs in this repository, which means some contracts in it m
- [`v2-liquidity-mining`](./pkg/liquidity-mining): contracts that compose the liquidity mining (veBAL) system.
- [`v2-governance-scripts`](./pkg/governance-scripts): contracts that execute complex governance actions.

## Pre-requisites

The build & test instructions below should work out of the box with Node ^14.18.0. (Please note that it needs Node 14 specifically, and will NOT work with Node 16 or higher. Minor version should be at least 18).

## Clone

This repository uses git submodules; use `--recurse-submodules` option when cloning. For example, using https:

```bash
$ git clone --recurse-submodules https://github.com/balancer-labs/balancer-v2-monorepo.git
```

## Build and Test

Before any tests can be run, the repository needs to be prepared:
Expand All @@ -55,11 +67,27 @@ $ yarn test

You can see a sample report of a test run [here](./audits/test-report.md).

### Foundry (Forge) tests

To run Forge tests, first [install Foundry](https://book.getfoundry.sh/getting-started/installation). The installation steps below apply to Linux or MacOS. Follow the link for additional options.

```bash
$ curl -L https://foundry.paradigm.xyz | bash
$ source ~/.bashrc # or open a new terminal
$ foundryup
```

Then, to run tests in a single package, run:
```bash
$ cd pkg/<package> # e.g. cd pkg/v2-vault
$ yarn test-fuzz
```

## Security

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/core-concepts/security/bug-bounties) to learn more.
Bug bounties apply to most of the smart contracts hosted in this repository: head to [Balancer V2 Bug Bounties](https://docs.balancer.fi/core-concepts/security/bug-bounties) to learn more. Alternatively, send an email to security@balancer.finance.

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-05.pdf):

Expand Down
4 changes: 3 additions & 1 deletion audits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ This directory the reports of audits performed on Balancer smart contracts by di
| MultiRewards, Stable Pool | OpenZeppelin | [`2021-10-09`](./openzeppelin/2021-10-09.pdf) |
| Linear Pool, Stable Phantom Pool | Trail Of Bits | [`2021-12-22`](./trail-of-bits/2021-12-22.pdf) |
| Timelock Authorizer | ABDK | [`2022-04-15`](./abdk/2022-04-15.pdf) |
| Batch Relayer | Trail Of Bits | [`2022-05-23`](./trail-of-bits/2022-05-23.pdf) |
| Batch Relayer | Trail Of Bits | [`2022-06-22`](./trail-of-bits/2022-06-22.pdf) |
| Composable Stable Pool | Certora | [`2022-09-01`](./certora/2022-09-01.pdf) |
| Composable Stable Pool | Trail Of Bits | [`2022-09-22`](./trail-of-bits/2022-09-22.pdf) |
Binary file added audits/certora/2022-09-01.pdf
Binary file not shown.
38 changes: 0 additions & 38 deletions audits/test-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,44 +398,6 @@ codes instead of standard revert strings.
➤ [@balancer-labs/v2-solidity-utils]: ✓ returns false when removing keys not in the set
➤ [@balancer-labs/v2-solidity-utils]: ✓ adds and removes multiple keys (535ms)
➤ [@balancer-labs/v2-solidity-utils]:
➤ [@balancer-labs/v2-solidity-utils]: LogCompression
➤ [@balancer-labs/v2-solidity-utils]: small values
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 1 (307ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 2 (258ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 3 (309ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 4 (262ms)
➤ [@balancer-labs/v2-solidity-utils]: medium and large values
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 5 (273ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 6
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 7 (263ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 8 (414ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 9
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 10
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 11 (287ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 12
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 13
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 14
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 15
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 16 (258ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 17 (344ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 18 (269ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 19
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 20
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 21
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 22
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 23
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 24 (270ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 25
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 26
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 27
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 28
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 29 (255ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 30
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 31 (383ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 32 (281ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 33 (316ms)
➤ [@balancer-labs/v2-solidity-utils]: ✓ encodes and decodes powers of 34 (356ms)
➤ [@balancer-labs/v2-solidity-utils]:
➤ [@balancer-labs/v2-solidity-utils]: ExpLog
➤ [@balancer-labs/v2-solidity-utils]: exponent zero
➤ [@balancer-labs/v2-solidity-utils]: ✓ handles base zero
Expand Down
Binary file added audits/trail-of-bits/2022-09-22.pdf
Binary file not shown.
25 changes: 25 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[profile.default]
src = 'contracts'
out = 'forge-artifacts'
libs = ['node_modules', 'lib']
test = 'test/foundry'
cache_path = 'forge-cache'
allow_paths = ['../', '../../pvt/lib/forge-std']
remappings = [
'ds-test/=../../pvt/lib/forge-std/lib/ds-test/src/',
'forge-std/=../../pvt/lib/forge-std/src/',
'@balancer-labs/=../../node_modules/@balancer-labs/'
]
optimizer = true
optimizer_runs = 9999
solc_version = '0.7.1'
ignored_error_codes = [8261]

[fuzz]
runs = 10000
max_test_rejects = 60000

[profile.intense.fuzz]
verbosity = 3
runs = 100000
max_test_rejects = 600000
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "https://github.com/balancer-labs/balancer-v2-monorepo/issues"
},
"engines": {
"node": ">=12.10"
"node": ">=14.18.0 <15"
},
"contributors": [
"Daniel Fernandez <daniel@balancer.finance>",
Expand Down
Loading