Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions contracts/avs/.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
OmniAVS_admin_Test:test_avsDirectory_succeeds() (gas: 17892)
OmniAVS_admin_Test:test_ejectOwner_byOwner_succeeds() (gas: 435730)
OmniAVS_admin_Test:test_ejectOwner_byOwner_succeeds() (gas: 433730)
OmniAVS_admin_Test:test_ejectOwner_notOwner_reverts() (gas: 107992)
OmniAVS_admin_Test:test_getOPeratorRestakedStrategies_notOperator_succeeds() (gas: 108726)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_noStrategies_succeeds() (gas: 519221)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_succeeds() (gas: 584216)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_noStrategies_succeeds() (gas: 516721)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_succeeds() (gas: 581716)
OmniAVS_admin_Test:test_getRestakeableStrategies_noStrategies_succeeds() (gas: 27775)
OmniAVS_admin_Test:test_getRestakeableStrategies_succeeds() (gas: 90741)
OmniAVS_admin_Test:test_pause_byOwner_succeeds() (gas: 45233)
Expand Down Expand Up @@ -35,30 +35,30 @@ OmniAVS_admin_Test:test_unpause_byOwner_succeeds() (gas: 36276)
OmniAVS_allowlist_Test:test_addToAllowlist_notOwner_reverts() (gas: 108013)
OmniAVS_allowlist_Test:test_addToAllowlist_succeeds() (gas: 135721)
OmniAVS_allowlist_Test:test_deregisterOperator_invalidOperator_reverts() (gas: 110539)
OmniAVS_allowlist_Test:test_deregisterOperator_succeeds() (gas: 420002)
OmniAVS_allowlist_Test:test_deregisterOperator_succeeds() (gas: 418002)
OmniAVS_allowlist_Test:test_disableAllowlist_alreadyDisabled_reverts() (gas: 32184)
OmniAVS_allowlist_Test:test_disableAllowlist_notOwner_reverts() (gas: 17823)
OmniAVS_allowlist_Test:test_disableAllowlist_succeeds() (gas: 29433)
OmniAVS_allowlist_Test:test_enableAllowlist_alreadyEnabled_reverts() (gas: 26071)
OmniAVS_allowlist_Test:test_enableAllowlist_notOwner_reverts() (gas: 17844)
OmniAVS_allowlist_Test:test_enableAllowlist_succeeds() (gas: 29875)
OmniAVS_allowlist_Test:test_registerOperator_allowlistDisabled_succeeds() (gas: 522505)
OmniAVS_allowlist_Test:test_registerOperator_allowlistDisabled_succeeds() (gas: 520005)
OmniAVS_allowlist_Test:test_registerOperator_invalidPubkey_reverts() (gas: 314848)
OmniAVS_allowlist_Test:test_registerOperator_nowAllowed_reverts() (gas: 117044)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 540922)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 542863)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 538422)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 540363)
OmniAVS_allowlist_Test:test_registerOperator_wrongPubkey_reverts() (gas: 404400)
OmniAVS_allowlist_Test:test_removeFromAllowlist_notOwner_reverts() (gas: 107961)
OmniAVS_allowlist_Test:test_removeFromAllowlist_succeeds() (gas: 242130)
OmniAVS_canRegister_Test:test_canRegister_allowed() (gas: 331240)
OmniAVS_canRegister_Test:test_canRegister_allowlistDisabled() (gas: 311213)
OmniAVS_canRegister_Test:test_canRegister_alreadyRegistered() (gas: 525310)
OmniAVS_canRegister_Test:test_canRegister_alreadyRegistered() (gas: 522810)
OmniAVS_canRegister_Test:test_canRegister_maxOperatorsReached() (gas: 265039)
OmniAVS_canRegister_Test:test_canRegister_minStakeNotMet() (gas: 331780)
OmniAVS_canRegister_Test:test_canRegister_notAllowed() (gas: 225890)
OmniAVS_canRegister_Test:test_canRegister_notOperator() (gas: 120666)
OmniAVS_initialize_Test:test_initialize_defaultParams_succeeds() (gas: 3606859)
OmniAVS_syncWithOmni_Test:test_depositBeaconEth_succeeds() (gas: 638240)
OmniAVS_syncWithOmni_Test:test_unsupportedStrategyDeposit_succeeds() (gas: 1677648)
OmniAVS_syncWithOmni_Test:test_depositBeaconEth_succeeds() (gas: 635740)
OmniAVS_syncWithOmni_Test:test_unsupportedStrategyDeposit_succeeds() (gas: 1675148)
OmniAVS_upgrade_Test:test_upgrade_invalidProxyOwner_reverts() (gas: 2698429)
OmniAVS_upgrade_Test:test_upgrade_succeeds() (gas: 2756363)
4 changes: 3 additions & 1 deletion contracts/avs/test/OmniAVS_initialize.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ pragma solidity =0.8.12;

import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {
ITransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

import { IAVSDirectory } from "eigenlayer-contracts/src/contracts/interfaces/IAVSDirectory.sol";
import { IStrategy } from "eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/avs/test/OmniAVS_upgrade.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { OmniAVS } from "src/OmniAVS.sol";

import { IDelegationManager } from "src/ext/IDelegationManager.sol";
import { IAVSDirectory } from "eigenlayer-contracts/src/contracts/interfaces/IAVSDirectory.sol";
import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {
ITransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

contract OmniAVS_upgrade_Test is Base {
function _checkAndHashState() internal view returns (bytes32) {
Expand Down
6 changes: 4 additions & 2 deletions contracts/avs/test/common/Fixtures.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ pragma solidity =0.8.12;

import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {
ITransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

import { IAVSDirectory } from "eigenlayer-contracts/src/contracts/interfaces/IAVSDirectory.sol";
import { IStrategy } from "eigenlayer-contracts/src/contracts/interfaces/IStrategyManager.sol";
Expand Down Expand Up @@ -174,7 +176,7 @@ contract Fixtures is EigenLayerFixtures {
params[i] = IOmniAVS.StrategyParam({
strategy: IStrategy(strategies[i]),
multiplier: uint96(1e18) // OmniAVS.STRATEGY_WEIGHTING_DIVISOR
});
});
}

return params;
Expand Down
9 changes: 3 additions & 6 deletions contracts/avs/test/common/StrategyParams.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ library StrategyParams {
params = new IOmniAVS.StrategyParam[](4);

params[0] = IOmniAVS.StrategyParam({
strategy: IStrategy(EigenM2HoleskyDeployments.stETHStrategy),
multiplier: STD_MULTIPLIER
strategy: IStrategy(EigenM2HoleskyDeployments.stETHStrategy), multiplier: STD_MULTIPLIER
});

params[1] = IOmniAVS.StrategyParam({
strategy: IStrategy(EigenM2HoleskyDeployments.rETHStrategy),
multiplier: STD_MULTIPLIER
strategy: IStrategy(EigenM2HoleskyDeployments.rETHStrategy), multiplier: STD_MULTIPLIER
});

params[2] = IOmniAVS.StrategyParam({
strategy: IStrategy(EigenM2HoleskyDeployments.WETHStrategy),
multiplier: STD_MULTIPLIER
strategy: IStrategy(EigenM2HoleskyDeployments.WETHStrategy), multiplier: STD_MULTIPLIER
});

params[3] =
Expand Down
13 changes: 3 additions & 10 deletions contracts/avs/test/common/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ contract Utils is Fixtures {
/// @dev register an operator with eigenlayer core
function _registerAsOperator(address operator) internal {
IDelegationManager.OperatorDetails memory operatorDetails = IDelegationManager.OperatorDetails({
earningsReceiver: operator,
delegationApprover: address(0),
stakerOptOutWindowBlocks: 0
earningsReceiver: operator, delegationApprover: address(0), stakerOptOutWindowBlocks: 0
});

_testRegisterAsOperator(operator, operatorDetails);
Expand All @@ -36,16 +34,11 @@ contract Utils is Fixtures {
function _registerOperatorWithAVS(address operator) internal {
// don't matter
ISignatureUtils.SignatureWithSaltAndExpiry memory sig = ISignatureUtils.SignatureWithSaltAndExpiry({
signature: new bytes(0),
salt: keccak256(abi.encodePacked(operator)),
expiry: block.timestamp + 1 days
signature: new bytes(0), salt: keccak256(abi.encodePacked(operator)), expiry: block.timestamp + 1 days
});

bytes32 operatorRegistrationDigestHash = avsDirectory.calculateOperatorAVSRegistrationDigestHash({
operator: operator,
avs: address(omniAVS),
salt: sig.salt,
expiry: sig.expiry
operator: operator, avs: address(omniAVS), salt: sig.salt, expiry: sig.expiry
});

sig.signature = _sign(operator, operatorRegistrationDigestHash);
Expand Down
4 changes: 3 additions & 1 deletion contracts/avs/test/common/eigen/EigenLayerHolesky.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
pragma solidity =0.8.12;

import { ERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {
ITransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";

Expand Down
21 changes: 16 additions & 5 deletions contracts/avs/test/common/eigen/EigenLayerLocal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {
ITransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
import { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";

Expand Down Expand Up @@ -89,8 +91,9 @@ contract EigenLayerLocal is IEigenDeployer, CommonBase {
* not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code.
*/
EmptyContract emptyContract = new EmptyContract();
delegation =
DelegationManager(address(new TransparentUpgradeableProxy(address(emptyContract), address(proxyAdmin), "")));
delegation = DelegationManager(
address(new TransparentUpgradeableProxy(address(emptyContract), address(proxyAdmin), ""))
);
avsDirectory =
AVSDirectory(address(new TransparentUpgradeableProxy(address(emptyContract), address(proxyAdmin), "")));
strategyManager =
Expand Down Expand Up @@ -140,7 +143,10 @@ contract EigenLayerLocal is IEigenDeployer, CommonBase {
ITransparentUpgradeableProxy(payable(address(avsDirectory))),
address(avsDirectoryImplementation),
abi.encodeWithSelector(
AVSDirectory.initialize.selector, proxyAdminOwner, pauserReg, 0 /*initialPausedStatus*/
AVSDirectory.initialize.selector,
proxyAdminOwner,
pauserReg,
0 /*initialPausedStatus*/
)
);
proxyAdmin.upgradeAndCall(
Expand All @@ -157,7 +163,12 @@ contract EigenLayerLocal is IEigenDeployer, CommonBase {
proxyAdmin.upgradeAndCall(
ITransparentUpgradeableProxy(payable(address(slasher))),
address(slasherImplementation),
abi.encodeWithSelector(Slasher.initialize.selector, proxyAdminOwner, pauserReg, 0 /*initialPausedStatus*/ )
abi.encodeWithSelector(
Slasher.initialize.selector,
proxyAdminOwner,
pauserReg,
0 /*initialPausedStatus*/
)
);
proxyAdmin.upgradeAndCall(
ITransparentUpgradeableProxy(payable(address(eigenPodManager))),
Expand Down
4 changes: 3 additions & 1 deletion contracts/avs/test/common/eigen/EigenLayerMainnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
pragma solidity =0.8.12;

import { ERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {
ITransparentUpgradeableProxy
} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import { ProxyAdmin } from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";

Expand Down
7 changes: 2 additions & 5 deletions contracts/avs/test/common/eigen/EigenPodManagerHarness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ contract EigenPodManagerHarness is EigenPodManager {
podOwnerShares[podOwner] = updatedPodOwnerShares;

int256 changeInDelegatableShares = _calculateChangeInDelegatableShares({
sharesBefore: currentPodOwnerShares,
sharesAfter: updatedPodOwnerShares
sharesBefore: currentPodOwnerShares, sharesAfter: updatedPodOwnerShares
});

delegationManager.increaseDelegatedShares({
staker: podOwner,
strategy: beaconChainETHStrategy,
shares: uint256(changeInDelegatableShares)
staker: podOwner, strategy: beaconChainETHStrategy, shares: uint256(changeInDelegatableShares)
});
}
}
Loading
Loading