-
Notifications
You must be signed in to change notification settings - Fork 27
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
29 changed files
with
999 additions
and
823 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 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 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,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.25; | ||
|
||
import {RewardsDistributorBase} from "./RewardsDistributorBase.sol"; | ||
|
||
import {IRewardsDistributorBase} from "src/interfaces/base/IRewardsDistributorBase.sol"; | ||
import {IRewardsDistributor} from "src/interfaces/base/IRewardsDistributor.sol"; | ||
|
||
abstract contract RewardsDistributor is RewardsDistributorBase, IRewardsDistributor { | ||
constructor(address networkRegistry) RewardsDistributorBase(networkRegistry) {} | ||
|
||
/** | ||
* @inheritdoc IRewardsDistributorBase | ||
*/ | ||
function version() external pure override(RewardsDistributorBase, IRewardsDistributorBase) returns (uint64) { | ||
return 1; | ||
} | ||
|
||
/** | ||
* @inheritdoc IRewardsDistributor | ||
*/ | ||
function distributeReward(address network, address token, uint256 amount, uint48 timestamp) external virtual {} | ||
} |
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,37 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.25; | ||
|
||
import {IRegistry} from "src/interfaces/base/IRegistry.sol"; | ||
import {IRewardsDistributorBase} from "src/interfaces/base/IRewardsDistributorBase.sol"; | ||
|
||
abstract contract RewardsDistributorBase is IRewardsDistributorBase { | ||
/** | ||
* @inheritdoc IRewardsDistributorBase | ||
*/ | ||
address public immutable NETWORK_REGISTRY; | ||
|
||
modifier checkNetwork(address account) { | ||
_checkNetwork(account); | ||
_; | ||
} | ||
|
||
constructor(address networkRegistry) { | ||
NETWORK_REGISTRY = networkRegistry; | ||
} | ||
|
||
/** | ||
* @inheritdoc IRewardsDistributorBase | ||
*/ | ||
function VAULT() public view virtual override returns (address) {} | ||
|
||
/** | ||
* @inheritdoc IRewardsDistributorBase | ||
*/ | ||
function version() external view virtual override returns (uint64) {} | ||
|
||
function _checkNetwork(address account) internal view { | ||
if (!IRegistry(NETWORK_REGISTRY).isEntity(account)) { | ||
revert NotNetwork(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.