Skip to content

Commit

Permalink
fix: compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
0xClandestine committed Sep 19, 2024
1 parent 898c3e0 commit 8c5de60
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ contract Deploy_Preprod_RewardsCoordinator is Deploy_Test_RewardsCoordinator {
// Sanity Checks
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized();
_verifyContractsInitialized(true);
_verifyInitializationParams();

logAndOutputContractAddresses("script/output/holesky/Deploy_RewardsCoordinator_Preprod.holesky.config.json");
Expand Down
2 changes: 1 addition & 1 deletion script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser {
// Sanity Checks
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized();
_verifyContractsInitialized(true);
_verifyInitializationParams();

logAndOutputContractAddresses("script/output/holesky/Deploy_RewardsCoordinator.holesky.config.json");
Expand Down
2 changes: 1 addition & 1 deletion script/deploy/holesky/M2_Deploy_From_Scratch.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract M2_Deploy_Holesky_From_Scratch is ExistingDeploymentParser {
// Sanity Checks
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized();
_verifyContractsInitialized(true);
_verifyInitializationParams();

logAndOutputContractAddresses("script/output/holesky/M2_deploy_from_scratch.holesky.config.json");
Expand Down
2 changes: 1 addition & 1 deletion script/deploy/holesky/M2_Deploy_Preprod.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract M2_Deploy_Holesky_Preprod is M2_Deploy_Holesky_From_Scratch {
// Sanity Checks
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized();
_verifyContractsInitialized(true);
_verifyInitializationParams(); // override to check contract.owner() is EOAowner instead

logAndOutputContractAddresses("script/output/holesky/M2_deploy_preprod.holesky.config.json");
Expand Down
4 changes: 2 additions & 2 deletions script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract M2_Mainnet_Upgrade is ExistingDeploymentParser {
// Sanity Checks
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized();
_verifyContractsInitialized(true);
_verifyInitializationParams();

logAndOutputContractAddresses("script/output/mainnet/M2_mainnet_upgrade.output.json");
Expand Down Expand Up @@ -278,7 +278,7 @@ contract Queue_M2_Upgrade is M2_Mainnet_Upgrade, TimelockEncoding {
// Check correctness after upgrade
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized();
_verifyContractsInitialized(true);
_verifyInitializationParams();
_postUpgradeChecks();
}
Expand Down
2 changes: 1 addition & 1 deletion script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser {
// Sanity Checks
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized();
_verifyContractsInitialized(true);
_verifyInitializationParams();

logAndOutputContractAddresses("script/output/mainnet/v0.3.0-mainnet-rewards.output.json");
Expand Down
3 changes: 2 additions & 1 deletion script/utils/ExistingDeploymentParser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ contract ExistingDeploymentParser is Script, Test {
/**
* @notice Verify initialization of Transparent Upgradeable Proxies. Also check
* initialization params if this is the first deployment.
* @dev isInitialDeployment True if this is the first deployment of contracts from scratch
*/
function _verifyContractsInitialized() internal virtual {
function _verifyContractsInitialized(bool /** isInitialDeployment **/) internal virtual {
// AVSDirectory
vm.expectRevert(bytes("Initializable: contract is already initialized"));
avsDirectory.initialize(address(0), eigenLayerPauserReg, AVS_DIRECTORY_INIT_PAUSED_STATUS);
Expand Down
4 changes: 3 additions & 1 deletion src/contracts/core/RewardsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ contract RewardsCoordinator is

/// @notice the commission for a specific operator for a specific avs
/// NOTE: Currently unused and simply returns the globalOperatorCommissionBips value but will be used in future release
function operatorCommissionBips(address operator, address avs) external view returns (uint16) {
function operatorCommissionBips(address /** operator **/, address /** avs **/) external view returns (uint16) {
return globalOperatorCommissionBips;
}

Expand All @@ -566,6 +566,8 @@ contract RewardsCoordinator is
return root;
}
}
// Silence compiler warning.
return DistributionRoot(bytes32(0), 0, 0, false);
}

/// @notice loop through distribution roots from reverse and return hash
Expand Down
7 changes: 2 additions & 5 deletions src/contracts/strategies/StrategyBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,16 @@ contract StrategyBase is Initializable, Pausable, IStrategy {
/**
* @notice Called in the external `deposit` function, before any logic is executed. Expected to be overridden if strategies want such logic.
* @param token The token being deposited
* @param amount The amount of `token` being deposited
*/
function _beforeDeposit(IERC20 token, uint256 amount) internal virtual {
function _beforeDeposit(IERC20 token, uint256 /** amount **/) internal virtual {
require(token == underlyingToken, "StrategyBase.deposit: Can only deposit underlyingToken");
}

/**
* @notice Called in the external `withdraw` function, before any logic is executed. Expected to be overridden if strategies want such logic.
* @param recipient The address that will receive the withdrawn tokens
* @param token The token being withdrawn
* @param amountShares The amount of shares being withdrawn
*/
function _beforeWithdrawal(address recipient, IERC20 token, uint256 amountShares) internal virtual {
function _beforeWithdrawal(address /** recipient **/, IERC20 token, uint256 /** amountShares **/) internal virtual {
require(token == underlyingToken, "StrategyBase.withdraw: Can only withdraw the strategy token");
}

Expand Down
10 changes: 7 additions & 3 deletions src/test/integration/IntegrationDeployer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -699,17 +699,21 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
// ethPOSDeposit = new ETHPOSDepositMock();
// eigenPodImplementation = new EigenPod(
// ethPOSDeposit,
// eigenPodImplementation.delayedWithdrawalRouter(),
// eigenPodImplementation.eigenPodManager(),
// eigenPodImplementation.MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR(),
// 0
// );
// // Create time machine and mock beacon chain
// // Create time machine and set block timestamp forward so we can create EigenPod proofs in the past
// timeMachine = new TimeMachine();
// beaconChain = new BeaconChainMock(eigenPodManager, GENESIS_TIME_MAINNET);
// beaconChainOracle = new BeaconChainOracleMock();
// // Create mock beacon chain / proof gen interface
// beaconChain = new BeaconChainMock(timeMachine, beaconChainOracle, eigenPodManager);

// cheats.startPrank(executorMultisig);
// eigenPodBeacon.upgradeTo(address(eigenPodImplementation));
// eigenPodManager.updateBeaconChainOracle(beaconChainOracle);
// cheats.stopPrank();

} else {
revert("_deployOrFetchContracts: unimplemented forkType");
}
Expand Down
8 changes: 4 additions & 4 deletions src/test/integration/tests/Upgrade_Setup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract IntegrationMainnetFork_UpgradeSetup is IntegrationCheckUtils {
// // // 1. Check proper state pre-upgrade
// // _verifyContractPointers();
// // _verifyImplementations();
// // _verifyContractsInitialized({isInitialDeployment: true});
// // _verifyContractsInitialized(true);
// // _verifyInitializationParams();

// // 2. Upgrade mainnet contracts
Expand All @@ -28,7 +28,7 @@ contract IntegrationMainnetFork_UpgradeSetup is IntegrationCheckUtils {
// // 2. Verify upgrade setup
// _verifyContractPointers();
// _verifyImplementations();
// _verifyContractsInitialized({isInitialDeployment: true});
// _verifyContractsInitialized(true);
// _verifyInitializationParams();
// }

Expand All @@ -45,7 +45,7 @@ contract IntegrationMainnetFork_UpgradeSetup is IntegrationCheckUtils {
// // // 1. Check proper state pre-upgrade
// // _verifyContractPointers();
// // _verifyImplementations();
// // _verifyContractsInitialized({isInitialDeployment: true});
// // _verifyContractsInitialized(true);
// // _verifyInitializationParams();

// // 2. Upgrade holesky contracts
Expand All @@ -55,7 +55,7 @@ contract IntegrationMainnetFork_UpgradeSetup is IntegrationCheckUtils {
// // 3. Verify upgrade setup
// _verifyContractPointers();
// _verifyImplementations();
// _verifyContractsInitialized({isInitialDeployment: true});
// _verifyContractsInitialized(true);
// _verifyInitializationParams();
// }

Expand Down
4 changes: 4 additions & 0 deletions src/test/unit/AVSDirectoryUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ contract AVSDirectoryUnitTests_operatorAVSRegisterationStatus is AVSDirectoryUni
assertFalse(delegationManager.isOperator(operator), "bad test setup");
_registerOperatorWithBaseDetails(operator);

// uint256 expiry = type(uint256).max;
// ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature =
// _getOperatorSignature(delegationSignerPrivateKey, operator, defaultAVS, salt, expiry);

cheats.startPrank(operator);
avsDirectory.cancelSalt(salt);

Expand Down
2 changes: 1 addition & 1 deletion src/test/unit/DelegationUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage
(
IDelegationManager.Withdrawal memory withdrawal,
IERC20[] memory tokens,
// bytes32 withdrawalRoot

) = _setUpCompleteQueuedWithdrawalBeaconStrat({
staker: defaultStaker,
withdrawer: defaultStaker,
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/RewardsCoordinatorUnit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ contract RewardsCoordinatorUnitTests_processClaim is RewardsCoordinatorUnitTests
function testFuzz_processClaim_Revert_WhenRootDisabled(
bool setClaimerFor,
address claimerFor,
bytes32 merkleRoot
bytes32 root
) public filterFuzzedAddressInputs(claimerFor) {
// if setClaimerFor is true, set the earners claimer to the fuzzed address
address claimer;
Expand All @@ -1670,7 +1670,7 @@ contract RewardsCoordinatorUnitTests_processClaim is RewardsCoordinatorUnitTests

// Submit a root and disable it
cheats.startPrank(rewardsUpdater);
rewardsCoordinator.submitRoot(merkleRoot, 1);
rewardsCoordinator.submitRoot(root, 1);
uint32 rootIndex = 0;
IRewardsCoordinator.DistributionRoot memory distributionRoot = rewardsCoordinator.getDistributionRootAtIndex(rootIndex);
rewardsCoordinator.disableRoot(rootIndex);
Expand Down

0 comments on commit 8c5de60

Please sign in to comment.