Skip to main content
Version: next

Error codes

This section contains a list of all possible errors that might occur while using

import { Unirep } from '@unirep/contracts/Unirep.sol';

When developing with hardhat environment, these custom errors can be seen in the _selector:

Error: cannot estimate gas; transaction may fail or may require manual gas limit
{"type":18,"address":{"type":"Buffer","data":[183,248,188,99,187,202,209,129,85,32,19,8,200,243,84,11,7,248,79,94]},"message":{"value":{"type":"Buffer","data":[103,103,221,161,0,0,0,0,0,0,0,0,0,0,0,0,165,28,31,194,240,209,161,184,73,78,209,254,49,45,124,58,120,237,145,192]},"_selector":"6767dda1"},"isInvalidOpcodeError":false}],"data":"0x6767dda1000000000000000000000000a51c1fc2f0d1a1b8494ed1fe312d7c3a78ed91c0"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)


  • UserAlreadySignedUp(uint256 identityCommitment)
    The given identity commitment has already signed up in the current Unirep contract.
    A user cannot double sign-up in an application.


  • AttesterAlreadySignUp(uint160 attester)
    The attester has already signed up in the current Unirep contract.
    An attester cannot double sign-up in the Unirep protocol.


  • AttesterNotSignUp(uint160 attester)
    The attester has not signed up in the current Unirep contract.
    Please call attesterSignUp()


  • AttesterInvalid()
    The given attester address is not a valid uint160 type data.
    Please check if the attester address is correctly assigned while generating proofs.


  • CallerInvalid()
    The caller address is not the same as the attester address in a proof verification contract.
    Please verify the caller address.


  • NullifierAlreadyUsed(uint256 nullilier)
    The nullifier is already used in Unirep contract.
    A nullifier cannot be submitted twice in the Unirep protocol.


  • AttesterIdNotMatch(uint160 attesterId)
    The msg.sender does not match the claimed attester ID.
    Please send the transaction through the attester.


  • OutOfRange()
    A replacement field data cannot be out of SNARK_SCALAR_FIELD.
    Please use a value which is less than SNARK_SCALAR_FIELD.


  • InvalidField()
    An attestation was made to a field that was either out of range, or not capable of receiving attestations.



  • InvalidSignature()
    The signature does not match the attester ID.
    Please make sure the signature is signed through the correct attester.


  • InvalidEpochKey()
    If The epoch key is greater than SNARK_SCALAR_FIELD is recognized invalid.


  • EpochNotMatch()
    Current epoch does not match the epoch in the proof or the target epoch.
    Please check the current epoch and generate a corresponding proof.


  • InvalidEpoch(uint256 epoch)
    The epoch in the proof is greater than the current epoch.
    Please check the current epoch and generate a corresponding proof.


  • InvalidProof()
    The proof is verified invalid through on-chain verifiers.
    Please verify it with the off-chain prover.
    If it is valid off-chain but invalid through on-chain verifiers, please check the if the proving keys match the ones on-chain.


  • InvalidStateTreeRoot(uint256 stateTreeRoot)
    The state tree root of given epoch does not exist in the current Unirep contract.
    There are several reasons:
    1. The user does not sign up successfully
    2. The user does not perform user state transition successfully
    3. userSignUp transaction or userStateTransition transaction is pending
    4. Epoch and state tree root does not match


  • InvalidHistoryTreeRoot(uint256 historyTreeRoot)
    The epoch tree root of given epoch does not match the current Unirep contract.
    Please check if all attestations are processed correctly and successfully.