// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IEqualStakeVPCalc} from "./IEqualStakeVPCalc.sol"; import {IPermissionManager} from "../../../base/IPermissionManager.sol"; import {Checkpoints} from "../../../../../libraries/structs/Checkpoints.sol"; /** * @title IWeightedVaultsVPCalc * @notice Interface for the WeightedVaultsVPCalc contract. */ interface IWeightedVaultsVPCalc is IEqualStakeVPCalc, IPermissionManager { /** * @notice Reverts when the weight is too large. */ error WeightedVaultsVPCalc_TooLargeWeight(); /** * @notice The storage of the WeightedVaultsVPCalc contract. * @param _vaultWeight The weight for each vault. */ struct WeightedVaultsVPCalcStorage { mapping(address vault => Checkpoints.Trace208 weight) _vaultWeight; } /** * @notice Emitted when the weight for a vault is set. * @param vault The vault. * @param weight The weight. */ event SetVaultWeight(address indexed vault, uint208 weight); /** * @notice Returns the weight for a vault at a given timestamp. * @param vault The vault. * @param timestamp The timestamp. * @return The weight. * @dev Returns 1e4 if the weight wasn't explicitly set yet. * Can return non-zero weight for unregistered vaults. */ function getVaultWeightAt(address vault, uint48 timestamp) external view returns (uint208); /** * @notice Returns the weight for a vault. * @param vault The vault. * @return The weight. * @dev Returns 1e4 if the weight wasn't explicitly set yet. * Can return non-zero weight for unregistered vaults. */ function getVaultWeight(address vault) external view returns (uint208); /** * @notice Sets the weight for a vault. * @param vault The vault. * @param weight The weight. */ function setVaultWeight(address vault, uint208 weight) external; }