-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* separate EvidenceVerifier * whitelist * eigen sync * fix build * fix deploy script
- Loading branch information
1 parent
039ceee
commit f4014c2
Showing
39 changed files
with
605 additions
and
749 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.12; | ||
|
||
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
|
||
interface IStakeManager { | ||
function freezeOperator(address toBeFrozen) external; | ||
function deposit(IERC20 token, uint256 amount) external; | ||
|
||
function resetFrozenStatus(address[] calldata frozenAddresses) external; | ||
function withdraw(IERC20 token, uint256 amount) external; | ||
|
||
function recordFirstStakeUpdate(address operator, uint32 serveUntilBlock) external; | ||
function lockStakeUntil(address operator, uint256 serveUntilBlock) external; | ||
|
||
function recordStakeUpdate(address operator, uint32 updateBlock, uint32 serveUntilBlock, uint256 insertAfter) | ||
external; | ||
function operatorShares(address operator, address token) external view returns (uint256); | ||
|
||
function recordLastStakeUpdateAndRevokeSlashingAbility(address operator, uint32 serveUntilBlock) external; | ||
// future use for slashing | ||
function freezeOperator(address toBeFrozen) external; | ||
|
||
function isFrozen(address staker) external view returns (bool); | ||
function resetFrozenStatus(address[] calldata frozenAddresses) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.12; | ||
|
||
import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; | ||
import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; | ||
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
import {IDelegationManager} from "eigenlayer-contracts/src/contracts/interfaces/IDelegationManager.sol"; | ||
import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol"; | ||
|
||
import {IStakeManager} from "../interfaces/IStakeManager.sol"; | ||
|
||
contract EigenAdapter is Initializable, OwnableUpgradeable, IStakeManager { | ||
// future use | ||
mapping(address => bool) public freezeOperators; | ||
|
||
address public immutable service; | ||
IDelegationManager public immutable delegationManager; | ||
|
||
modifier onlyService() { | ||
require(msg.sender == service, "Only service manager can call this function."); | ||
_; | ||
} | ||
|
||
constructor(address _service, IDelegationManager _delegationManager) { | ||
service = _service; | ||
delegationManager = _delegationManager; | ||
_disableInitializers(); | ||
} | ||
|
||
function initialize(address initialOwner) external initializer { | ||
_transferOwnership(initialOwner); | ||
} | ||
|
||
function deposit(IERC20 token, uint256 amount) external pure {} | ||
|
||
function withdraw(IERC20 token, uint256 amount) external pure {} | ||
|
||
function lockStakeUntil(address operator, uint256 serveUntilBlock) external pure {} | ||
|
||
function operatorShares(address operator, address token) external view returns (uint256) { | ||
return delegationManager.operatorShares(operator, IStrategy(token)); | ||
} | ||
|
||
// future use for slashing | ||
function resetFrozenStatus(address[] calldata frozenAddresses) external onlyOwner { | ||
// for (uint256 i = 0; i < frozenAddresses.length; i++) { | ||
// freezeOperators[frozenAddresses[i]] = false; | ||
// } | ||
} | ||
|
||
function freezeOperator(address operator) external onlyService { | ||
// freezeOperators[operator] = true; | ||
} | ||
} |
Oops, something went wrong.