-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
107 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.9; | ||
|
||
import {OwnableUpgradeable} from "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; | ||
import {EigenDADisperserRegistryStorage} from "./EigenDADisperserRegistryStorage.sol"; | ||
import {IEigenDADisperserRegistry} from "../interfaces/IEigenDADisperserRegistry.sol"; | ||
import "../interfaces/IEigenDAStructs.sol"; | ||
|
||
/** | ||
* @title Registry for EigenDA disperser info | ||
* @author Layr Labs, Inc. | ||
*/ | ||
contract EigenDADisperserRegistry is OwnableUpgradeable, EigenDADisperserRegistryStorage, IEigenDADisperserRegistry { | ||
|
||
constructor() { | ||
_disableInitializers(); | ||
} | ||
|
||
function initialize( | ||
address _initialOwner | ||
) external initializer { | ||
_transferOwnership(_initialOwner); | ||
} | ||
|
||
function setDisperserInfo(uint32 _disperserKey, DisperserInfo memory _disperserInfo) external onlyOwner { | ||
disperserKeyToInfo[_disperserKey] = _disperserInfo; | ||
emit DisperserAdded(_disperserKey, _disperserInfo.disperserAddress); | ||
} | ||
|
||
function disperserKeyToAddress(uint32 _key) external view returns (address) { | ||
return disperserKeyToInfo[_key].disperserAddress; | ||
} | ||
} |
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,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.9; | ||
|
||
import "../interfaces/IEigenDAStructs.sol"; | ||
|
||
/** | ||
* @title Storage variables for the `EigenDADisperserRegistry` contract. | ||
* @author Layr Labs, Inc. | ||
* @notice This storage contract is separate from the logic to simplify the upgrade process. | ||
*/ | ||
abstract contract EigenDADisperserRegistryStorage { | ||
|
||
mapping(uint32 => DisperserInfo) public disperserKeyToInfo; | ||
|
||
// storage gap for upgradeability | ||
// slither-disable-next-line shadowing-state | ||
uint256[49] private __GAP; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.9; | ||
|
||
import "./IEigenDAStructs.sol"; | ||
|
||
interface IEigenDADisperserRegistry { | ||
|
||
event DisperserAdded(uint32 indexed key, address indexed disperser); | ||
|
||
function setDisperserInfo(uint32 _disperserKey, DisperserInfo memory _disperserInfo) external; | ||
|
||
function disperserKeyToAddress(uint32 key) external view returns (address); | ||
} |
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