Skip to content

Conversation

@Nick-Certora
Copy link

Description

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests are included for all code paths
  • The base branch is either master, or there's a description of how to merge

Issue Resolution

TomAFrench and others added 30 commits September 8, 2022 10:52
…alancer#1718)

* refactor: return preJoinExitInvariant from beforeJoinExit

* fix: plaster fix over managed pool invariant issue
* chore: add deployment task for new WeightedPool

* chore: deprecate old weighted pool deployment

* chore: markdown formatting

* chore: address review comments

* fix: update import paths in deprecated task

* Update pkg/deployments/README.md

Co-authored-by: Nicolás Venturo <[email protected]>
* Fix BasePool permissioned function owner only state not being used (balancer#1657)

* Make Stable `getRate` consider unpaid protocol fees (balancer#1683)

* Remove StableMath.getRate

* Clarify return value in protocol fee module

* Fix get rate

* Add tests

* Add yield tests

* Rename getBalances

* Reuse test code

* Add integration test

* Add exit tests

* style: lintooor

* Update pkg/pool-stable/contracts/ComposableStablePool.sol

Co-authored-by: EndymionJkb <[email protected]>

* Update pkg/pool-stable/test/ComposableStablePool.test.ts

Co-authored-by: EndymionJkb <[email protected]>

* Revert "Rename getBalances"

This reverts commit 0c7c75d.

* Update pkg/pool-stable/test/ComposableStablePool.test.ts

Co-authored-by: Tom French <[email protected]>

* Lintor

* Provide fee setter helper

Co-authored-by: Tom French <[email protected]>
Co-authored-by: EndymionJkb <[email protected]>
Co-authored-by: Tom French <[email protected]>

* typo

* Fix argument name of protocol fee cache update event (balancer#1689)

* Pay protocol fees on cache update (balancer#1684)

* Pay protocol fees on cache update

* Fix typo

* Add docs

* Add proto cache hook tests

* Add pause behavior and tests

* Fix tests

* Fix integration test

* Update pkg/pool-utils/contracts/ProtocolFeeCache.sol

Co-authored-by: EndymionJkb <[email protected]>

* Update pkg/pool-stable/contracts/ComposableStablePool.sol

Co-authored-by: Tom French <[email protected]>

Co-authored-by: EndymionJkb <[email protected]>
Co-authored-by: Tom French <[email protected]>

* Forfeit protocol fees on recovery mode disable (balancer#1687)

* Pay protocol fees on cache update

* Fix typo

* Add docs

* Add proto cache hook tests

* Add pause behavior and tests

* Fix tests

* Forfeit protocol fees on recovery mode disable

* Update pkg/pool-stable/contracts/ComposableStablePool.sol

Co-authored-by: EndymionJkb <[email protected]>

* Update pkg/pool-stable/test/ComposableStablePool.test.ts

Co-authored-by: EndymionJkb <[email protected]>

Co-authored-by: EndymionJkb <[email protected]>

* Add comment on decreasing StablePool token rates (balancer#1688)

* Add small comment on decreasing rates

* Apply suggestions from code review

Co-authored-by: EndymionJkb <[email protected]>

* Update ComposableStablePoolProtocolFees.sol

Co-authored-by: EndymionJkb <[email protected]>

* Prevent invariant overflow (balancer#1690)

* Add check to prevent invariant overflow

* Update pkg/pool-stable/contracts/ComposableStablePoolProtocolFees.sol

Co-authored-by: Tom French <[email protected]>

Co-authored-by: Tom French <[email protected]>

* fix: add missing bracket

* style: the lintoor

* Reduce ComposableStable bytecode size (balancer#1696)

* Simplify immutable accesses

* refactor: use stack variable for totalTokens

* refactor: unbreak the other function

Co-authored-by: Tom French <[email protected]>

* Add reentrancy comment (balancer#1703)

* Add getActualSupply (balancer#1704)

* Add getActualSupply

* Update pkg/pool-stable/test/ComposableStablePool.test.ts

Co-authored-by: Tom French <[email protected]>

* Update pkg/pool-stable/contracts/ComposableStablePool.sol

Co-authored-by: Tom French <[email protected]>

* Remove virtual supply

Co-authored-by: Tom French <[email protected]>

* Update deployment info (balancer#1707)

* Do deployment (balancer#1708)

* Fix missing migration

* Fix weighted build

* Remove old compo pool action ids

* New ComposableStablePool action ids (balancer#1711)

* ComposableStablePool mainnet action-ids

* ComposableStablePool arbitrum action-ids

* ComposableStablePool polygon action-ids

* ComposableStablePool goerli action-ids (balancer#1712)

Co-authored-by: Nicolás Venturo <[email protected]>
Co-authored-by: EndymionJkb <[email protected]>
Co-authored-by: Markus Buhatem Koch <[email protected]>
Co-authored-by: Nicolás Venturo <[email protected]>
* Simplify ProtocolFeeCache

* Remove extra argument in callsites

* fix: complete removal of hardcoded swap protocol fee

* docs: update stale comment

* style: linting

* fix: remove remaining protocolSwapFeePercentage arg

* fix: ok really removed the stragglers this time

* fix: ok *this* time

* docs: update stale comment

* style: pls

Co-authored-by: Tom French <[email protected]>
Testing peekChainedReferenceValue in a static multicall.
* Remove join hook from add token

* Apply suggestions from code review

Co-authored-by: Tom French <[email protected]>
…lancer#1731)

* refactor: use specialized invariant variant to calculate managed swap fees

* chore: remove ArrayHelpers

* fix: clean up dangling import

* refactor: replace fixed size arrays with raw uints
Adding Gauge Actions test.

Testing:
- Liquidity and rewards-only gauges
- Multiple amounts (within and outside the allowed range)
- Immediate values and chained references
- Changing sender and recipient
…1730)

* feat: add ManagedPoolTokenLib

* refactor: rework ManagedPool to make use of ManagedPoolTokenLib

* feat: add function to return a token's start and end weights

* feat: push search for minimum token weight into ManagedPoolTokenLib

* refactor: clean up unused constants and update comment to point to lib

* refactor: remove normalization functions from ManagedPool

* test: add test for getMinimumTokenEndWeight

* docs: natspec

* feat: add initializeTokenState function

* refactor: autocompute offsets

* refactor: expand _MAX_DENORM_WEIGHT to fill entire bit width

* docs: add natspec

* docs: add separator

* docs: bitmap comment

* fix: re-add weight compression and add comment for unsmort people
* Upgrade to 2.11.1

* Add to v2 helpers

* fix: add empty headers object to forking config

Co-authored-by: Tom French <[email protected]>
* build: bump @nomiclabs/hardhat-ethers to 2.0.6

* refactor: make use of getContractFactoryFromArtifact so we can use hardhat's linking
)

* refactor: move helper functions for scaling out to lib

* style: disable solhint

* test: move tests for scaling into separate test file

* docs: add blurb on ScalingHelpers

* style: re-add linting disable
* refactor: move pool registration code into a simple lib

* refactor: split of registration from setting immutables

* docs: add comment explaining lack of length checks on tokens/AMs

* test: add test to check that vault length checks apply
* refactor: simplify BaseWeightedPool hooks

* refactor: inline _onSwapGivenIn into ManagedPool

* refactor: remove unused function
* feat: add ManagedPoolStorageLib

* refactor: autocompute offsets

* refactor: rework weight and swap fee setters to nicer solidity which results in identical bytecode

* chore: rename miscData to poolState

* docs: natspec

* refactor: change swap fee bit lengths to match

* feat: add recovery mode to poolState

* chore: remove natspec from mock

* fix: re-add functions which got disappeared in a rebase

* docs: natspec

* feat: expose `getWeightChangeFields` and `getSwapFeeFields` from library
* feat: set `_lastAumFeeCollectionTimestamp` on initialisation

* test: update tests to reflect new aum fee initialization

* feat: collect AUM fees before updating the protocol fee cache

* docs: add comment on no AUM fees before initialisation

* Move AUM fee calculation into a library (balancer#1742)

* refactor: move AUM fee calculation into a library

* test: add simple tests for ProtocolAUMFees

* Apply suggestions from code review

Co-authored-by: Nicolás Venturo <[email protected]>

* test: add worked example and test

* docs: add comment on BPT fee percentages

Co-authored-by: Nicolás Venturo <[email protected]>

* refactor: remove if statement

Co-authored-by: Nicolás Venturo <[email protected]>
Juan Ignacio Ubeira and others added 30 commits October 26, 2022 12:59
* PR template

Inspired by the front end; this might be useful for us to

* refactor: review comments
* refactor: rename BasePool to LegacyBasePool

* refactor: move new BasePool out of managed pool

* refactor: rename again to reduce diff
* refactor: rename BasePool to LegacyBasePool

* refactor: move new BasePool out of managed pool

* refactor: generalize BasePool to handle LinearPool's need for the recipient

* refactor: add _computeScalingFactor to helpers (no longer in BasePool)

* refactor: move LinearPool to BasePool

* refactor: some renaming and reorganization

* refactor: rename again to reduce diff

* fix: cardinality of assetManagers

* refactor: don't mint if 0 tokens

* refactor: adjust to constant composable BPT index

* lint

* docs: move comments

* refactor: refactor token sorting; remove unused function

* eslint

* lint (function args)

* lint

* refactor: inline constants

* refactor: allow minting 0 BPT

* fix: encode targets

* test: add test to ensure target setting does not overwrite state
* Protocol fee splitter wip

* add more tests

* add deployment, minor changes

* Minor changes regarding errors in tests

* Add default default revenue sharing fee percentage

* update function to pure

* Add Pool's beneficiary

* Use ProtocolFeesWithdrawer instead of ProtocolFeesCollector (#2)

* Protocol fee splitter refactor (#3)

* remove unused errors

* Update deployment script for ProtocolFeeSplitter

* update test, style change

* Update MockPool

* update modifier on MockPool

* Remove getOwner from IBasePool

* Fix linter error

* Remove getOwner from MockPool

* Last protocol fee splitter fixes (#4)

* Fix task inputs

* Update readmes and changelogs

* Hide struct inside contract

* Make interfaces 'view'

* Fix iface docs

* Minor refactors

* Rename random to other

* Minor test simplifications

* Split getter tests

* Remove unused values

* Fix test transfer

* Fix test

* Update pkg/interfaces/contracts/standalone-utils/IProtocolFeeSplitter.sol

Co-authored-by: Nicolás Venturo <[email protected]>

Co-authored-by: Nicolás Venturo <[email protected]>
L2 Gauge Checkpointer: implementation and unit tests.
* refactor: remove explicit AuthorizerAdaptor deployment

* refactor: avoid explicit AuthorizerAdaptor deployment

* refactor: avoid explicit authorizer deployment in pool-utils

* refactor: remove explicit authorizer deployment in pool-weighted

* refactor: remove explicit authorizer deployment in solidity-utils, and silence lint warnings

* refactor: remove explicit deployment of Authorizer in standalone-utils

* refactor: remove explicit deployments from the vault

* refactor: have the Vault deploy an AuthorizerAdaptor

* refactor: getArtifact is synchronous

* Syntactic sugar

* fix: point to correct package
* refactor: rebase LBP

* refactor: visibility and function order

* fix: adjust offset and remove redundant event

* refactor: use UNIMPLEMENTED error vs UNHANDLED_BY_LBP
* Add file and name optional parameters to check-artifacts task.

* Improve deploying instructions for extract-artifacts.

* Nit: argument rename in artifact.ts.

* Update pkg/deployments/package.json

Co-authored-by: Tom French <[email protected]>

* Update pkg/deployments/DEPLOYING.md

Co-authored-by: Tom French <[email protected]>

* Remove extra try / catch in artifact.ts.

Co-authored-by: Tom French <[email protected]>
* Add note about Node / Yarn versions in README.
Upgrade dependencies.
-  Using `yarn up`
- Linters / formatters excluded
Upgrade ESLint and Prettier.
Add authorizer adaptor entrypoint.

Co-authored-by: Tom French <[email protected]>
Co-authored-by: Jeffrey Bennett <[email protected]>
* Add Certora ComposableStablePool report

* Update audit report with commit

* docs: fix filename

Co-authored-by: Jeffrey Bennett <[email protected]>
…ancer-v2-monorepo into Certora/ComposableStablePool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants