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

Conversation

danielmkm
Copy link

  • YearnLinearPool
  • YearnLinearPoolFactory
  • YearnWrapping

pkg/pool-linear/test/YearnLinearPool.test.ts Show resolved Hide resolved
pool = await createPool();
});

it('sets the vault', async () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what / if they have a standard for test names but on the other tests you used the should do x... notion and here without the should. might wanna have it consistent

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these were copy pasted from another test set of theirs. not entirely sure how to name them using their pattern

Comment on lines +116 to +117
expectTransferEvent(receipt, { from: user.address, to: relayer.address, value: amount }, dai);
expectTransferEvent(receipt, { from: ZERO_ADDRESS, to: user.address, value: yvDaiForAmount }, yvDAI);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt there a more explicit way to verify the token wrapping than checking against transfer events? i mean i guess its pretty reliable but couldnt you also check if dai.balanceOf(yvDAI).is.eq(amount) and yvDAI.balanceOf(user).is.eq(yvDaiForAmount)

Copy link
Author

@danielmkm danielmkm Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, ya agree. did that originally but changed to this method as its how it's being used in other tests 🤷

await expectChainedReferenceContents(relayer, toChainedReference(0), daiForAmount);
});
});
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are no tests to deposit / withdraw to a different user. i mean there is kinda with the relayer as a target but seems like also a bit of a different usecase

EndymionJkb and others added 29 commits September 14, 2022 09:59
* feat: add semantic constants for different meanings of 1 and 0

* refactor: propagate to other helpers

* refactor: use semantic FP constants in pool-linear

* refactor: use semantic FP constants in pool-stable

* refactor: use semantic FP constants in pool-utils

* refactor: use semantic FP constants in pool-weighted

* refactor: use semantic FP constants in vault/utils

* fix: adjust remaining files to remove FP_SCALING_FACTOR

* fix: import arrayFpMul

* lint

* refactor:use FP_100_PCT in expectedAUMFees

Co-authored-by: Tom French <tom@tomfren.ch>
* Adding benchmark for relayer multicall.

* Adding relayer benchmark to CI.

* Update pvt/benchmarks/relayer.ts

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

* Doing 32-byte jumps in relayer benchmark.

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* refactor: push join type handlers into a library

* refactor: push exit type handlers into a library
* refactor: flatten isOnlyOwnerAction function

* test: add tests that ManagedPool implements _isOnlyOwnerAction correctly

* fix: update to account for setSwapFeePercentage moving to ManagedPool

* refactor: remove redundant super

* style: lint
* Extend PoolRegLib

* Add tests
…alancer#1772)

* refactor: avoid double zero duration check in calculateValueChangeProgress

* refactor: remove unnecessary safemath in interpolate value

* docs: update comment
* IMport hardhat inlie

* tom big brain nico smol brain
* refactor: cache token weight in _onSwapGivenIn/Out

* refactor: reuse weightChangeProgress for both weights

* refactor: pass tokens to _getNormalizedWeights

* refactor: use poolId from arg rather than getter

* refactor: reduce bytecode

* style: reorder functions

* refactor: make getInvariant external
* Adding basic Foundry support and test.

* Importing skip foundry tests in base hh config.

* Removing mock foundry tests.

* Adding foundry tests to CI.

* Moving forge-std to pvt.

* Adding foundry.toml to remaining yarn workspaces.

* Adding forge tests to CI in applicable packages.

* Fix for asset managers CI.

* WIP: CI test

* Removing hardhat console from DoubleEntrypointFixRelayer (breaks forge build).

* Fixing submodules.

* forge-test --> test-fuzz.
- -vv --> -vvv

* Removing submodules from CI.

* Using symlinks for foundry.toml.
* refactor: pull _poolState up into ManagedPool

* refactor: remove virtual keyword from functions on ManagedPool

* refactor: remove getters for min and max swap fees
* refactor: move swap fees functions into a separate module contract

* refactor: pass poolState into ManagedPoolSwapFees

* refactor: move swap fee validation into _startGradualSwapFeeChange

* test: add test suite for ManagedPoolSwapFees

* test: remove tests from ManagedPool.test.ts which is covered by new suite

* refactor: remove some of the nasty overrides

* refactor: move external getters onto ManagedPool

* refactor: inline getters which are only used once

* test: update tests to reflect that we don't expose min and max anymore

* feat: enforce proper resolution of start time in ManagedPoolSwapFees

* test: add time travel test

* refactor: return updated pool state from ManagedPoolSwapFees

This is opposed to directly writing to storage

* docs: add natspec

* test: add authentication tests on updateSwapFeeGradually

* fix: set pool state properly in constructor

* refactor: convert ManagedPoolSwapFees into a library

* style: linting

* chore: remove leftover console.log
Adding Foundry install instructions to README.
* Adding recursive submodules to CI for Forge tests.

* Adding 'clone' step in main README to download submodules.
* refactor: remove warm read from swaps

* fix: stack juggling

* docs: add comment for stack issues
…ncer#1779)

* refactor: update _startGradualWeightChange to return updated pool state

* docs: add a comment on the pool state variable.
* Add some fuzz tests

* Improve input helpers test

* Fix word codec tests
* test: replace ManagedPoolStorageLib tests with foundry fuzzing

* test: restrict input range for swap fees

* test: fix extra comma

* refactor: use Test rather than DSTest

* chore: add `pvt/lib/forge-std` to allows paths

* test: replace usage of assetTrue with assertEq

* test: recovered -> actual

* test: make _MAX_SWAP_FEE check inclusive

* chore: move fuzz tests into `test/foundry`

* fix: ensure that amount of BPT to burn is less than LP balance
* Adding AaveWrapping test.

* AaveWrapping test: senderUser --> user.
* refactor: remove asset manager setter

* refactor: remove WordCodec from BasePool

* refactor: remove unused imports

* refactor: remove unused virtual function

* refactor: rearrange functions in BasePool

* refactor: remove mutableTokens argument from BaseWeightedPool constructor

* refactor: remove _getMaxTokens() getter

* refactor: remove setAssetManagerPoolConfig

* style: fix linting
TomAFrench and others added 30 commits November 17, 2022 14:58
* chore: add new AaveLinearPool deployment

* fix: add extra constructor arg to deploy script

* chore: update comments

* chore: deprecate old factory

* chore: align markdown table

* fix: update imports

* docs: update readmes

* test: update linear pool test to use USDT token rather than USDC

* chore: add changelog entry

* Update pkg/deployments/CHANGELOG.md

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

* test: correct address for USDT holder

* test: add test for malicious revert protection

* test: remove `only` from fork test

* fix: correct artifact name for MockAaveLendingPool

* Revert "fix: correct artifact name for MockAaveLendingPool"

This reverts commit 9f099e0.

* Fix fork test CI build step

* chore: remove formatting from build-info

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* refactor: move LBP storage handling to library

* test: add test for error on token weight storage

* style: linter

* test: add tests for swaps and recovery mode

* refactor: remove unused import

* LBP explicit state refactor (balancer#2019)

* refactor: avoid repeated storage reads by passing explicit state

* refactor: inline swap fee helpers

* Update pkg/pool-weighted/contracts/lbp/LiquidityBootstrappingPoolStorageLib.sol

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

Co-authored-by: Jeffrey Bennett <endymionjkb@gmail.com>
* feat: move helpers to WordCodec

* refactor: use new helpers

* refactor: move test helpers from WordCodec to a new helper library

* refactor: use new library in tests

* refactor: remove double awaits

* test: update LiquidityBootstrappingPoolStorageLibTest to use WordCodecHelpers

Co-authored-by: Tom French <tom@tomfren.ch>
* Create recovery helper deployment

* Add other networks
* Add tokens task

* Use inputs

* Add readme

* Apply review comments
* Add Version for AaveLinearPool.

* Add tests.

* Adjust docs.

* Using split pool / factory versions.
Co-authored-by: Tom French <tom@tomfren.ch>
* refactor: make unnecessarily async functions sync

* docs: update readme to use new function signatures

* chore: update changelog

* Update pkg/deployments/CHANGELOG.md

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

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* Add Version unit test.

* Replace foundry with TS.
* Deploy and verify pool on deployment

* Oops
Add event for `performAction` in adaptor entrypoint.
…+ bytecode (balancer#2058)

* feat: store artifacts rather than abi and bytecode separately

* chore: extract artifact files for each contract

* chore: delete contract abi and bytecode files

* feat: expose contract artifacts to external users

* feat: re-add a function to get a contract's ABI

* docs: added changlog entries

* fix: our artifacts weren't real artifacts

* fix: use hardhat's linker rather than the workaround

* style: the lintooor

* refactor: remove redundant function

* fix: correct remaining type issues

* Update pkg/deployments/index.ts

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

* Apply suggestions from code review

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

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

* Task rename.

* Delete deployed transaction IDs / outputs (unused).

* Update artifacts.

* Update readme.

* Update fork test block #.
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.

7 participants