Error codes
This section contains a list of all possible errors that might occur while using
import { Unirep } from '@unirep/contracts/Unirep.sol';
info
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)
0x099cfcff
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.
0x6767dda1
AttesterAlreadySignUp(uint160 attester)
The attester has already signed up in the current Unirep contract.
An attester cannot double sign-up in the Unirep protocol.
0xd724105a
AttesterNotSignUp(uint160 attester)
The attester has not signed up in the current Unirep contract.
Please callattesterSignUp()
0xd7aa5847
AttesterInvalid()
The givein attester address is not a validuint160
type data.
Please check if the attester address is correctly assigned while generating proofs.
0x4ae5505e
ProofAlreadyUsed(bytes32 nullilier)
The proof is already used in Unirep contract.
A proof cannot be submitted twice in the Unirep protocol. This is used to prevent replay attack.
0xdc215c0a
NullifierAlreadyUsed(uint256 nullilier)
The nullifier is already used in Unirep contract.
A nullifier cannot be submitted twice in the Unirep protocol.
0xedc650d7
AttesterIdNotMatch(uint160 attesterId)
Themsg.sender
does not match the claimed attester ID.
Please send the transaction through the attester.
0x8baa579f
InvalidSignature()
The signature does not match the attester ID.
Please make sure the signature is signed through the correct attester.
0x2217bbbc
InvalidEpochKey()
The max epoch key is computed byThe epoch key which is greater than this range is recognized invalid.uint256 maxEpochKey = uint256(config.epochTreeArity) ** config.epochTreeDepth - 1;
Please check if the contract configsmaxEpochKey()
,epochTreeArity()
andepochTreeDepth()
match the circuit configs.
0x53d3ff53
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.
0xa225656d
InvalidEpoch(uint256 epoch)
The epoch in the proof is greater than the current epoch.
Please check the current epoch and generate a corresponding proof.
0x09bde339
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.
0xf1b8a45e
InvalidStateTreeRoot(uint256 stateTreeRoot)
The state tree root of given epoch does not exist in the current Unirep contract.
There are several reasons:- The user does not sign up successfully
- The user does not perform user state transition successfully
userSignUp
transaction oruserStateTransition
transaction is pending- Epoch and state tree root does not match
0xfa2e644d
InvalidEpochTreeRoot(uint256 epochTreeRoot)
The epoch tree root of given epoch does not match the current Unirep contract.
Please check if all attestations are processed correctly and successfully.
0x39b6da94
EpochNotSealed()
The epoch a user is attempting to transition from has not been sealed.
0x997bdc87
DoubleSeal()
ThesealEpoch
can only be called once. See epoch transition.
0x3fbcde72
IncorrectHash()
The circuit should output the polysum that matches the on-chain polysum.
If the error occurs, please check if the off-chain attestations matches the on-chain attestations.
0x74d1bcdc
MaxAttestations()
The epoch tree can only storetree_arity ** tree_degree - 3
epoch keys per attester per epoch. See also build ordered tree.
There is no more new epoch keys that can receive attestations. Users should wait until the next epoch and then generate a new epoch key to receive attestations.
0xef32b8ef
NoAttestations()
If there is no attestations in an epoch, thesealEpoch
cannot be executed. Users can perform user state transition withoutsealEpoch
and then move on to the new epoch.
0x7db3aba7
OutOfRange()
A replacement field data cannot be out ofSNARK_SCALAR_FIELD
.
Please use a value which is less thanSNARK_SCALAR_FIELD
.
0x7fa0b337
InvalidField()
An attestation was made to a field that was either out of range, or not capable of receiving attestations.