-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring interfaces and base contracts
- Loading branch information
Showing
6 changed files
with
50 additions
and
94 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,35 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
pragma solidity ^0.8.8; | ||
|
||
/* solhint-disable max-line-length */ | ||
|
||
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
import {ILockManager} from "../interfaces/ILockManager.sol"; | ||
import {ILockToVoteBase} from "../interfaces/ILockToVoteBase.sol"; | ||
import {IMembership} from "@aragon/osx-commons-contracts/src/plugin/extensions/membership/IMembership.sol"; | ||
|
||
/// @title LockToVoteBase | ||
/// @author Aragon X 2024-2025 | ||
abstract contract LockToVoteBase is ILockToVoteBase, IMembership { | ||
/// @inheritdoc ILockToVoteBase | ||
ILockManager public lockManager; | ||
|
||
/// @inheritdoc ILockToVoteBase | ||
function token() external view returns (IERC20) { | ||
return lockManager.token(); | ||
} | ||
|
||
/// @inheritdoc ILockToVoteBase | ||
function underlyingToken() external view returns (IERC20) { | ||
return lockManager.underlyingToken(); | ||
} | ||
|
||
/// @inheritdoc IMembership | ||
function isMember(address _account) external view returns (bool) { | ||
if (lockManager.lockedBalances(_account) > 0) return true; | ||
else if (lockManager.token().balanceOf(_account) > 0) return true; | ||
return false; | ||
} | ||
|
||
} |
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