Created
June 21, 2024 18:45
-
-
Save rpaskin/67d505a05a746912bb718d5dd52ada85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
// Compatible with OpenZeppelin Contracts ^5.0.0 | |
pragma solidity ^0.8.20; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract RefriToken is ERC20, Ownable { | |
constructor(address initialOwner) | |
ERC20("RefriToken", "RTK") | |
Ownable(initialOwner) | |
{} | |
function mint(address to, uint256 amount) public onlyOwner { | |
_mint(to, amount); | |
} | |
function transfer(address recipient, uint256 amount) public override returns (bool) { | |
require(recipient == owner(), "Transferencias apenas sao permitidas para o dono do contrato."); | |
return super.transfer(recipient, amount); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment