Skip to content

Instantly share code, notes, and snippets.

@rpaskin
Created April 25, 2024 19:31
Show Gist options
  • Save rpaskin/315ddc6870140fc6f0c7ba68a7af5659 to your computer and use it in GitHub Desktop.
Save rpaskin/315ddc6870140fc6f0c7ba68a7af5659 to your computer and use it in GitHub Desktop.
Contrato Inteligente de Token de Refrigerante usando OpenZeppelin (com limitação de transferência)
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.20;
import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol";
import "@openzeppelin/[email protected]/token/ERC20/extensions/ERC20Permit.sol";
contract RefriToken is ERC20, ERC20Permit {
constructor() ERC20("RefriToken", "RFT") ERC20Permit("RefriToken") {
_mint(msg.sender, 12 * 10 ** decimals());
}
function decimals() public pure override returns (uint8) {
return 0;
}
function transfer(address _to, uint256 _value) pure public override returns (bool success) {
require(false, "Transferring disabled for this token"); // desabilitar
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment