fhenix-confidential-erc20-operators
Installation
SKILL.md
Fhenix Confidential ERC20 Operators
Overview
Traditional approve(spender, amount) leaks the approved amount — useless for confidential tokens. FHERC20 replaces it with operators: a holder grants an address full move-access until an expiration timestamp, revealing no amount.
function setOperator(address operator, uint48 until) external; // grant/extend/revoke
function isOperator(address holder, address spender) external view returns (bool);
function confidentialTransferFrom(address from, address to, InEuint64 memory inValue) external returns (euint64);
Setting / revoking (uint48 unix seconds)
token.setOperator(dex, uint48(block.timestamp + 1 hours)); // grant 1h
token.setOperator(dex, uint48(block.timestamp)); // revoke now (expire)
token.setOperator(dex, type(uint48).max); // indefinite (year 8921556) — avoid
isOperator returns _operators[holder][spender] >= block.timestamp — permissions auto-expire, no gas-costly revocation needed.