Skip to content

Commit f0ff053

Browse files
authored
chore: remove goerli from all codebase (#1304)
**Motivation:** goerli has long been gone, we should remove goerli from all codebase **Modifications:** remove goerli from all codebase **Result:** remove goerli from all codebase
1 parent e7132f3 commit f0ff053

File tree

6 files changed

+7
-329
lines changed

6 files changed

+7
-329
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ We have a few fork tests against ETH mainnet. Passing these requires the environ
6262

6363
Additionally, to run all tests in a forked environment, [install yq](https://mikefarah.gitbook.io/yq/v/v3.x/). Then, set up your environment by running the following command.
6464

65-
`source bin/source-env.sh [goerli|local]`
65+
`source bin/source-env.sh [local]`
6666

6767
Then run the tests:
6868

bin/source-env.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@
22

33
# Check for arguments
44
if [ "$#" -ne 1 ]; then
5-
echo "Usage: $0 [goerli|local]"
5+
echo "Usage: $0 [local]"
66
return 1
77
fi
88

99
case $1 in
10-
goerli)
11-
CHAIN_ID=5
12-
EXECUTOR_MULTISIG="0x3d9C2c2B40d890ad53E27947402e977155CD2808"
13-
FOUNDRY_FUZZ_RUNS=1
14-
;;
1510
local)
1611
CHAIN_ID=31337
1712
FOUNDRY_FUZZ_RUNS=256
1813
;;
1914
*)
20-
echo "Invalid argument. Usage: $0 [goerli|local]"
15+
echo "Invalid argument. Usage: $0 [local]"
2116
return 1
2217
;;
2318
esac

script/deploy/devnet/deploy_from_scratch.s.sol

-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ contract DeployFromScratch is Script, Test {
443443
vm.serializeString(parent_object, chain_info, chain_info_output);
444444
string memory finalJson = vm.serializeString(parent_object, parameters, parameters_output);
445445
// TODO: should output to different file depending on configFile passed to run()
446-
// so that we don't override mainnet output by deploying to goerli for eg.
447446
vm.writeJson(finalJson, "script/output/devnet/slashing_output.json");
448447
}
449448

script/utils/validateStorage/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To validate the storage of an upgradeable deployed contract against a local one,
77
bash script/upgrade/validateUpgrade.sh -n <network> -c <contract> -a <implementation address>
88
```
99

10-
The supported networks are `goerli` and `mainnet`. The supported contracts are `strategyManager`, `delegation`, `eigenPod`, `eigenPodManager`, and `slasher`.
10+
The supported networks are `mainnet`. The supported contracts are `strategyManager`, `delegation`, `eigenPod`, `eigenPodManager`, and `slasher`.
1111

1212
The above script generates two csv files, `localLayout.csv` and `onChainLayout.csv`. To keep these csv files after validating storage, add a `-k` flag to the above command
1313

script/utils/validateStorage/validateUpgrade.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ if [ -z "$NETWORK" ] || [ -z "$CONTRACT" ] || [ -z "$ADDRESS" ]; then
1919
fi
2020

2121
# Validate the network input
22-
if [ "$NETWORK" != "mainnet" ] && [ "$NETWORK" != "goerli" ]; then
23-
echo "Invalid network. Use 'mainnet' or 'goerli'."
22+
if [ "$NETWORK" != "mainnet" ] ; then
23+
echo "Invalid network. Use 'mainnet'."
2424
exit 1
2525
fi
2626

@@ -38,9 +38,7 @@ case $CONTRACT in
3838
esac
3939

4040
# Set RPC
41-
if [ "$NETWORK" == "goerli" ]; then
42-
RPC_URL="$RPC_GOERLI"
43-
else
41+
if [ "$NETWORK" == "mainnet" ]; then
4442
RPC_URL="$RPC_MAINNET"
4543
fi
4644

src/test/unit/StrategyManagerUnit.t.sol

-314
Original file line numberDiff line numberDiff line change
@@ -308,320 +308,6 @@ contract StrategyManagerUnitTests_depositIntoStrategy is StrategyManagerUnitTest
308308
testFuzz_depositIntoStrategySuccessfully(staker, amount);
309309
}
310310

311-
// TODO: test depositing into multiple strategies
312-
// function testFuzz_depositIntoStrategy_MultipleStrategies()
313-
// /// @notice deploys 'numStratsToAdd' strategies using '_testAddStrategy' and then deposits '1e18' to each of them from 'getOperatorAddress(0)'
314-
// /// @param numStratsToAdd is the number of strategies being added and deposited into
315-
// function testDepositStrategies(uint8 numStratsToAdd) public {
316-
// _testDepositStrategies(getOperatorAddress(0), 1e18, numStratsToAdd);
317-
// }
318-
319-
// TODO: fix old stETH fork test
320-
// /// @notice Shadow-forks mainnet and tests depositing stETH tokens into a "StrategyBase" contract.
321-
// function testForkMainnetDepositSteth() public {
322-
// // hard-coded inputs
323-
// // address sender = address(this);
324-
// uint64 amountToDeposit = 1e12;
325-
326-
// // shadow-fork mainnet
327-
// try cheats.createFork("mainnet") returns (uint256 forkId) {
328-
// cheats.selectFork(forkId);
329-
// // If RPC_MAINNET ENV not set, default to this mainnet RPC endpoint
330-
// } catch {
331-
// cheats.createSelectFork("https://eth.llamarpc.com");
332-
// }
333-
334-
// // cast mainnet stETH address to IERC20 interface
335-
// // IERC20 steth = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);
336-
// IERC20 underlyingToken = IERC20(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);
337-
338-
// // deploy necessary contracts on the shadow-forked network
339-
// // deploy proxy admin for ability to upgrade proxy contracts
340-
// eigenLayerProxyAdmin = new ProxyAdmin();
341-
// //deploy pauser registry
342-
// address[] memory pausers = new address[](1);
343-
// pausers[0] = pauser;
344-
// eigenLayerPauserReg = new PauserRegistry(pausers, unpauser);
345-
// /**
346-
// * First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are
347-
// * not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code.
348-
// */
349-
// emptyContract = new EmptyContract();
350-
// delegation = DelegationManager(
351-
// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
352-
// );
353-
// strategyManager = StrategyManager(
354-
// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
355-
// );
356-
// eigenPodManager = EigenPodManager(
357-
// address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
358-
// );
359-
360-
// ethPOSDeposit = new ETHPOSDepositMock();
361-
// pod = new EigenPod(ethPOSDeposit, eigenPodManager, GOERLI_GENESIS_TIME);
362-
363-
// eigenPodBeacon = new UpgradeableBeacon(address(pod));
364-
// // Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs
365-
// DelegationManager delegationImplementation = new DelegationManager(avsDirectory, strategyManager, eigenPodManager, allocationManager, MIN_WITHDRAWAL_DELAY);
366-
// StrategyManager strategyManagerImplementation = new StrategyManager(delegation);
367-
// EigenPodManager eigenPodManagerImplementation = new EigenPodManager(ethPOSDeposit, eigenPodBeacon, strategyManager, delegation);
368-
// // Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
369-
// eigenLayerProxyAdmin.upgradeAndCall(
370-
// ITransparentUpgradeableProxy(payable(address(delegation))),
371-
// address(delegationImplementation),
372-
// abi.encodeWithSelector(
373-
// DelegationManager.initialize.selector,
374-
// eigenLayerReputedMultisig,
375-
// eigenLayerPauserReg,
376-
// 0 /*initialPausedStatus*/,
377-
// minWithdrawalDelayBlocks,
378-
// initializeStrategiesToSetDelayBlocks,
379-
// initializeWithdrawalDelayBlocks
380-
// )
381-
// );
382-
// eigenLayerProxyAdmin.upgradeAndCall(
383-
// ITransparentUpgradeableProxy(payable(address(strategyManager))),
384-
// address(strategyManagerImplementation),
385-
// abi.encodeWithSelector(
386-
// StrategyManager.initialize.selector,
387-
// eigenLayerReputedMultisig,
388-
// eigenLayerReputedMultisig,
389-
// eigenLayerPauserReg,
390-
// 0/*initialPausedStatus*/
391-
// )
392-
// );
393-
// eigenLayerProxyAdmin.upgradeAndCall(
394-
// ITransparentUpgradeableProxy(payable(address(eigenPodManager))),
395-
// address(eigenPodManagerImplementation),
396-
// abi.encodeWithSelector(
397-
// EigenPodManager.initialize.selector,
398-
// eigenLayerReputedMultisig,
399-
// eigenLayerPauserReg,
400-
// 0/*initialPausedStatus*/
401-
// )
402-
// );
403-
404-
// // cheat a bunch of ETH to this address
405-
// cheats.deal(address(this), 1e20);
406-
// // deposit a huge amount of ETH to get ample stETH
407-
// {
408-
// (bool success, bytes memory returnData) = address(underlyingToken).call{value: 1e20}("");
409-
// require(success, "depositing stETH failed");
410-
// returnData;
411-
// }
412-
413-
// // deploy StrategyBase contract implementation, then create upgradeable proxy that points to implementation and initialize it
414-
// baseStrategyImplementation = new StrategyBase(strategyManager);
415-
// IStrategy stethStrategy = StrategyBase(
416-
// address(
417-
// new TransparentUpgradeableProxy(
418-
// address(baseStrategyImplementation),
419-
// address(eigenLayerProxyAdmin),
420-
// abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg)
421-
// )
422-
// )
423-
// );
424-
425-
// // REMAINDER OF CODE ADAPTED FROM `_testDepositToStrategy`
426-
// // _testDepositToStrategy(sender, amountToDeposit, underlyingToken, stethStrategy);
427-
428-
// // whitelist the strategy for deposit, in case it wasn't before
429-
// {
430-
// cheats.startPrank(strategyManager.strategyWhitelister());
431-
// IStrategy[] memory _strategy = new IStrategy[](1);
432-
// _strategy[0] = stethStrategy;
433-
// strategyManager.addStrategiesToDepositWhitelist(_strategy);
434-
// cheats.stopPrank();
435-
// }
436-
437-
// uint256 operatorSharesBefore = strategyManager.stakerDepositShares(address(this), stethStrategy);
438-
// // check the expected output
439-
// uint256 expectedSharesOut = stethStrategy.underlyingToShares(amountToDeposit);
440-
441-
// underlyingToken.transfer(address(this), amountToDeposit);
442-
// cheats.startPrank(address(this));
443-
// underlyingToken.approve(address(strategyManager), type(uint256).max);
444-
// strategyManager.depositIntoStrategy(stethStrategy, underlyingToken, amountToDeposit);
445-
446-
// //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array.
447-
// if (operatorSharesBefore == 0) {
448-
// // check that strategy is appropriately added to dynamic array of all of sender's strategies
449-
// assertTrue(
450-
// strategyManager.stakerStrategyList(address(this), strategyManager.stakerStrategyListLength(address(this)) - 1)
451-
// == stethStrategy,
452-
// "_testDepositToStrategy: stakerStrategyList array updated incorrectly"
453-
// );
454-
// }
455-
// // check that the shares out match the expected amount out
456-
// // the actual transfer in will be lower by 1-2 wei than expected due to stETH's internal rounding
457-
// // to account for this we check approximate rather than strict equivalence here
458-
// {
459-
// uint256 actualSharesOut = strategyManager.stakerDepositShares(address(this), stethStrategy) - operatorSharesBefore;
460-
// require(actualSharesOut >= expectedSharesOut, "too few shares");
461-
// require((actualSharesOut * 1000) / expectedSharesOut < 1003, "too many shares");
462-
463-
// // additional sanity check for deposit not increasing in value
464-
// require(stethStrategy.sharesToUnderlying(actualSharesOut) <= amountToDeposit, "value cannot have increased");
465-
// // slippage check
466-
// require((stethStrategy.sharesToUnderlying(actualSharesOut) * 1e6) / amountToDeposit >= (1e6 - 1), "bad slippage on first deposit");
467-
// }
468-
// cheats.stopPrank();
469-
// }
470-
471-
// TODO: fix old frontrun depositor test
472-
// function testFrontrunFirstDepositor(/*uint256 depositAmount*/) public {
473-
474-
// //setup addresses
475-
// address attacker = address(100);
476-
// address user = address(200);
477-
478-
// //give 2 ether to attacker and user
479-
// weth.transfer(attacker,2 ether);
480-
// weth.transfer(user,2 ether);
481-
482-
// //attacker FRONTRUN: deposit 1 wei (receive 1 share)
483-
// StrategyManager _strategyManager = _whitelistStrategy(strategyManager, wethStrat);
484-
485-
// cheats.startPrank(attacker);
486-
// weth.approve(address(strategyManager), type(uint256).max);
487-
// _strategyManager.depositIntoStrategy(wethStrat, weth, 1 wei);
488-
// cheats.stopPrank();
489-
490-
// //attacker FRONTRUN: transfer 1 ether into strategy directly to manipulate the value of shares
491-
// cheats.prank(attacker);
492-
// weth.transfer(address(wethStrat),1 ether);
493-
494-
// //user deposits 2 eth into strategy - only gets 1 share due to rounding
495-
// cheats.startPrank(user);
496-
// weth.approve(address(_strategyManager), type(uint256).max);
497-
// _strategyManager.depositIntoStrategy(wethStrat, weth, 2 ether);
498-
// cheats.stopPrank();
499-
500-
// //attacker deposited 1 ether and 1 wei - received 1 share
501-
// //user deposited 2 ether - received X shares
502-
// //user has lost 0.5 ether?
503-
// (, uint256[] memory shares) = _strategyManager.getDeposits(attacker);
504-
// uint256 attackerValueWeth = wethStrat.sharesToUnderlyingView(shares[0]);
505-
// require(attackerValueWeth >= (1), "attacker got zero shares");
506-
507-
// (, shares) = _strategyManager.getDeposits(user);
508-
// uint256 userValueWeth = wethStrat.sharesToUnderlyingView(shares[0]);
509-
// require(userValueWeth >= (1900000000000000000), "user has lost more than 0.1 eth from frontrunning");
510-
511-
// uint256 attackerLossesWeth = (2 ether + 1 wei) - attackerValueWeth;
512-
// uint256 userLossesWeth = 2 ether - userValueWeth;
513-
// require(attackerLossesWeth > userLossesWeth, "griefing attack deals more damage than cost");
514-
// }
515-
516-
// TODO: fix old testFrontrunFirstDepositorFuzzed
517-
// function testFrontrunFirstDepositorFuzzed(uint96 firstDepositAmount, uint96 donationAmount, uint96 secondDepositAmount) public {
518-
// // want to only use nonzero amounts or else we'll get reverts
519-
// cheats.assume(firstDepositAmount != 0 && secondDepositAmount != 0);
520-
521-
// // setup addresses
522-
// address attacker = address(100);
523-
// address user = address(200);
524-
525-
// // attacker makes first deposit
526-
// _testDepositToStrategy(attacker, firstDepositAmount, weth, wethStrat);
527-
528-
// // transfer tokens into strategy directly to manipulate the value of shares
529-
// weth.transfer(address(wethStrat), donationAmount);
530-
531-
// // filter out calls that would revert for minting zero shares
532-
// cheats.assume(wethStrat.underlyingToShares(secondDepositAmount) != 0);
533-
534-
// // user makes 2nd deposit into strategy - gets diminished shares due to rounding
535-
// _testDepositToStrategy(user, secondDepositAmount, weth, wethStrat);
536-
537-
// // check for griefing
538-
// (, uint256[] memory shares) = strategyManager.getDeposits(attacker);
539-
// uint256 attackerValueWeth = wethStrat.sharesToUnderlyingView(shares[0]);
540-
// (, shares) = strategyManager.getDeposits(user);
541-
// uint256 userValueWeth = wethStrat.sharesToUnderlyingView(shares[0]);
542-
543-
// uint256 attackerCost = uint256(firstDepositAmount) + uint256(donationAmount);
544-
// require(attackerCost >= attackerValueWeth, "attacker gained value?");
545-
// // uint256 attackerLossesWeth = attackerValueWeth > attackerCost ? 0 : (attackerCost - attackerValueWeth);
546-
// uint256 attackerLossesWeth = attackerCost - attackerValueWeth;
547-
// uint256 userLossesWeth = secondDepositAmount - userValueWeth;
548-
549-
// emit log_named_uint("attackerLossesWeth", attackerLossesWeth);
550-
// emit log_named_uint("userLossesWeth", userLossesWeth);
551-
552-
// // use '+1' here to account for rounding. given the attack will cost ETH in the form of gas, this is fine.
553-
// require(attackerLossesWeth + 1 >= userLossesWeth, "griefing attack deals more damage than cost");
554-
// }
555-
556-
// TODO: testDepositTokenWithOneWeiFeeOnTransfer
557-
// function testDepositTokenWithOneWeiFeeOnTransfer(address sender, uint64 amountToDeposit) public fuzzedAddress(sender) {
558-
// cheats.assume(amountToDeposit != 0);
559-
560-
// IERC20 underlyingToken;
561-
562-
// {
563-
// uint256 initSupply = 1e50;
564-
// address initOwner = address(this);
565-
// ERC20_OneWeiFeeOnTransfer oneWeiFeeOnTransferToken = new ERC20_OneWeiFeeOnTransfer(initSupply, initOwner);
566-
// underlyingToken = IERC20(address(oneWeiFeeOnTransferToken));
567-
// }
568-
569-
// // need to transfer extra here because otherwise the `sender` won't have enough tokens
570-
// underlyingToken.transfer(sender, 1000);
571-
572-
// IStrategy oneWeiFeeOnTransferTokenStrategy = StrategyBase(
573-
// address(
574-
// new TransparentUpgradeableProxy(
575-
// address(baseStrategyImplementation),
576-
// address(eigenLayerProxyAdmin),
577-
// abi.encodeWithSelector(StrategyBase.initialize.selector, underlyingToken, eigenLayerPauserReg)
578-
// )
579-
// )
580-
// );
581-
582-
// // REMAINDER OF CODE ADAPTED FROM `_testDepositToStrategy`
583-
// // _testDepositToStrategy(sender, amountToDeposit, underlyingToken, oneWeiFeeOnTransferTokenStrategy);
584-
585-
// // whitelist the strategy for deposit, in case it wasn't before
586-
// {
587-
// cheats.startPrank(strategyManager.strategyWhitelister());
588-
// IStrategy[] memory _strategy = new IStrategy[](1);
589-
// _strategy[0] = oneWeiFeeOnTransferTokenStrategy;
590-
// strategyManager.addStrategiesToDepositWhitelist(_strategy);
591-
// cheats.stopPrank();
592-
// }
593-
// uint256 operatorSharesBefore = strategyManager.stakerDepositShares(sender, oneWeiFeeOnTransferTokenStrategy);
594-
// // check the expected output
595-
// uint256 expectedSharesOut = oneWeiFeeOnTransferTokenStrategy.underlyingToShares(amountToDeposit);
596-
597-
// underlyingToken.transfer(sender, amountToDeposit);
598-
// cheats.startPrank(sender);
599-
// underlyingToken.approve(address(strategyManager), type(uint256).max);
600-
// strategyManager.depositIntoStrategy(oneWeiFeeOnTransferTokenStrategy, underlyingToken, amountToDeposit);
601-
602-
// //check if depositor has never used this strat, that it is added correctly to stakerStrategyList array.
603-
// if (operatorSharesBefore == 0) {
604-
// // check that strategy is appropriately added to dynamic array of all of sender's strategies
605-
// assertTrue(
606-
// strategyManager.stakerStrategyList(sender, strategyManager.stakerStrategyListLength(sender) - 1)
607-
// == oneWeiFeeOnTransferTokenStrategy,
608-
// "_testDepositToStrategy: stakerStrategyList array updated incorrectly"
609-
// );
610-
// }
611-
// // check that the shares out match the expected amount out
612-
// // the actual transfer in will be lower by 1 wei than expected due to stETH's internal rounding
613-
// // to account for this we check approximate rather than strict equivalence here
614-
// {
615-
// uint256 actualSharesOut = strategyManager.stakerDepositShares(sender, oneWeiFeeOnTransferTokenStrategy) - operatorSharesBefore;
616-
// require((actualSharesOut * 1000) / expectedSharesOut > 998, "too few shares");
617-
// require((actualSharesOut * 1000) / expectedSharesOut < 1002, "too many shares");
618-
619-
// // additional sanity check for deposit not increasing in value
620-
// require(oneWeiFeeOnTransferTokenStrategy.sharesToUnderlying(actualSharesOut) <= amountToDeposit, "value cannot have increased");
621-
// }
622-
// cheats.stopPrank();
623-
// }
624-
625311
function test_Revert_WhenDepositsPaused() public {
626312
uint amount = 1e18;
627313

0 commit comments

Comments
 (0)