// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Bitturo {
string public name = “flick”;
string public symbol = “FTR”;
uint256 public totalSupply = 69000000000;
uint8 public decimals = 18;
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 Approval(address indexed owner, address indexed spender, uint256 value);
constructor() {
balanceOf[msg.sender] = totalSupply;
owner = msg.sender;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value, "Not enough balance");
require(_to != address(0), "Invalid address");
uint256 burnAmount = _value * 5 / 100;
uint256 transferAmount = _value - burnAmount;
balanceOf[msg.sender] -= _value;
balanceOf[_to] += transferAmount;
balanceOf[0x000000000000000000000000000000000000dEaD] += burnAmount;
emit Transfer(msg.sender, _to, transferAmount);
emit Transfer(msg.sender, 0x000000000000000000000000000000000000dEaD, burnAmount);
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(balanceOf[_from] >= _value, "Not enough balance");
require(allowance[_from][msg.sender] >= _value, "Not enough allowance");
require(_to != address(0), "Invalid address");
uint256 burnAmount = _value * 5 / 100;
uint256 transferAmount = _value - burnAmount;
balanceOf[_from] -= _value;
balanceOf[_to] += transferAmount;
balanceOf[0x000000000000000000000000000000000000dEaD] += burnAmount;
allowance[_from][msg.sender] -= _value;
emit Transfer(_from, _to, transferAmount);
emit Transfer(_from, 0x000000000000000000000000000000000000dEaD, burnAmount);
return true;
}
function setOwner(address _newOwner) public {
require(msg.sender == owner, "Only the owner can change ownership");
owner = _newOwner;
}
function withdrawTokens(uint256 _amount) public {
require(msg.sender == owner, "Only the owner can withdraw tokens");
balanceOf[owner] += _amount;
balanceOf[msg.sender] -= _amount;
emit Transfer(msg.sender, owner, _amount);
}
function withdrawEther(uint256 _amount) public {
require(address(this).balance >= _amount, "Insufficient balance");
payable(msg.sender).transfer(_amount);
}
}