Created
November 3, 2021 17:58
-
-
Save z0r0z/474a00280200f50965765f2c912f7f26 to your computer and use it in GitHub Desktop.
HODLPACToken
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.2; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; | |
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; | |
contract HODLPACToken is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes { | |
constructor() ERC20("HODL PAC Token", "HODL") ERC20Permit("HODL Token") {} | |
function mint(address to, uint256 amount) public onlyOwner { | |
_mint(to, amount); | |
} | |
// EIP-1238 overrides for non-transferability. | |
function transfer(address, uint256) public pure override returns (bool) { | |
revert(); | |
} | |
function transferFrom(address, address, uint256) public pure override returns (bool) { | |
revert(); | |
} | |
// The following functions are overrides required by Solidity. | |
function _afterTokenTransfer(address from, address to, uint256 amount) | |
internal | |
override(ERC20, ERC20Votes) | |
{ | |
super._afterTokenTransfer(from, to, amount); | |
} | |
function _mint(address to, uint256 amount) | |
internal | |
override(ERC20, ERC20Votes) | |
{ | |
super._mint(to, amount); | |
} | |
function _burn(address account, uint256 amount) | |
internal | |
override(ERC20, ERC20Votes) | |
{ | |
super._burn(account, amount); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment