feat: add V1 custody accounting
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user