Hello I want to create a token and I want to set the tax fees to 10% sell tax , 5% Buy tax , 15% transfer tax and I want to change these tax fees in the future and I got help from someone for this he sent me a token contract
I shared both my code and a photo with you, firstly, there is a mistake in my code and the taxes I wrote on my code do not work, secondly, when I want to change the taxes in the photo, the room does not work, I write the rate I want there, I approve it via MetaMask, but again, new tax fees are not reflected in my tock.
Please someone help me for free I don't trust anyone everyone scammed me this is my Telegram address please help @HyperionNNOA
> Blockquote
**// SPDX-License-Identifier: MIT **
**pragma solidity ^0.8.0; **
** **
**contract BounceBit { **
** string public constant name = "BounceBit"; **
** string public constant symbol = "BB"; **
** uint8 public constant decimals = 18; **
** uint256 public constant initialSupply = 2000000 * (10 ** uint256(decimals)); **
** uint256 public saleTaxPercentage = 500; // %5sale tax **
** uint256 public transferTaxPercentage = 0; // No transfer tax **
** uint256 public buyTaxPercentage = 100; // %1000buy tax **
** mapping(address => uint256) balances; **
** mapping(address => mapping(address => uint256)) allowed; **
** bool public isTradingAllowed = true; **
** **
** event Transfer(address indexed from, address indexed to, uint256 value); **
** event Approval(address indexed owner, address indexed spender, uint256 value); **
** event SaleTaxPercentageUpdated(uint256 newPercentage); **
** event TransferTaxPercentageUpdated(uint256 newPercentage); **
** event TradingStatusUpdated(bool tradingAllowed); **
** event TokenBurned(address indexed burner, uint256 value); **
** event BuyTaxPercentageUpdated(uint256 newPercentage); **
** **
** constructor() { **
** balances[msg.sender] = initialSupply; **
** emit Transfer(address(0), msg.sender, initialSupply); **
** } **
** **
** function totalSupply() public pure returns (uint256) { **
** return initialSupply; **
**} **
** **
** **
** function balanceOf(address _owner) public view returns (uint256 balance) { **
** return balances[_owner]; **
** } **
** **
** function transfer(address _to, uint256 _value) public returns (bool success) { **
** require(isTradingAllowed, "Trading is currently paused"); **
** require(_to != address(0), "Invalid address"); **
** require(_value <= balances[msg.sender], "Insufficient balance"); **
** **
** uint256 taxAmount = (_value * transferTaxPercentage) / 10000; // Calculate transfer tax **
** uint256 transferAmount = _value - taxAmount; **
** **
** balances[msg.sender] -= _value; **
** balances[_to] += transferAmount; **
** **
** emit Transfer(msg.sender, _to, transferAmount); **
** **
** return true; **
** } **
** **
** function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { **
** require(isTradingAllowed, "Trading is currently paused"); **
** require(_to != address(0), "Invalid address"); **
** require(_value <= balances[_from], "Insufficient balance"); **
** require(_value <= allowed[_from][msg.sender], "Allowance exceeded"); **
** **
** uint256 taxAmount = (_value * transferTaxPercentage) / 10000; // Calculate transfer tax **
** uint256 transferAmount = _value - taxAmount; **
** **
** balances[_from] -= _value; **
** balances[_to] += transferAmount; **
** allowed[_from][msg.sender] -= _value; **
** **
** emit Transfer(_from, _to, transferAmount); **
** **
** return true; **
** } **
** **
** function approve(address _spender, uint256 _value) public returns (bool success) { **
** allowed[msg.sender][_spender] = _value; **
** emit Approval(msg.sender, _spender, _value); **
** return true; **
** } **
** **
** function allowance(address _owner, address _spender) public view returns (uint256 remaining) { **
** return allowed[_owner][_spender]; **
** } **
** **
** function updateSaleTaxPercentage(uint256 _newPercentage) public { **
** require(_newPercentage <= 10000, "Invalid percentage"); **
** saleTaxPercentage = _newPercentage; **
** emit SaleTaxPercentageUpdated(_newPercentage); **
** } **
** **
** function updateTransferTaxPercentage(uint256 _newPercentage) public { **
** require(_newPercentage <= 10000, "Invalid percentage"); **
** transferTaxPercentage = _newPercentage; **
** emit TransferTaxPercentageUpdated(_newPercentage); **
** } **
** **
** function updateBuyTaxPercentage(uint256 _newPercentage) public { **
** require(_newPercentage <= 10000, "Invalid percentage"); **
** buyTaxPercentage = _newPercentage; **
** emit BuyTaxPercentageUpdated(_newPercentage); **
** } **
** **
** function updateTradingStatus(bool _newStatus) public { **
** isTradingAllowed = _newStatus; **
** emit TradingStatusUpdated(_newStatus); **
** } **
** **
** function**
> Blockquote