Description:
Smart contract deployed on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Criador: Cleyton Gonçalves - CEO e Fundador do token Ofir
contract Ofir {
string public name = "Ofir";
string public symbol = "OFIR";
uint8 public decimals = 12;
uint256 public totalSupply;
address public owner;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Burn(address indexed from, uint256 value);
event Tax(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() {
owner = msg.sender;
totalSupply = 1_000_000_000 * 10 ** decimals;
balanceOf[owner] = totalSupply;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value, "Saldo insuficiente");
uint256 burnAmount = (_value * 1) / 100;
uint256 taxAmount = (_value * 2) / 100;
uint256 sendAmount = _value - burnAmount - taxAmount;
balanceOf[msg.sender] -= _value;
balanceOf[_to] += sendAmount;
balanceOf[owner] += taxAmount;
totalSupply -= burnAmount;
emit Burn(msg.sender, burnAmount);
emit Tax(msg.sender, owner, taxAmount);
emit Transfer(msg.sender, _to, sendAmount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= balanceOf[_from], "Saldo insuficiente");
require(_value <= allowance[_from][msg.sender], "Sem autorizacao");
uint256 burnAmount = (_value * 1) / 100;
uint256 taxAmount = (_value * 2) / 100;
uint256 sendAmount = _value - burnAmount - taxAmount;
balanceOf[_from] -= _value;
balanceOf[_to] += sendAmount;
balanceOf[owner] += taxAmount;
allowance[_from][msg.sender] -= _value;
totalSupply -= burnAmount;
emit Burn(_from, burnAmount);
emit Tax(_from, owner, taxAmount);
emit Transfer(_from, _to, sendAmount);
return true;
}
}
Submitted on: 2025-10-24 17:27:46
Comments
Log in to comment.
No comments yet.