Skip to content

Commit

Permalink
OETH Curve AMO (#1341)
Browse files Browse the repository at this point in the history
* Start of VaultTwo

* No vault Two

* Extract units conversion to method

* Exchange rate supporting Vault

* Remove unneeded memory array

* Change to using enums for exchange rate types

* Documentation on _toUnits

* OETH - Allow initialize time control of OUSD resolution (#1273)

* Allow initialize time control of OUSD resolution

* Remove debugging

* Correct mint / redeem with oracle

* add the main deploy file for OETH

* make it possible for the 5/8 multisig to be the governor of deployments

* prettier

* Gas efficiency

* add frax eth deployment

* basic sfraxETH strategy implementation

* add brownie env to git ignore

* prettier

* Remove unused code

* add the infrastructure for fork tests

* hardcode oracle price

* finish up the fraxETH strategy fork tests and fix a bug

* lint and some minor fixes

* deployment file fix

* Slither db update for false positives

* add a test that checks we can withdraw what the checkBalance returns

* minor fix

* Correct license for new contracts

* Deploy is ready

* Add redeem fee variable

* add slither exceptions

* fix tests (#1317)

* OETH - Oracle router changes (#1314)

* start oracle separation

* add slither ignores

* create a suggestion of how to check for prices in the Vault

* remove logs

* better name

* minor refactor

* minor refactor v2

* move unit pricing to a separate function

* refactor

* better comment

* refactor Vault contract and correct price calculation in priceUnit(Mint/Redeem) functions

* add range checks

* Prettier and address cleanup

* Small cleanup

* Add back in missing constant

---------

Co-authored-by: Daniel Von Fange <[email protected]>

* fix oracle tests

* fix tests

* more fixes

* fix slither

* ETH / sfrxeth zapper (#1316)

* Initial draft zapper

* Initial draft zapper

* Add deploy file for zapper

* Remove WETH partial support, out of scope in this PR

* Happy Slither

* WETH support

* move decimals cache to asset struct (#1319)

* WOETH deployment (#1320)

* add WOETH deployment

* deploy separate files

* Let’s just call them decimals

* add decimalsCache to existing Vault

* prettier

* deployment numbering

* fork test fix

* run decimals cache only in forked environment

* prettier

* Remove unused buyback trigger

* rETH support

* support oracles reporting feeds with different decimal format (#1321)

* support oracles reporting feeds with different decimal format

* lint

* gas optimisation

* Add support for stETH

* Use default strat for frxETH

* harvester & unit tests (#1331)

* Start of VaultTwo

* No vault Two

* Extract units conversion to method

* Exchange rate supporting Vault

* Remove unneeded memory array

* Change to using enums for exchange rate types

* Documentation on _toUnits

* OETH - Allow initialize time control of OUSD resolution (#1273)

* Allow initialize time control of OUSD resolution

* Remove debugging

* Correct mint / redeem with oracle

* add the main deploy file for OETH

* make it possible for the 5/8 multisig to be the governor of deployments

* prettier

* Gas efficiency

* add frax eth deployment

* basic sfraxETH strategy implementation

* add brownie env to git ignore

* prettier

* Remove unused code

* add the infrastructure for fork tests

* hardcode oracle price

* finish up the fraxETH strategy fork tests and fix a bug

* lint and some minor fixes

* deployment file fix

* Slither db update for false positives

* add a test that checks we can withdraw what the checkBalance returns

* minor fix

* Correct license for new contracts

* Deploy is ready

* Add redeem fee variable

* add slither exceptions

* fix tests (#1317)

* OETH - Oracle router changes (#1314)

* start oracle separation

* add slither ignores

* create a suggestion of how to check for prices in the Vault

* remove logs

* better name

* minor refactor

* minor refactor v2

* move unit pricing to a separate function

* refactor

* better comment

* refactor Vault contract and correct price calculation in priceUnit(Mint/Redeem) functions

* add range checks

* Prettier and address cleanup

* Small cleanup

* Add back in missing constant

---------

Co-authored-by: Daniel Von Fange <[email protected]>

* fix oracle tests

* fix tests

* more fixes

* fix slither

* ETH / sfrxeth zapper (#1316)

* Initial draft zapper

* Initial draft zapper

* Add deploy file for zapper

* Remove WETH partial support, out of scope in this PR

* Happy Slither

* WETH support

* move decimals cache to asset struct (#1319)

* WOETH deployment (#1320)

* add WOETH deployment

* deploy separate files

* Let’s just call them decimals

* add decimalsCache to existing Vault

* prettier

* deployment numbering

* fork test fix

* run decimals cache only in forked environment

* prettier

* Remove unused buyback trigger

* rETH support

* support oracles reporting feeds with different decimal format (#1321)

* support oracles reporting feeds with different decimal format

* lint

* gas optimisation

* harvester now considers different oracle decimals. Fixing unit tests

---------

Co-authored-by: Daniel Von Fange <[email protected]>

* add some addresses

* deploy of OETH 053

* add remaining deployment files

* fix bug

* add guardian actions helper

* use updated ABI in brownie

* add deployment files

* Deploy 53 OETH and 54 WOETH (#1334)

* deploy of OETH 053

* add remaining deployment files

* add guardian actions helper

* use updated ABI in brownie

---------

Co-authored-by: Daniel Von Fange <[email protected]>

* prepare forked environment for Curve pool

* add initial code for the OETH Metastrategy implementation

* improvements

* pass cli params to hardhat test when testing in forked mode

* when setting up curve pool add in some liqudity

* fix bugs

* pass mint fork test of Curve AMO

* various fixes

* make the pool config vars the same as cbEth

* use lp_price instead of virtual price when figuring out the amount of underlying tokens

* make redeems work

* use virtual price instead of lp price

* add withdrawAll test

* add harvester to the OETH deploy script and add harvesting of the rewards to the strategy

* add additional harvester configuration

* Prettier

* Merge cleanup

* Zapper cleanup

* remove console.log

* Zapper: Better event name

* Add slither excludes to triage file

* Remove inline slither comments and add docstrings

* cleaner wording

* Explicity access levels on vars

* Zapper redeploy

* Lint: cleanup extra variable

* Deploy 56 - OUSD Zapper Redeploy (#1364)

* Deploy 56 Zapper

* Remove forceDeploy

* Don't show zapper no return checks

* upgrade Oracle so that it supports price feeds of asset pairs. Adjust the change accross the board.

* change asset count to 2

* Move vault check to after redeem is complete.

* Happy Lint, happy Pretttier

* Prettier

* Convert to Curve V1 ETH pool

* Small cleanup on EthMetaStrategy

* Remove unused interface file

* Allow zero governance deploy files

* Get unit tests mostly running again

* fix tests

* simplify the Oracles and update the fork tests and deploy scripts

* fix some unit tests

* some unit test fixes

* more fixes

* configure dripper deploy

* fix dripper configuration and test

* fix some comments and unit tests

* move important fixture config to deploy script

* don't set it as the asset default strategy

* fix another unit test

* another test fix

* update deploy script to use Convex Gauge already deployed on the mainnet

* prettier

* lint

* slither disable

* fix fork test

* update slither detector name

* mainnet deploy 58 (#1435)

* add some reminder comments

* add safe equivalents of transfer and approve

* use transfer for WETH instead of safe transfer

* slither fix

* simplify calculation

* another slither fix attempt

* parenthesis are important

* set unit test rebasingCreditsPerToken to 1e27 and fix vault value checker tests

* apply changes on master branch

* fix unit test and prettier

* change log to console.log

---------

Co-authored-by: Daniel Von Fange <[email protected]>
  • Loading branch information
sparrowDom and DanielVF authored May 15, 2023
1 parent 205c647 commit 107f6da
Show file tree
Hide file tree
Showing 29 changed files with 2,025 additions and 395 deletions.
3 changes: 3 additions & 0 deletions brownie/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# OUSD Contracts
OUSD = '0x2A8e1E676Ec238d8A992307B495b45B3fEAa5e86'
OETH = '0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3'
AAVE_STRAT = '0x5e3646A1Db86993f73E6b74A57D8640B69F7e259'
COMP_STRAT = '0x9c459eeb3FA179a40329b81C1635525e9A0Ef094'
CONVEX_STRAT = '0xEA2Ef2e2E5A749D4A66b41Db9aD85a38Aa264cb3'
Expand All @@ -27,6 +28,7 @@
HARVESTER = '0x21fb5812d70b3396880d30e90d9e5c1202266c89'
DRIPPER = '0x80c898ae5e56f888365e235ceb8cea3eb726cb58'
VAULT_PROXY_ADDRESS = '0xE75D77B1865Ae93c7eaa3040B038D7aA7BC02F70'
VAULT_OETH_PROXY_ADDRESS = '0x39254033945AA2E4809Cc2977E7087BEE48bd7Ab'
VAULT_ADMIN_IMPL = '0x1eF0553FEb80e6f133cAe3092e38F0b23dA6452b'
VAULT_CORE_IMPL = '0xf00d4b19458c594d4ea9d0b9861edfd2c444fa9a'
VAULT_VALUE_CHECKER = '0xEEcD72c99749A1FC977704AB900a05e8300F4318'
Expand All @@ -46,6 +48,7 @@
CVX = '0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B'
FRAX = '0x853d955aCEf822Db058eb8505911ED77F175b99e'
BUSD = '0x4Fabb145d64652a948d72533023f6E7A623C7C53'
WETH = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'

THREEPOOL_LP = '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'
OUSD_METAPOOL = '0x87650D7bbfC3A9F10587d7778206671719d9910D'
Expand Down
4 changes: 4 additions & 0 deletions brownie/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def load_contract(name, address):

frax = load_contract('ERC20', FRAX)
busd = load_contract('ERC20', BUSD)
weth = load_contract('ERC20', WETH)
ousd = load_contract('ousd', OUSD)
oeth = load_contract('ousd', OETH)
usdt = load_contract('usdt', USDT)
usdc = load_contract('usdc', USDC)
dai = load_contract('dai', DAI)
Expand All @@ -38,6 +40,8 @@ def load_contract(name, address):
veogv = load_contract('veogv', VEOGV)
vault_admin = load_contract('vault_admin', VAULT_PROXY_ADDRESS)
vault_core = load_contract('vault_core', VAULT_PROXY_ADDRESS)
vault_oeth_admin = load_contract('vault_admin', VAULT_OETH_PROXY_ADDRESS)
vault_oeth_core = load_contract('vault_core', VAULT_OETH_PROXY_ADDRESS)
vault_value_checker = load_contract('vault_value_checker', VAULT_VALUE_CHECKER)
dripper = load_contract('dripper', DRIPPER)
harvester = load_contract('harvester', HARVESTER)
Expand Down
Loading

0 comments on commit 107f6da

Please sign in to comment.