Skip to content

Commit

Permalink
Support eip-165
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Jul 22, 2024
1 parent 051b0c4 commit 590b992
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/governance/GovernanceKTON.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ pragma solidity 0.8.20;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import "@openzeppelin/contracts/governance/utils/IVotes.sol";
import "../staking/StakingRewards.sol";

contract GovernanceKTON is ERC20Upgradeable, ERC20PermitUpgradeable, ERC20VotesUpgradeable, StakingRewards {
contract GovernanceKTON is
ERC165Upgradeable,
ERC20Upgradeable,
ERC20PermitUpgradeable,
ERC20VotesUpgradeable,
StakingRewards
{
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
Expand All @@ -19,6 +27,12 @@ contract GovernanceKTON is ERC20Upgradeable, ERC20PermitUpgradeable, ERC20VotesU
__ERC20Votes_init();
}

function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
return _interfaceId == type(IERC20).interfaceId || _interfaceId == type(IERC20Permit).interfaceId
|| _interfaceId == type(IERC20Metadata).interfaceId || _interfaceId == type(IVotes).interfaceId
|| super.supportsInterface(_interfaceId);
}

function lockAndStake(uint256 amount) external override {
_stake(amount);
_mint(msg.sender, amount);
Expand Down

0 comments on commit 590b992

Please sign in to comment.