Skip to content

refactor: remove dead code #1206

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions certora/harnesses/DelegationManagerHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,5 @@ contract DelegationManagerHarness is DelegationManager {
constructor(IStrategyManager _strategyManager, ISlasher _slasher, IEigenPodManager _eigenPodManager)
DelegationManager(_strategyManager, _slasher, _eigenPodManager) {}

function get_operatorShares(address operator, IStrategy strategy) public view returns (uint256) {
return operatorShares[operator][strategy];
}

function get_stakerDelegateableShares(address staker, IStrategy strategy) public view returns (uint256) {
// this is the address of the virtual 'beaconChainETH' strategy
if (address(strategy) == 0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0) {
int256 beaconChainETHShares = eigenPodManager.podOwnerShares(staker);
if (beaconChainETHShares <= 0) {
return 0;
} else {
return uint256(beaconChainETHShares);
}
} else {
return strategyManager.stakerStrategyShares(staker, strategy);
}
}
}
15 changes: 0 additions & 15 deletions certora/harnesses/EigenPodHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,12 @@ contract EigenPodHarness is EigenPod {
)
EigenPod(_ethPOS, _eigenPodManager, _MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR, _GENESIS_TIME) {}

function get_validatorIndex(bytes32 pubkeyHash) public view returns (uint64) {
return _validatorPubkeyHashToInfo[pubkeyHash].validatorIndex;
}

function get_restakedBalanceGwei(bytes32 pubkeyHash) public view returns (uint64) {
return _validatorPubkeyHashToInfo[pubkeyHash].restakedBalanceGwei;
}

function get_mostRecentBalanceUpdateTimestamp(bytes32 pubkeyHash) public view returns (uint64) {
return _validatorPubkeyHashToInfo[pubkeyHash].mostRecentBalanceUpdateTimestamp;
}

function get_podOwnerShares() public view returns (int256) {
return eigenPodManager.podOwnerShares(podOwner);
}

function get_withdrawableRestakedExecutionLayerGwei() public view returns (uint256) {
return withdrawableRestakedExecutionLayerGwei;
}

function get_ETH_Balance() public view returns (uint256) {
return address(this).balance;
}
}
3 changes: 0 additions & 3 deletions certora/harnesses/EigenPodManagerHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ contract EigenPodManagerHarness is EigenPodManager {
return podOwnerShares[podOwner];
}

function get_podByOwner(address podOwner) public view returns (IEigenPod) {
return ownerToPod[podOwner];
}
}
6 changes: 0 additions & 6 deletions certora/harnesses/PausableHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,5 @@ contract PausableHarness is Pausable {
}

// bitwise operations
function bitwise_not(uint256 input) external pure returns (uint256) {
return (~input);
}

function bitwise_and(uint256 input_1, uint256 input_2) external pure returns (uint256) {
return (input_1 & input_2);
}
}
20 changes: 0 additions & 20 deletions certora/harnesses/StrategyManagerHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,9 @@ contract StrategyManagerHarness is StrategyManager {
}

// checks that stakerStrategyList[staker] contains no duplicates and that all strategies in array have nonzero shares
function array_exhibits_properties(address staker) public view returns (bool) {
uint256 length = stakerStrategyList[staker].length;
uint256 res = 0;
// loop for each strategy in array
for (uint256 i = 0; i < length; ++i) {
IStrategy strategy = stakerStrategyList[staker][i];
// check that staker's shares in strategy are nonzero
if (stakerStrategyShares[staker][strategy] == 0) {
return false;
}
// check that strategy is not duplicated in array
if (num_times_strategy_is_in_stakers_array(staker, strategy) != 1) {
return false;
}
}
return true;
}

function totalShares(address strategy) public view returns (uint256) {
return IStrategy(strategy).totalShares();
}

function get_stakerStrategyShares(address staker, IStrategy strategy) public view returns (uint256) {
return stakerStrategyShares[staker][strategy];
}
}
7 changes: 0 additions & 7 deletions certora/harnesses/StructuredLinkedListHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ contract StructuredLinkedListHarness {
StructuredLinkedList.List public listStorage;

/// Getters with single value returns.
function getAdjacentStrict(uint256 _node, bool _direction) public view returns (uint256 adj) {
if (!nodeExists(_node)) {
revert();
} else {
adj = listStorage.list[_node][_direction];
}
}

// Generic setters that cover all use cases
function insert(uint256 _node, uint256 _new, bool _dir) public {
Expand Down
75 changes: 0 additions & 75 deletions script/utils/ExistingDeploymentParser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -295,24 +295,6 @@ contract ExistingDeploymentParser is Script, Logger {
eigenStrategyImpl = EigenStrategy(json.readAddress(".addresses.token.eigenStrategyImpl"));
}

function _parseDeployedEigenPods(
string memory existingDeploymentInfoPath
) internal returns (DeployedEigenPods memory) {
uint256 currentChainId = block.chainid;

// READ JSON CONFIG DATA
string memory json = cheats.readFile(existingDeploymentInfoPath);

// check that the chainID matches the one in the config
uint256 configChainId = json.readUint(".chainInfo.chainId");
assertEq(configChainId, currentChainId, "You are on the wrong chain for this config");

multiValidatorPods = json.readAddressArray(".eigenPods.multiValidatorPods");
singleValidatorPods = json.readAddressArray(".eigenPods.singleValidatorPods");
inActivePods = json.readAddressArray(".eigenPods.inActivePods");
allEigenPods = json.readAddressArray(".eigenPods.allEigenPods");
return DeployedEigenPods({multiValidatorPods: multiValidatorPods, singleValidatorPods: singleValidatorPods, inActivePods: inActivePods});
}

/// @notice use for deploying a new set of EigenLayer contracts
/// Note that this does assertEq multisigs to already be deployed
Expand Down Expand Up @@ -606,63 +588,6 @@ contract ExistingDeploymentParser is Script, Logger {
}
}

/**
* @notice Log contract addresses and write to output json file
*/
function logAndOutputContractAddresses(
string memory outputPath
) public {
// WRITE JSON DATA
string memory parent_object = "parent object";

string memory deployed_strategies = "strategies";
for (uint256 i = 0; i < numStrategiesToDeploy; ++i) {
deployed_strategies.serialize(strategiesToDeploy[i].tokenSymbol, address(deployedStrategyArray[i]));
}
string memory deployed_strategies_output = numStrategiesToDeploy == 0
? ""
: deployed_strategies.serialize(
strategiesToDeploy[numStrategiesToDeploy - 1].tokenSymbol, address(deployedStrategyArray[numStrategiesToDeploy - 1])
);

string memory deployed_addresses = "addresses";
deployed_addresses.serialize("eigenLayerProxyAdmin", address(eigenLayerProxyAdmin));
deployed_addresses.serialize("eigenLayerPauserReg", address(eigenLayerPauserReg));
deployed_addresses.serialize("avsDirectory", address(avsDirectory));
deployed_addresses.serialize("avsDirectoryImplementation", address(avsDirectoryImplementation));
deployed_addresses.serialize("delegationManager", address(delegationManager));
deployed_addresses.serialize("delegationManagerImplementation", address(delegationManagerImplementation));
deployed_addresses.serialize("strategyManager", address(strategyManager));
deployed_addresses.serialize("strategyManagerImplementation", address(strategyManagerImplementation));
deployed_addresses.serialize("rewardsCoordinator", address(rewardsCoordinator));
deployed_addresses.serialize("rewardsCoordinatorImplementation", address(rewardsCoordinatorImplementation));
deployed_addresses.serialize("eigenPodManager", address(eigenPodManager));
deployed_addresses.serialize("eigenPodManagerImplementation", address(eigenPodManagerImplementation));
deployed_addresses.serialize("eigenPodBeacon", address(eigenPodBeacon));
deployed_addresses.serialize("eigenPodImplementation", address(eigenPodImplementation));
deployed_addresses.serialize("baseStrategyImplementation", address(baseStrategyImplementation));
deployed_addresses.serialize("emptyContract", address(emptyContract));
string memory deployed_addresses_output = deployed_addresses.serialize("strategies", deployed_strategies_output);

string memory parameters = "parameters";
parameters.serialize("executorMultisig", executorMultisig);
parameters.serialize("operationsMultisig", operationsMultisig);
parameters.serialize("communityMultisig", communityMultisig);
parameters.serialize("pauserMultisig", pauserMultisig);
parameters.serialize("timelock", timelock);
string memory parameters_output = parameters.serialize("operationsMultisig", operationsMultisig);

string memory chain_info = "chainInfo";
chain_info.serialize("deploymentBlock", block.number);
string memory chain_info_output = chain_info.serialize("chainId", block.chainid);

// serialize all the data
parent_object.serialize(deployed_addresses, deployed_addresses_output);
parent_object.serialize(chain_info, chain_info_output);
string memory finalJson = parent_object.serialize(parameters, parameters_output);

cheats.writeJson(finalJson, outputPath);
}

/// @notice used for parsing parameters used in the integration test upgrade
function _parseParamsForIntegrationUpgrade(
Expand Down
6 changes: 0 additions & 6 deletions src/test/DevnetLifecycle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ contract Devnet_Lifecycle_Test is Test, IAllocationManagerTypes {
operatorSet = OperatorSet({avs: avs, id: operatorSetId});
}

function _getOperatorSetArray() internal view returns (uint32[] memory) {
return operatorSetId.toArrayU32();
}

function _getOperatorSetsArray() internal view returns (OperatorSet[] memory) {
return OperatorSet({avs: avs, id: operatorSetId}).toArray();
}

function test() public {
if (block.chainid == 17000) {
Expand Down
9 changes: 0 additions & 9 deletions src/test/harnesses/EigenPodHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ contract EigenPodHarness is EigenPod {
return activeValidatorCount;
}

function setActiveValidatorCount(uint _count) public {
activeValidatorCount = _count;
}

function verifyWithdrawalCredentials(
bytes32 beaconStateRoot,
Expand All @@ -40,11 +37,5 @@ contract EigenPodHarness is EigenPod {
);
}

function setValidatorStatus(bytes32 pkhash, VALIDATOR_STATUS status) public {
_validatorPubkeyHashToInfo[pkhash].status = status;
}

function setValidatorRestakedBalance(bytes32 pkhash, uint64 restakedBalanceGwei) public {
_validatorPubkeyHashToInfo[pkhash].restakedBalanceGwei = restakedBalanceGwei;
}
}
Loading
Loading