Plain text balances and sepolia reverts mint calls

Hi everyone!

I have successfully deployed an implementation of the ConfidentialERC20Mintable contract (from fhevm-contracts) on the Sepolia Testnet. I am currently interacting with it from the Ethers library (version 6.15.0), which is running on Node.js.

I am using the same account that I have deployed the contract to make the calls. When the GetBalance function is called, the balance of the account is returned correctly but in plain text rather than encrypted. What are the reasons for this? I have encountered the same issue when checking my balance on Etherscan. That is the first question I would like to discuss.

The second issue I am experiencing occurs when I attempt to mint tokens. Please be advised that Sepolia is reverting the transaction with the following error message:

Error: Error: transaction execution reverted (action="sendTransaction", data=null, reason=null, invocation=null, revert=null, transaction={ "data": "", "from": "0x8D9...d3", "to": "0x5c..ce" }, receipt={ "_type": "TransactionReceipt", "blobGasPrice": null, "blobGasUsed": null, "blockHash": "0xa27..e6", "blockNumber": 00000, "contractAddress": null, "cumulativeGasUsed": "24476964", "from": "0x8D9...d3", "gasPrice": "932686919", "gasUsed": "31498", "hash": "0x7af6d0d1aa7299...a1dced099fb840d", "index": 162, "logs": [  ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "root": null, "status": 0, "to": "0x5c..ce" }, code=CALL_EXCEPTION, version=6.15.0)
    at makeError (file:///home/ubuntu/backend/node_modules/ethers/lib.esm/utils/errors.js:132:21)
    at assert (file:///home/ubuntu/backend/node_modules/ethers/lib.esm/utils/errors.js:151:15)
    at checkReceipt (file:///home/ubuntu/backend/node_modules/ethers/lib.esm/providers/provider.js:1127:13)
    at JsonRpcProvider.txListener (file:///home/ubuntu/backend/node_modules/ethers/lib.esm/providers/provider.js:1173:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'CALL_EXCEPTION',
  action: 'sendTransaction',
  data: null,
  reason: null,
  invocation: null,
  revert: null,
  transaction: {
    to: '0x5c..ce',
    from: '0x8D9...d3',
    data: ''
  },
  receipt: TransactionReceipt {
    provider: JsonRpcProvider {},
    to: '0x5c..ce',
    from: '0x8D9...d3',
    contractAddress: null,
    hash: '0x7af6d0d1aa7299a6189446b4827228588771a53daa790d0a3a1dced099fb840d',
    index: 162,
    blockHash: '0xa27..e6',
    blockNumber: 00000,
    logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    gasUsed: 31498n,
    blobGasUsed: null,
    cumulativeGasUsed: 24476964n,
    gasPrice: 932686919n,
    blobGasPrice: null,
    type: 2,
    status: 0,
    root: undefined
  },
  shortMessage: 'transaction execution reverted'

It seems that there is no data in mint transaction, but I do not why. The following code represents the way in which I make the call:

const tx = await contract.mint(signerAddress, 1000, {
gasLimit: 100_000n,
});

Can you help me answer these two questions?

Thank you so much!

Best regards

Hi @diegogvf ! Thank you for your interest in FHEVM.

  • The contract at address

0x5ced0b2558B5C70D8511a155100b29549fF4aCce

has been deployed Aug-25-2025 08:23:48 AM UTC using FHEVM v6. The current version of FHEVM on Sepolia Testnet is v7. Consequently your contract should be recompiled and redeployed using FHEVM v7.
This explains why all your calls to the mint function are automatically reverting (mint is calling the FHE lib under the hood).

Concerning your first question: balanceOf returns a plain text value. It won’t be the case except at init time when the user balance is uninitialized, in such a case the balanceOf function returns 0 which is also the decrypted value of the user (since the user has no token…). In FHE terms, 0 always represents an undefined value. This is different from FHE.asEuint64(0) which also represents 0 but in FHE terms.

Maybe you could have a look at OpenZeppelin Confidential Contracts:

And FHEVM v7

Hope it helps! Don’t hesitate to ask us any additional questions if needed.
Alex - Zama

Hi @AlexB!

Thank you for your comments! Now with the new version I have been able to mint my tokens and view my encrypted balance.

Best regards

Good news! Don’t hesitate to get back to us if you face any FHEVM-related issue!