datahaven/contracts/script/utils/DHScriptStorage.s.sol
undercover-cactus 863250d555
misc: remove slasher middleware solidity contracts (#366)
## Summary

This PR remove the middlewares contracts from eigen layer. Instead we
are planning to use the eigne layer contract directly. It also removes
the tests related to the middleware slasher code and the mock contract
used in it.

## Motivation

When slashing an operator in the Dathaven we are going through the
substrate slashing pallet already implemented. It already allow to
configure a slashing window and/or to cancel a slashing. In the future
it will also be compatible with a government pallet. This part of code
is therefore redundant. For the same reason we remove the tests because
we are not using the slashing middleware contracts.

## What changed

* Remove the slasher middleware files
* Remove the tests related to the middleware slasher file
2025-12-29 14:55:21 +01:00

36 lines
1.2 KiB
Solidity

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.27;
// Testing imports
import {Script} from "forge-std/Script.sol";
// DataHaven imports
import {DataHavenServiceManager} from "../../src/DataHavenServiceManager.sol";
import {RewardsRegistry} from "../../src/middleware/RewardsRegistry.sol";
/**
* @title DHScriptStorage
* @notice This contract is a utility for scripts that need to interact with DataHaven contracts.
*/
contract DHScriptStorage is Script {
// DataHaven Contract declarations
DataHavenServiceManager public serviceManager;
RewardsRegistry public rewardsRegistry;
/**
* @notice Loads the DataHaven contracts from the deployment file.
*/
function _loadDHContracts(
string memory network
) internal {
// Load the deployment file
string memory deploymentFile =
vm.readFile(string.concat("./deployments/", network, ".json"));
// Store the contract addresses
serviceManager =
DataHavenServiceManager(vm.parseJsonAddress(deploymentFile, ".ServiceManager"));
rewardsRegistry =
RewardsRegistry(payable(vm.parseJsonAddress(deploymentFile, ".RewardsRegistry")));
}
}