mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
## Summary Fixes the CI build failure in the `task-ts-build` workflow caused by Foundry v1.4.2's Solar linter not being able to resolve Snowbridge's context-specific import remappings. ## Problem The Snowbridge submodule uses context-specific remappings (prefixed with `:`) for its dependencies: - `lib/snowbridge/contracts/:openzeppelin/` → OpenZeppelin contracts - `lib/snowbridge/contracts/:prb/math/` → PRB Math library Foundry v1.4.2's Solar linter doesn't understand these context-specific remappings and fails with errors like: ``` error: file openzeppelin/utils/cryptography/MerkleProof.sol not found error: file prb/math/src/UD60x18.sol not found ``` ## Solution Added global remappings that the linter can understand: ```toml "openzeppelin/=lib/snowbridge/contracts/lib/openzeppelin-contracts/contracts/", "prb/math/=lib/snowbridge/contracts/lib/prb-math/", ``` ### Why This Works - The linter can now resolve `openzeppelin/` and `prb/math/` imports globally - These global remappings take **lower precedence** than context-specific ones during compilation - The compiler still uses the context-specific remappings (with `:`) when compiling Snowbridge contracts - The linter uses the global remappings when checking all files ## Changes ### Commit 1: Add global remappings - `contracts/foundry.toml`: Added 2 global remapping entries ### Commit 2: Apply forge fmt - Applied automatic formatting via `forge fmt` to ensure code style consistency - Multi-line formatting for long import statements and function signatures - No functional changes - purely formatting updates ## Testing ✅ Local build succeeds with `forge build` ✅ No Snowbridge import resolution errors ✅ `forge fmt --check` passes with no formatting issues ✅ Only linting notes/warnings remain (not errors) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
61 lines
2.1 KiB
Solidity
61 lines
2.1 KiB
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.13;
|
|
|
|
import {
|
|
IRewardsCoordinator
|
|
} from "eigenlayer-contracts/src/contracts/interfaces/IRewardsCoordinator.sol";
|
|
import {
|
|
IPermissionController
|
|
} from "eigenlayer-contracts/src/contracts/interfaces/IPermissionController.sol";
|
|
import {
|
|
IAllocationManager
|
|
} from "eigenlayer-contracts/src/contracts/interfaces/IAllocationManager.sol";
|
|
import {IRewardsRegistry} from "../../src/interfaces/IRewardsRegistry.sol";
|
|
|
|
import {ServiceManagerBase} from "../../src/middleware/ServiceManagerBase.sol";
|
|
|
|
/**
|
|
* @title Minimal implementation of a ServiceManager-type contract.
|
|
* Uses the ServiceManagerBase contract as is.
|
|
*/
|
|
contract ServiceManagerMock is ServiceManagerBase {
|
|
uint256 public number;
|
|
|
|
/// @notice Sets the (immutable) `_registryCoordinator` address
|
|
constructor(
|
|
IRewardsCoordinator __rewardsCoordinator,
|
|
IPermissionController __permissionController,
|
|
IAllocationManager __allocationManager
|
|
) ServiceManagerBase(__rewardsCoordinator, __permissionController, __allocationManager) {}
|
|
|
|
function initialise(
|
|
address initialOwner,
|
|
address rewardsInitiator
|
|
) public virtual initializer {
|
|
__ServiceManagerBase_init(initialOwner, rewardsInitiator);
|
|
}
|
|
|
|
/**
|
|
* @notice Get the rewards registry for an operator set (exposing for testing)
|
|
* @param operatorSetId The ID of the operator set
|
|
* @return The rewards registry for the operator set
|
|
*/
|
|
function getOperatorSetRewardsRegistry(
|
|
uint32 operatorSetId
|
|
) external view returns (IRewardsRegistry) {
|
|
return operatorSetToRewardsRegistry[operatorSetId];
|
|
}
|
|
|
|
/**
|
|
* @notice Override the internal _ensureOperatorIsPartOfOperatorSet function to simplify testing
|
|
* @param operator The operator address
|
|
* @param operatorSetId The operator set ID
|
|
* @dev This should be removed once the AllocationManagerMock is updated to be able to handle operator sets
|
|
*/
|
|
function _ensureOperatorIsPartOfOperatorSet(
|
|
address operator,
|
|
uint32 operatorSetId
|
|
) internal view override {
|
|
// No-op for testing
|
|
}
|
|
}
|