@@ -3,7 +3,7 @@ const hre = require("hardhat");
3
3
const { ethers } = hre ;
4
4
5
5
const addresses = require ( "../utils/addresses" ) ;
6
- const { balancer_rETH_WETH_PID } = require ( "../utils/constants" ) ;
6
+ const { balancer_rETH_WETH_PID, balancer_stETH_WETH_PID } = require ( "../utils/constants" ) ;
7
7
const {
8
8
fundAccounts,
9
9
fundAccountsForOETHUnitTests,
@@ -27,6 +27,7 @@ const threepoolSwapAbi = require("./abi/threepoolSwap.json");
27
27
const sfrxETHAbi = require ( "./abi/sfrxETH.json" ) ;
28
28
const { deployWithConfirmation } = require ( "../utils/deploy" ) ;
29
29
const { defaultAbiCoder, parseUnits, parseEther } = require ( "ethers/lib/utils" ) ;
30
+ const balancerStrategyDeployment = require ( "../utils/balancerStrategyDeployment" ) ;
30
31
31
32
const defaultFixture = deployments . createFixture ( async ( ) => {
32
33
await deployments . fixture (
@@ -828,34 +829,95 @@ async function convexVaultFixture() {
828
829
}
829
830
830
831
/**
831
- * Configure a Vault with only the balancerREthStrategy
832
+ * Configure a Vault with the balancerREthStrategy
832
833
*/
833
- async function balancerREthFixture ( ) {
834
- const fixture = await loadFixture ( defaultFixture ) ;
835
- const { oethVault, timelock, weth, reth, balancerREthStrategy, josh } =
836
- fixture ;
834
+ function balancerREthFixtureSetup ( ) {
835
+ return deployments . createFixture ( async ( ) => {
836
+ const fixture = await defaultFixture ( ) ;
837
+ const { oethVault, timelock, weth, reth, balancerREthStrategy, josh } =
838
+ fixture ;
837
839
838
- await oethVault
839
- . connect ( timelock )
840
- . setAssetDefaultStrategy ( reth . address , balancerREthStrategy . address ) ;
841
- await oethVault
842
- . connect ( timelock )
843
- . setAssetDefaultStrategy ( weth . address , balancerREthStrategy . address ) ;
840
+ await oethVault
841
+ . connect ( timelock )
842
+ . setAssetDefaultStrategy ( reth . address , balancerREthStrategy . address ) ;
843
+ await oethVault
844
+ . connect ( timelock )
845
+ . setAssetDefaultStrategy ( weth . address , balancerREthStrategy . address ) ;
844
846
845
- fixture . rEthBPT = await ethers . getContractAt (
846
- "IERC20Metadata" ,
847
- addresses . mainnet . rETH_WETH_BPT ,
848
- josh
849
- ) ;
850
- fixture . balancerREthPID = balancer_rETH_WETH_PID ;
847
+ fixture . rEthBPT = await ethers . getContractAt (
848
+ "IERC20Metadata" ,
849
+ addresses . mainnet . rETH_WETH_BPT ,
850
+ josh
851
+ ) ;
852
+ fixture . balancerREthPID = balancer_rETH_WETH_PID ;
851
853
852
- fixture . balancerVault = await ethers . getContractAt (
853
- "IBalancerVault" ,
854
- addresses . mainnet . balancerVault ,
855
- josh
856
- ) ;
854
+ fixture . balancerVault = await ethers . getContractAt (
855
+ "IBalancerVault" ,
856
+ addresses . mainnet . balancerVault ,
857
+ josh
858
+ ) ;
857
859
858
- return fixture ;
860
+ return fixture ;
861
+ } )
862
+ }
863
+
864
+ /**
865
+ * Configure a Vault with the balancer strategy for wstETH/WETH pool
866
+ */
867
+ function balancerWstEthFixtureSetup ( ) {
868
+ return deployments . createFixture ( async ( ) => {
869
+ const fixture = await defaultFixture ( ) ;
870
+
871
+ const d = balancerStrategyDeployment ( {
872
+ deploymentOpts : {
873
+ deployName : "99999_balancer_wstETH_WETH" ,
874
+ forceDeploy : true ,
875
+ deployerIsProposer : true ,
876
+ } ,
877
+ proxyContractName : "OETHBalancerMetaPoolwstEthStrategyProxy" ,
878
+
879
+ platformAddress : addresses . mainnet . wstETH_WETH_BPT ,
880
+ poolId : balancer_stETH_WETH_PID ,
881
+
882
+ auraRewardsContractAddress : addresses . mainnet . wstETH_WETH_AuraRewards ,
883
+
884
+ rewardTokenAddresses : [ addresses . mainnet . BAL , addresses . mainnet . AURA ] ,
885
+ assets : [ addresses . mainnet . stETH , addresses . mainnet . WETH ] ,
886
+ } )
887
+
888
+ await d ( hre )
889
+
890
+
891
+ const balancerWstEthStrategyProxy = await ethers . getContract ( "OETHBalancerMetaPoolwstEthStrategyProxy" )
892
+ const balancerWstEthStrategy = await ethers . getContractAt ( "BalancerMetaPoolStrategy" , balancerWstEthStrategyProxy . address )
893
+
894
+ fixture . balancerWstEthStrategy = balancerWstEthStrategy
895
+
896
+ const { oethVault, timelock, weth, stETH, josh } =
897
+ fixture ;
898
+
899
+ await oethVault
900
+ . connect ( timelock )
901
+ . setAssetDefaultStrategy ( stETH . address , balancerWstEthStrategy . address ) ;
902
+ await oethVault
903
+ . connect ( timelock )
904
+ . setAssetDefaultStrategy ( weth . address , balancerWstEthStrategy . address ) ;
905
+
906
+ fixture . stEthBPT = await ethers . getContractAt (
907
+ "IERC20Metadata" ,
908
+ addresses . mainnet . wstETH_WETH_BPT ,
909
+ josh
910
+ ) ;
911
+ fixture . balancerWstEthPID = balancer_stETH_WETH_PID ;
912
+
913
+ fixture . balancerVault = await ethers . getContractAt (
914
+ "IBalancerVault" ,
915
+ addresses . mainnet . balancerVault ,
916
+ josh
917
+ ) ;
918
+
919
+ return fixture ;
920
+ } )
859
921
}
860
922
861
923
async function fundWith3Crv ( address , maxAmount ) {
@@ -1656,7 +1718,8 @@ module.exports = {
1656
1718
impersonateAndFundContract,
1657
1719
impersonateAccount,
1658
1720
fraxETHStrategyFixtureSetup,
1659
- balancerREthFixture,
1721
+ balancerREthFixtureSetup,
1722
+ balancerWstEthFixtureSetup,
1660
1723
oethMorphoAaveFixtureSetup,
1661
1724
mintWETH,
1662
1725
replaceContractAt,
0 commit comments