Skip to content

Commit

Permalink
Feat/generic harvester (#117)
Browse files Browse the repository at this point in the history
* feat: first version of generic harvester

* feat: generic harvester swap and vault

* feat: remove access control from adjustYield

* feat: merge genericHarvester into a single contract

* feat: multi block rebalancer

* feat: correct permissions for MultiMockRebalancer

* feat: slippage handling for MultiblockRebalancer

* feat: remove old harvesters

* feat: correct slippage computation for the vault

* feat: refactory harvesters to abstract common code

* feat: deploy scripts for new harvesters

* style: format BaseRebalancer

* feat: remove comment

* chore: remove useless file

* fix: correct computation of slippage for XEVT

* feat: specify balance in finalizeRebalance function

* refactor: rename swap arguments

* refactor: change mapping of stablecoin to yieldbearing to the oposite

* feat: harvest function for both harvester contracts

* feat: checkSlippage with decimals

* chore: remove old rebalancer interfaces

* style: fix lint issues for the new contracts

* feat: remove useless setYieldBearingAssetData function override

* feat: correct computation of the rebalancing

* fix: correct sleeping check + toggleTrusted

* TEMP feat: tests

* feat: computeRebalanceAmount public function

* fix: correct rebalancing computation + min/max for stablecoin

* tests: add more complete tests for the harvesting of the different assets and multple scenarios

* refactor: rename minExposure / maxExposure to be more explicit

* feat: check for msg.sender instead of receiver when removing budget

* doc: add some explanation on scale

* feat: system for allowed addresses to update the target exposure of a yield bearing asset

* doc: finalize sentance

* doc: misspell

* feat: remove underflow checks

* feat: make updateLimitExposure permissionless

* feat: internalize scaling of amount

* feat: only allowed or guardian

* fix: update state before sending tokens in addBudget

* style: refactor blocks for GenericHarvester

* fix: better slippage handling for vaults

* feat: IXEVT interface

* feat: refactor access control so there is only one onlyTrusted mapping

* style: fix lint of comments

* tests: update tests to add missing functionnalities

* feat: remove mint and burn from MultiBlockHarvester

* doc: typo

* feat: declare depositAddress in the upper scope

* feat: simplify rebalance

* feat: specify block fork number

* refactor: rename stablecoin to depositAsset

* feat: add unchecked blocks to _checkSlippage

* refactor: rename depositAsset to asset

* feat: remove MaxOrderAmount check

* tests: remove tooBigAmountIn

* tests: setup of generic harvester + budget

* tests: setters

* feat: revert if zero amount for GenericHarvester

* fix: correct generic harvester swaps

* tests: add not enough budget test

* feat: remove swap slippage

* tests: increase and decrease steak_USDC exposure

* feat: remove swapSlippage variable

* feat: set maxSlippage to 0.3%

* tests: add generic harvester swap test

* tests: add decimals tests

* feat: recover ERC20s

* feat: events for harvester
  • Loading branch information
0xtekgrinder authored Oct 29, 2024
1 parent 1c417c4 commit f7bb92f
Show file tree
Hide file tree
Showing 38 changed files with 1,751 additions and 2,830 deletions.
3 changes: 2 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"error",
120
],
"immutable-vars-naming": "off",
"avoid-call-value": "warn",
"avoid-low-level-calls": "off",
"avoid-tx-origin": "warn",
Expand Down Expand Up @@ -38,4 +39,4 @@
"explicit"
]
}
}
}
368 changes: 233 additions & 135 deletions contracts/helpers/BaseHarvester.sol

Large diffs are not rendered by default.

113 changes: 0 additions & 113 deletions contracts/helpers/BaseRebalancerFlashloan.sol

This file was deleted.

Loading

0 comments on commit f7bb92f

Please sign in to comment.