@@ -4,17 +4,17 @@ pragma solidity 0.8.24;
44import "./ERC20NullOwnerCappedUpgradeable.sol " ;
55import "./libraries/Predeploys.sol " ;
66
7- /// @title FixedFungibleERC20
8- /// @notice ERC-20 clone whose balances are controlled by the FixedFungible protocol handler
9- /// @dev User-initiated transfers/approvals are disabled; only the handler can mutate balances.
10- contract FixedFungibleERC20 is ERC20NullOwnerCappedUpgradeable {
7+ /// @title ERC20FixedDenomination
8+ /// @notice ERC-20 proxy whose supply is managed in a fixed denomination by the manager contract.
9+ /// @dev User-initiated transfers/approvals are disabled; only the manager can mutate balances.
10+ contract ERC20FixedDenomination is ERC20NullOwnerCappedUpgradeable {
1111
1212 // =============================================================
1313 // CONSTANTS
1414 // =============================================================
1515
16- /// @notice The FixedFungible protocol handler that controls this token
17- address public constant protocolHandler = Predeploys.FIXED_FUNGIBLE_HANDLER ;
16+ /// @notice The manager contract that controls this token
17+ address public constant manager = Predeploys.ERC20_FIXED_DENOMINATION_MANAGER ;
1818
1919 // =============================================================
2020 // STATE VARIABLES
@@ -27,28 +27,23 @@ contract FixedFungibleERC20 is ERC20NullOwnerCappedUpgradeable {
2727 // CUSTOM ERRORS
2828 // =============================================================
2929
30- error OnlyProtocolHandler ();
30+ error OnlyManager ();
3131 error TransfersOnlyViaEthscriptions ();
3232 error ApprovalsNotAllowed ();
3333
3434 // =============================================================
3535 // MODIFIERS
3636 // =============================================================
3737
38- modifier onlyProtocolHandler () {
39- if (msg .sender != protocolHandler ) revert OnlyProtocolHandler ();
38+ modifier onlyManager () {
39+ if (msg .sender != manager ) revert OnlyManager ();
4040 _;
4141 }
4242
4343 // =============================================================
4444 // EXTERNAL FUNCTIONS
4545 // =============================================================
4646
47- /// @notice Initialize the ERC20 token
48- /// @param name_ The token name
49- /// @param symbol_ The token symbol
50- /// @param cap_ The maximum supply cap (in 18 decimals)
51- /// @param deployEthscriptionId_ The ethscription ID that deployed this token
5247 function initialize (
5348 string memory name_ ,
5449 string memory symbol_ ,
@@ -60,41 +55,28 @@ contract FixedFungibleERC20 is ERC20NullOwnerCappedUpgradeable {
6055 deployEthscriptionId = deployEthscriptionId_;
6156 }
6257
63- /// @notice Mint tokens (protocol handler only)
64- /// @dev Allows minting to address(0) for null ownership
65- /// @param to The recipient address (can be address(0))
66- /// @param amount The amount to mint (in 18 decimals)
67- function mint (address to , uint256 amount ) external onlyProtocolHandler {
58+ /// @notice Mint tokens (manager only)
59+ function mint (address to , uint256 amount ) external onlyManager {
6860 _mint (to, amount);
6961 }
7062
71- /// @notice Force transfer tokens (protocol handler only)
72- /// @dev Allows transfers to/from address(0) for null ownership
73- /// @param from The sender address (can be address(0))
74- /// @param to The recipient address (can be address(0))
75- /// @param amount The amount to transfer (in 18 decimals)
76- function forceTransfer (address from , address to , uint256 amount ) external onlyProtocolHandler {
63+ /// @notice Force transfer tokens (manager only)
64+ function forceTransfer (address from , address to , uint256 amount ) external onlyManager {
7765 _update (from, to, amount);
7866 }
7967
8068 // =============================================================
8169 // DISABLED ERC20 FUNCTIONS
8270 // =============================================================
8371
84- /// @notice User-initiated transfers are disabled
85- /// @dev All transfers must go through the Ethscriptions NFT
8672 function transfer (address , uint256 ) public pure override returns (bool ) {
8773 revert TransfersOnlyViaEthscriptions ();
8874 }
8975
90- /// @notice User-initiated transfers are disabled
91- /// @dev All transfers must go through the Ethscriptions NFT
9276 function transferFrom (address , address , uint256 ) public pure override returns (bool ) {
9377 revert TransfersOnlyViaEthscriptions ();
9478 }
9579
96- /// @notice Approvals are disabled
97- /// @dev All transfers are controlled by the FixedFungibleProtocolHandler
9880 function approve (address , uint256 ) public pure override returns (bool ) {
9981 revert ApprovalsNotAllowed ();
10082 }
0 commit comments