Skip to content

Commit a518026

Browse files
refactor: remove v prefix from SemVerMixin (#1385)
**Motivation:** Slashing was deployed with using a `v` prefix, thus we're simply going to drop the prefix moving forward. **Modifications:** Prefix removed, and tests updated. **Result:** SemVerMixin no longer requires a `v` prefix.
1 parent 4180e5f commit a518026

23 files changed

+48
-48
lines changed

src/contracts/interfaces/IRewardsCoordinator.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ interface IRewardsCoordinatorTypes {
258258
* @param MAX_RETROACTIVE_LENGTH The maximum retroactive length of a rewards submission
259259
* @param MAX_FUTURE_LENGTH The maximum future length of a rewards submission
260260
* @param GENESIS_REWARDS_TIMESTAMP The timestamp at which rewards are first calculated
261-
* @param version The semantic version of the contract (e.g. "v1.2.3")
261+
* @param version The semantic version of the contract (e.g. "1.2.3")
262262
* @dev Needed to avoid stack-too-deep errors
263263
*/
264264
struct RewardsCoordinatorConstructorParams {

src/contracts/interfaces/ISemVerMixin.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ pragma solidity ^0.8.0;
66
/// @dev Follows SemVer 2.0.0 specification (https://semver.org/)
77
interface ISemVerMixin {
88
/// @notice Returns the semantic version string of the contract.
9-
/// @return The version string in SemVer format (e.g., "v1.1.1")
9+
/// @return The version string in SemVer format (e.g., "1.1.1")
1010
function version() external view returns (string memory);
1111
}

src/contracts/mixins/SemVerMixin.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ abstract contract SemVerMixin is ISemVerMixin {
1111
using ShortStringsUpgradeable for *;
1212

1313
/// @notice The semantic version string for this contract, stored as a ShortString for gas efficiency.
14-
/// @dev Follows SemVer 2.0.0 specification (https://semver.org/). Prefixed with 'v' (e.g., "v1.2.3").
14+
/// @dev Follows SemVer 2.0.0 specification (https://semver.org/).
1515
ShortString internal immutable _VERSION;
1616

1717
/// @notice Initializes the contract with a semantic version string.
18-
/// @param _version The SemVer-formatted version string (e.g., "v1.2.3")
19-
/// @dev Version should follow SemVer 2.0.0 format with 'v' prefix: vMAJOR.MINOR.PATCH
18+
/// @param _version The SemVer-formatted version string (e.g., "1.2.3")
19+
/// @dev Version should follow SemVer 2.0.0 format: MAJOR.MINOR.PATCH
2020
constructor(
2121
string memory _version
2222
) {
@@ -29,10 +29,10 @@ abstract contract SemVerMixin is ISemVerMixin {
2929
}
3030

3131
/// @notice Returns the major version of the contract.
32-
/// @dev Supports single digit major versions (e.g., "v1" for version "v1.2.3")
33-
/// @return The major version string (e.g., "v1" for version "v1.2.3")
32+
/// @dev Supports single digit major versions (e.g., "1" for version "1.2.3")
33+
/// @return The major version string (e.g., "1" for version "1.2.3")
3434
function _majorVersion() internal view returns (string memory) {
3535
bytes memory v = bytes(_VERSION.toString());
36-
return string(bytes.concat(v[0], v[1]));
36+
return string(abi.encodePacked(v[0]));
3737
}
3838
}

src/contracts/mixins/SignatureUtilsMixin.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract contract SignatureUtilsMixin is ISignatureUtilsMixin, SemVerMixin {
2121
using SignatureCheckerUpgradeable for address;
2222

2323
/// @notice Initializes the contract with a semantic version string.
24-
/// @param _version The SemVer-formatted version string (e.g., "v1.1.1") to use for this contract's domain separator.
24+
/// @param _version The SemVer-formatted version string (e.g., "1.1.1") to use for this contract's domain separator.
2525
/// @dev Version should follow SemVer 2.0.0 format with 'v' prefix: vMAJOR.MINOR.PATCH.
2626
/// Only the major version component is used in the domain separator to maintain signature compatibility
2727
/// across minor and patch version updates.

src/test/harnesses/AllocationManagerHarness.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract AllocationManagerHarness is AllocationManager {
1313
uint32 _DEALLOCATION_DELAY,
1414
uint32 _ALLOCATION_CONFIGURATION_DELAY
1515
)
16-
AllocationManager(_delegation, _pauserRegistry, _permissionController, _DEALLOCATION_DELAY, _ALLOCATION_CONFIGURATION_DELAY, "v9.9.9")
16+
AllocationManager(_delegation, _pauserRegistry, _permissionController, _DEALLOCATION_DELAY, _ALLOCATION_CONFIGURATION_DELAY, "9.9.9")
1717
{}
1818

1919
function deallocationQueueAtIndex(address operator, IStrategy strategy, uint index) external view returns (bytes32) {

src/test/harnesses/DelegationManagerHarness.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ contract DelegationManagerHarness is DelegationManager {
2020
_pauserRegistry,
2121
_permissionController,
2222
_MIN_WITHDRAWAL_DELAY,
23-
"v9.9.9"
23+
"9.9.9"
2424
)
2525
{}
2626

src/test/integration/IntegrationDeployer.t.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
4141
bool isUpgraded;
4242
uint mainnetForkBlock = 21_616_692; // Post Protocol Council upgrade
4343

44-
string version = "v9.9.9";
44+
string version = "9.9.9";
4545

4646
// Beacon chain genesis time when running locally
4747
// Multiple of 12 for sanity's sake
@@ -352,14 +352,14 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
352352
);
353353
avsDirectoryImplementation = new AVSDirectory(delegationManager, eigenLayerPauserReg, version);
354354
eigenPodManagerImplementation =
355-
new EigenPodManager(DEPOSIT_CONTRACT, eigenPodBeacon, delegationManager, eigenLayerPauserReg, "v9.9.9");
356-
strategyFactoryImplementation = new StrategyFactory(strategyManager, eigenLayerPauserReg, "v9.9.9");
355+
new EigenPodManager(DEPOSIT_CONTRACT, eigenPodBeacon, delegationManager, eigenLayerPauserReg, "9.9.9");
356+
strategyFactoryImplementation = new StrategyFactory(strategyManager, eigenLayerPauserReg, "9.9.9");
357357
slashingWithdrawalRouterImplementation =
358-
new SlashingWithdrawalRouter(allocationManager, strategyManager, eigenLayerPauserReg, "v9.9.9");
358+
new SlashingWithdrawalRouter(allocationManager, strategyManager, eigenLayerPauserReg, "9.9.9");
359359

360360
// Beacon implementations
361-
eigenPodImplementation = new EigenPod(DEPOSIT_CONTRACT, eigenPodManager, BEACON_GENESIS_TIME, "v9.9.9");
362-
baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg, "v9.9.9");
361+
eigenPodImplementation = new EigenPod(DEPOSIT_CONTRACT, eigenPodManager, BEACON_GENESIS_TIME, "9.9.9");
362+
baseStrategyImplementation = new StrategyBase(strategyManager, eigenLayerPauserReg, "9.9.9");
363363

364364
// Pre-longtail StrategyBaseTVLLimits implementation
365365
// TODO - need to update ExistingDeploymentParser

src/test/integration/tests/eigenpod/SlashBC_OneBCSF.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ contract Integration_SlashBC_OneBCSF is IntegrationCheckUtils {
3434
function _init() internal override {
3535
// 1. etch a new implementation to set staker's beaconChainSlashingFactor to 1
3636
EigenPodManagerWrapper eigenPodManagerWrapper =
37-
new EigenPodManagerWrapper(DEPOSIT_CONTRACT, eigenPodBeacon, delegationManager, eigenLayerPauserReg, "v9.9.9");
37+
new EigenPodManagerWrapper(DEPOSIT_CONTRACT, eigenPodBeacon, delegationManager, eigenLayerPauserReg, "9.9.9");
3838
address targetAddr = address(eigenPodManagerImplementation);
3939
cheats.etch(targetAddr, address(eigenPodManagerWrapper).code);
4040

src/test/mocks/EigenPodMock.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "../../contracts/interfaces/IEigenPod.sol";
66
import "../../contracts/mixins/SemVerMixin.sol";
77

88
contract EigenPodMock is IEigenPod, SemVerMixin, Test {
9-
constructor() SemVerMixin("v9.9.9") {}
9+
constructor() SemVerMixin("9.9.9") {}
1010

1111
function nonBeaconChainETHBalanceWei() external view returns (uint) {}
1212

src/test/unit/AVSDirectoryUnit.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents,
3636
avsd = AVSDirectory(
3737
address(
3838
new TransparentUpgradeableProxy(
39-
address(new AVSDirectory(IDelegationManager(delegationManager), pauserRegistry, "v9.9.9")),
39+
address(new AVSDirectory(IDelegationManager(delegationManager), pauserRegistry, "9.9.9")),
4040
address(eigenLayerProxyAdmin),
4141
abi.encodeWithSelector(
4242
AVSDirectory.initialize.selector,
@@ -51,7 +51,7 @@ contract AVSDirectoryUnitTests is EigenLayerUnitTestSetup, IAVSDirectoryEvents,
5151
bytes memory v = bytes(avsd.version());
5252
bytes32 expectedDomainSeparator = keccak256(
5353
abi.encode(
54-
EIP712_DOMAIN_TYPEHASH, keccak256(bytes("EigenLayer")), keccak256(bytes.concat(v[0], v[1])), block.chainid, address(avsd)
54+
EIP712_DOMAIN_TYPEHASH, keccak256(bytes("EigenLayer")), keccak256(abi.encodePacked(v[0])), block.chainid, address(avsd)
5555
)
5656
);
5757

0 commit comments

Comments
 (0)