feat: add V1 custody accounting

This commit is contained in:
golem
2026-08-17 17:10:35 -06:00
parent 0664eb4688
commit 2a21766237
4 changed files with 490 additions and 0 deletions
+26
View File
@@ -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;
}
}