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

Prevent invariant overflow #1690

Merged
merged 2 commits into from
Sep 5, 2022

Conversation

nventuro
Copy link
Contributor

@nventuro nventuro commented Sep 2, 2022

Not quite sure what we were thinking with the lack of SafeMath here 🤷

@nventuro nventuro changed the base branch from composable-stable-deployment to recovery-mode-forfeit-fees September 2, 2022 21:15
EndymionJkb
EndymionJkb previously approved these changes Sep 2, 2022
@EndymionJkb EndymionJkb dismissed their stale review September 2, 2022 21:51

Still have those division by zero errors in this branch

Base automatically changed from recovery-mode-forfeit-fees to composable-stable-deployment September 5, 2022 14:39
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
@nventuro nventuro merged commit 9d203db into composable-stable-deployment Sep 5, 2022
@nventuro nventuro deleted the prevent-invariant-overflow branch September 5, 2022 17:05
nventuro added a commit that referenced this pull request Sep 8, 2022
* Fix BasePool permissioned function owner only state not being used (#1657)

* Make Stable `getRate` consider unpaid protocol fees (#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 <EndymionJkb@gmail.com>

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

Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>

* Revert "Rename getBalances"

This reverts commit 0c7c75d.

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

* Lintor

* Provide fee setter helper

Co-authored-by: Tom French <tom@tomfren.ch>
Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

* typo

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

* Pay protocol fees on cache update (#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 <EndymionJkb@gmail.com>

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

* Forfeit protocol fees on recovery mode disable (#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 <EndymionJkb@gmail.com>

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

Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>

Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>

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

* Add small comment on decreasing rates

* Apply suggestions from code review

Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>

* Update ComposableStablePoolProtocolFees.sol

Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>

* Prevent invariant overflow (#1690)

* Add check to prevent invariant overflow

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

* fix: add missing bracket

* style: the lintoor

* Reduce ComposableStable bytecode size (#1696)

* Simplify immutable accesses

* refactor: use stack variable for totalTokens

* refactor: unbreak the other function

Co-authored-by: Tom French <tom@tomfren.ch>

* Add reentrancy comment (#1703)

* Add getActualSupply (#1704)

* Add getActualSupply

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

* Remove virtual supply

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

* Update deployment info (#1707)

* Do deployment (#1708)

* Fix missing migration

* Fix weighted build

* Remove old compo pool action ids

* New ComposableStablePool action ids (#1711)

* ComposableStablePool mainnet action-ids

* ComposableStablePool arbitrum action-ids

* ComposableStablePool polygon action-ids

* ComposableStablePool goerli action-ids (#1712)

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: EndymionJkb <EndymionJkb@gmail.com>
Co-authored-by: Markus Buhatem Koch <markusbkoch@gmail.com>
jubeira pushed a commit that referenced this pull request Nov 24, 2022
* Add check to prevent invariant overflow

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
TomAFrench added a commit that referenced this pull request Nov 24, 2022
* Add check to prevent invariant overflow

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
TomAFrench added a commit that referenced this pull request Nov 24, 2022
* Add check to prevent invariant overflow

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
TomAFrench added a commit that referenced this pull request Nov 24, 2022
* Add check to prevent invariant overflow

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
TomAFrench added a commit that referenced this pull request Nov 25, 2022
* Add check to prevent invariant overflow

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
nventuro added a commit that referenced this pull request Nov 30, 2022
* Prevent invariant overflow (#1690)

* Add check to prevent invariant overflow

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

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>

* Composable stable pool versioning (#2034)

* WIP: version for ComposableStablePool.

* Fix stack too deep error and adjust tests.

* ComposableStablePoolFactory test.

* Remove unused var.

* Add factory version / pool version.

* Fix benchmarks.

* Remove IVersionProvider.

* feat: add proportional joins/exits

* Deployment preparation: Composable stable pool v2 (#2028)

* feat: add proportional joins/exits to ComposableStablePool

* deprecate 20220906-composable-stable-pool task

* add new task

* add artifacts

* checkpoint

* refactor: finish fork test

* refactor: remove weighted encoder name change (extraneous for this deployment)

* feat: add deprecations section to stable pool, and update deployments readme

* fix: deprecated paths

* Update README.md

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>

* fix: re-add _computeProportionalAmountsOut

* test: update test to remove use of deprecated function

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Juan Ignacio Ubeira <juani@balancer.finance>
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.

3 participants