Skip to content

Commit

Permalink
Support eip-165 (#14)
Browse files Browse the repository at this point in the history
* Support eip-165

* init
  • Loading branch information
hujw77 authored Jul 23, 2024
1 parent 051b0c4 commit 4622687
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 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 @@ -17,6 +25,13 @@ contract GovernanceKTON is ERC20Upgradeable, ERC20PermitUpgradeable, ERC20VotesU
__ERC20_init("Governance KTON", "gKTON");
__ERC20Permit_init("Governance KTON");
__ERC20Votes_init();
__ERC165_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 {
Expand Down

0 comments on commit 4622687

Please sign in to comment.