Skip to content

Commit

Permalink
fix: test/compile
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Nov 11, 2024
1 parent 7e9c912 commit 3b267eb
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 203 deletions.
12 changes: 0 additions & 12 deletions script/deploy/devnet/deploy_from_scratch.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import "../../../src/contracts/core/DelegationManager.sol";
import "../../../src/contracts/core/AVSDirectory.sol";
import "../../../src/contracts/core/RewardsCoordinator.sol";
import "../../../src/contracts/core/AllocationManager.sol";
<<<<<<< HEAD
=======
import "../../../src/contracts/permissions/PermissionController.sol";
>>>>>>> 87a8213b (commit message doesnt matter here)

import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol";
import "../../../src/contracts/strategies/StrategyFactory.sol";
Expand Down Expand Up @@ -64,11 +61,8 @@ contract DeployFromScratch is Script, Test {
StrategyBase public baseStrategyImplementation;
AllocationManager public allocationManagerImplementation;
AllocationManager public allocationManager;
<<<<<<< HEAD
=======
PermissionController public permissionController;
PermissionController public permissionControllerImplementation;
>>>>>>> 87a8213b (commit message doesnt matter here)

EmptyContract public emptyContract;

Expand Down Expand Up @@ -219,12 +213,9 @@ contract DeployFromScratch is Script, Test {
strategyFactory = StrategyFactory(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
<<<<<<< HEAD
=======
permissionController = PermissionController(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
>>>>>>> 87a8213b (commit message doesnt matter here)

// if on mainnet, use the ETH2 deposit contract address
if (chainId == 1) {
Expand Down Expand Up @@ -327,8 +318,6 @@ contract DeployFromScratch is Script, Test {
)
);

<<<<<<< HEAD
=======
eigenLayerProxyAdmin.upgradeAndCall(
ITransparentUpgradeableProxy(payable(address(permissionController))),
address(permissionControllerImplementation),
Expand All @@ -337,7 +326,6 @@ contract DeployFromScratch is Script, Test {
)
);

>>>>>>> 87a8213b (commit message doesnt matter here)
// Deploy strategyFactory & base
// Create base strategy implementation
baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg);
Expand Down
9 changes: 0 additions & 9 deletions script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser {
delegationManager,
strategyManager,
eigenLayerPauserReg,
<<<<<<< HEAD
=======
permissionController,
>>>>>>> 87a8213b (commit message doesnt matter here)
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
Expand Down Expand Up @@ -84,10 +81,7 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser {
delegationManager,
strategyManager,
eigenLayerPauserReg,
<<<<<<< HEAD
=======
permissionController,
>>>>>>> 87a8213b (commit message doesnt matter here)
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
Expand Down Expand Up @@ -129,10 +123,7 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser {
delegationManager,
strategyManager,
eigenLayerPauserReg,
<<<<<<< HEAD
=======
permissionController,
>>>>>>> 87a8213b (commit message doesnt matter here)
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
Expand Down
6 changes: 0 additions & 6 deletions script/deploy/local/Deploy_From_Scratch.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import "../../../src/contracts/core/DelegationManager.sol";
import "../../../src/contracts/core/AVSDirectory.sol";
import "../../../src/contracts/core/RewardsCoordinator.sol";
import "../../../src/contracts/core/AllocationManager.sol";
<<<<<<< HEAD
=======
import "../../../src/contracts/permissions/PermissionController.sol";
>>>>>>> 87a8213b (commit message doesnt matter here)

import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol";

Expand Down Expand Up @@ -67,11 +64,8 @@ contract DeployFromScratch is Script, Test {
StrategyBase public baseStrategyImplementation;
AllocationManager public allocationManagerImplementation;
AllocationManager public allocationManager;
<<<<<<< HEAD
=======
PermissionController public permissionController;
PermissionController public permissionControllerImplementation;
>>>>>>> 87a8213b (commit message doesnt matter here)

EmptyContract public emptyContract;

Expand Down
18 changes: 16 additions & 2 deletions script/deploy/local/deploy_from_scratch.slashing.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import "../../../src/contracts/core/DelegationManager.sol";
import "../../../src/contracts/core/AVSDirectory.sol";
import "../../../src/contracts/core/RewardsCoordinator.sol";
import "../../../src/contracts/core/AllocationManager.sol";
import "../../../src/contracts/permissions/PermissionController.sol";

import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol";

Expand Down Expand Up @@ -63,6 +64,8 @@ contract DeployFromScratch is Script, Test {
StrategyBase public baseStrategyImplementation;
AllocationManager public allocationManagerImplementation;
AllocationManager public allocationManager;
PermissionController public permissionControllerImplementation;
PermissionController public permissionController;

EmptyContract public emptyContract;

Expand Down Expand Up @@ -217,6 +220,9 @@ contract DeployFromScratch is Script, Test {
allocationManager = AllocationManager(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);
permissionController = PermissionController(
address(new TransparentUpgradeableProxy(address(emptyContract), address(eigenLayerProxyAdmin), ""))
);

// if on mainnet, use the ETH2 deposit contract address
if (chainId == 1) {
Expand All @@ -235,7 +241,7 @@ contract DeployFromScratch is Script, Test {

// Second, deploy the *implementation* contracts, using the *proxy contracts* as inputs

delegationImplementation = new DelegationManager(avsDirectory, strategyManager, eigenPodManager, allocationManager, eigenLayerPauserReg, MIN_WITHDRAWAL_DELAY);
delegationImplementation = new DelegationManager(avsDirectory, strategyManager, eigenPodManager, allocationManager, eigenLayerPauserReg, permissionController, MIN_WITHDRAWAL_DELAY);
strategyManagerImplementation = new StrategyManager(delegation, eigenLayerPauserReg);
avsDirectoryImplementation = new AVSDirectory(delegation, eigenLayerPauserReg);
eigenPodManagerImplementation = new EigenPodManager(
Expand All @@ -249,13 +255,15 @@ contract DeployFromScratch is Script, Test {
delegation,
strategyManager,
eigenLayerPauserReg,
permissionController,
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
);
allocationManagerImplementation = new AllocationManager(delegation, eigenLayerPauserReg, DEALLOCATION_DELAY, ALLOCATION_CONFIGURATION_DELAY);
allocationManagerImplementation = new AllocationManager(delegation, eigenLayerPauserReg, permissionController, DEALLOCATION_DELAY, ALLOCATION_CONFIGURATION_DELAY);
permissionControllerImplementation = new PermissionController();

// Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
{
Expand Down Expand Up @@ -321,6 +329,12 @@ contract DeployFromScratch is Script, Test {
)
);

eigenLayerProxyAdmin.upgradeAndCall(
ITransparentUpgradeableProxy(payable(address(permissionController))),
address(permissionControllerImplementation),
abi.encodeWithSelector(PermissionController.initialize.selector)
);

// deploy StrategyBaseTVLLimits contract implementation
baseStrategyImplementation = new StrategyBaseTVLLimits(strategyManager, eigenLayerPauserReg);
// create upgradeable proxies that each point to the implementation and initialize them
Expand Down
3 changes: 0 additions & 3 deletions script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser {
delegationManager,
strategyManager,
eigenLayerPauserReg,
<<<<<<< HEAD
=======
permissionController,
>>>>>>> 87a8213b (commit message doesnt matter here)
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
Expand Down
2 changes: 1 addition & 1 deletion script/tasks/allocate_operatorSet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract AllocateOperatorSet is Script, Test {
});

// Perform allocation
am.modifyAllocations(allocations);
am.modifyAllocations(msg.sender, allocations);

// STOP RECORDING TRANSACTIONS FOR DEPLOYMENT
vm.stopBroadcast();
Expand Down
8 changes: 4 additions & 4 deletions script/tasks/register_operator_to_operatorSet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ contract RegisterOperatorToOperatorSets is Script, Test {
operatorSetId: 1,
strategies: strategies
});
allocationManager.createOperatorSets(sets);
allocationManager.createOperatorSets(msg.sender, sets);

// Register the Operator to the AVS
avsDirectory.registerOperatorToAVS(
operator, ISignatureUtils.SignatureWithSaltAndExpiry(abi.encodePacked(r, s, v), bytes32(uint256(0) + 1), expiry)
);

// Deploy and set registrar
allocationManager.setAVSRegistrar(new AVSRegistrar());
// Deploy and set registrar.
allocationManager.setAVSRegistrar(msg.sender, new AVSRegistrar());

// Register OperatorSet(s)
IAllocationManagerTypes.RegisterParams memory register = IAllocationManagerTypes.RegisterParams({
avs: operator,
operatorSetIds: oids,
data: ""
});
allocationManager.registerForOperatorSets(register);
allocationManager.registerForOperatorSets(operator, register);

// STOP RECORDING TRANSACTIONS FOR DEPLOYMENT
vm.stopBroadcast();
Expand Down
2 changes: 1 addition & 1 deletion script/tasks/slash_operatorSet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ contract SlashOperatorSet is Script, Test {
});

// Perform slashing
am.slashOperator(slashing);
am.slashOperator(operator, slashing);

// STOP RECORDING TRANSACTIONS FOR DEPLOYMENT
vm.stopBroadcast();
Expand Down
Loading

0 comments on commit 3b267eb

Please sign in to comment.