Creating the contract
Import TFHE library:
Defining the ERC20 contract:
Our contract will implement the EIP712WithModifier
interface. The EIP-712 signature is necessary for reencrypt, which is used so that each user can only decrypt their own balance.
State variables:
We want our balances to be encrypted so we define a mapping of the address to an euint32 data type. Initialize state variables for totalSupply, balances, and allowances using encrypted integers (e.g., euint32
for balances)
Last updated