Each time a transaction is initiated, the contract calculates the charity, marketing, and burn amounts based on the transaction’s total value.
The corresponding fee amounts are deducted, and the remaining tokens (after fees) are transferred to the recipient.
All fees are distributed seamlessly, so users don’t need to take any additional actions, making the process automatic and efficient.
This TaxToken contract provides several owner-only functions, giving the project owner control over key aspects of the token’s behavior. These functions are restricted to ensure only the designated owner can perform critical actions, helping maintain security and flexibility.
The owner can update the addresses of the charity, marketing, and burn wallets using the setFeeWallets
function. This allows the project to change where funds are allocated as needed, supporting adaptability over time.
Exclude/Include Address from Fee:
The owner has the ability to exclude specific addresses from paying transaction fees through the excludeFromFee
function or reinstate the fee for any address with the includeInFee
function. This is useful for exempting project wallets or partners, ensuring certain transactions are fee-free if needed.
Transfer Ownership:
The contract inherits the Ownable
functionality, allowing the owner to transfer ownership to another address. This adds flexibility for future management changes and helps with project decentralization if ownership needs to be passed on.
Burn Tokens (ERC20Burnable):
Since the contract inherits ERC20Burnable, the owner (or any user) can burn tokens, permanently removing them from circulation. This is optional and can further reduce the token supply, aligning with the deflationary mechanics of the burn tax.
Reentrancy Protection:
While the basic token transfer function doesn’t involve reentrant calls, using OpenZeppelin’s battle-tested libraries ensures the contract is secure against common reentrancy attacks, which could otherwise lead to fund loss.
OpenZeppelin Standards:
The contract uses OpenZeppelin’s ERC20, ERC20Burnable, and Ownable implementations, which are widely trusted and audited for security. These implementations follow best practices, minimizing the risk of common vulnerabilities.
Immutable Code:
Once deployed, the contract is non-editable, ensuring full transparency. No one can alter the code or interfere with the mechanics, making it trustless and fully decentralized.
Transparent Taxation:
All fees are applied and distributed automatically, ensuring consistency and transparency in each transaction. This transparency helps build trust with the community, as they can clearly see how fees are allocated and the benefits of token burning, charity, and marketing