Files
uupl-smart-contract/test/mocks/FeeOnTransferToken.sol
T
2026-08-17 17:10:35 -06:00

27 lines
749 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract FeeOnTransferToken is ERC20 {
constructor() ERC20("Fee-on-Transfer Token", "FOT") {}
function decimals() public pure override returns (uint8) {
return 6;
}
function mint(address to, uint256 amount) external {
_mint(to, amount);
}
function transferFrom(address from, address to, uint256 amount) public override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
uint256 received = amount * 99 / 100;
_transfer(from, to, received);
_burn(from, amount - received);
return true;
}
}