// SPDX-License-Identifier: MIT pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol";
contract JLOBToken is ERC20, Ownable {
uint256 public transferFee = 100; // 1% (100 = 1%, 10000 = 100%)
uint256 public constant MAX_FEE = 500; // 5% كحد أقصى
address public feeWallet;
event FeeUpdated(uint256 newFee);
event FeeWalletUpdated(address newWallet);
constructor(address _feeWallet)
ERC20("Jin Lobster Digital", "JLOB")
Ownable(msg.sender)
{
require(_feeWallet != address(0), "Invalid fee wallet");
feeWallet = _feeWallet;
uint256 initialSupply = 1_000_000_000 * 10 ** decimals();
_mint(msg.sender, initialSupply);
}
function setFee(uint256 newFee) external onlyOwner {
require(newFee <= MAX_FEE, "Fee too high");
transferFee = newFee;
emit FeeUpdated(newFee);
}
function setFeeWallet(address newWallet) external onlyOwner {
require(newWallet != address(0), "Invalid address");
feeWallet = newWallet;
emit FeeWalletUpdated(newWallet);
}
function _update(
address from,
address to,
uint256 amount
) internal override {
if (
<img width="1080" height="2340" alt="Screenshot_٢٠٢٦-٠٦-٢٧-١٤-٠٨-١٤-٩٣٧_com open web ai browser" src="https://github.com/user-attachments/assets/1d8d4079-5833-4ab2-9edd-da448377fb23" />
<img width="1080" height="2340" alt="Screenshot_٢٠٢٦-٠٦-١٤-١٤-٣٢-٢٩-٠١٤_com open web ai browser" src="https://github.com/user-attachments/assets/2ff8232d-b346-4d08-89fc-5ae3334131d4" />
from == address(0) ||
to == address(0) ||
transferFee == 0
) {
super._update(from, to, amount);
return;
}
uint256 feeAmount = (amount * transferFee) / 10000;
uint256 sendAmount = amount - feeAmount;
super._update(from, feeWallet, feeAmount);
super._update(from, to, sendAmount);
}
}
The user shares a Solidity smart contract for an ERC20 token named JLOBToken. The contract includes a transfer fee mechanism and allows the owner to update the fee and fee wallet. The user does not ask a specific question or report an issue.