Deployment Issues
Contract Deployment Fails
Symptoms: Deployment script fails with error or timeout Common Causes:-
Missing Environment Variables
-
Insufficient Gas
- Solution: Increase gas limit in
hardhat.config.ts - Check current network gas prices
- Solution: Increase gas limit in
-
Network Connection Issues
- Verify RPC endpoint is accessible
- Try alternative RPC provider (Alchemy, Infura)
-
Nonce Mismatch
Deployment Scripts Skip Unexpectedly
Symptoms: Some deployment scripts don’t execute Solution: Check thefunc.skip condition in deployment files. Many scripts are frozen in production:
15_configure_v2_payment_methods.ts.
Contract Verification Fails
Symptoms: Etherscan/Basescan verification returns error Solutions:-
Check API Key:
-
Wait for Block Confirmations:
-
Manual Verification:
- Use Basescan GUI with flattened contract
- Ensure compiler version matches
hardhat.config.ts
Payment Verification Issues
Payment Proof Verification Fails
Symptoms:fulfillIntent() reverts with verification error
Common Errors:
“UPV: Invalid payment method”
Cause: Payment method not registered with UnifiedPaymentVerifier Solution:contracts/unifiedVerifier/UnifiedPaymentVerifier.sol:142
”UPV: Invalid attestation”
Cause: EIP-712 signature verification failed Solutions:-
Check Witness Signer:
-
Verify Domain Separator:
-
Check Data Hash Integrity:
contracts/unifiedVerifier/UnifiedPaymentVerifier.sol:183-214
”UPV: Snapshot hash mismatch”
Cause: Intent snapshot doesn’t match on-chain intent Solution: Ensure all intent fields match:contracts/unifiedVerifier/UnifiedPaymentVerifier.sol:220-234
”UPV: Snapshot timestamp buffer exceeds maximum”
Cause: Timestamp buffer exceeds 48-hour maximum Solution:contracts/unifiedVerifier/UnifiedPaymentVerifier.sol:31
”UPV: Data hash mismatch”
Cause: Signed data hash doesn’t match actual data Solution:contracts/unifiedVerifier/UnifiedPaymentVerifier.sol:202-205
Nullifier Already Used
Symptoms: Transaction reverts with nullifier error Cause: Payment ID has already been used (double-spend prevention) Explanation: Nullifiers are created as:keccak256(abi.encodePacked(paymentMethod, paymentId))
Each payment can only be used once across the entire protocol.
Solution:
- If legitimate retry: Use a different payment (new payment ID)
- If testing: Deploy fresh contracts or use different payment IDs
- In production: This is expected behavior - find the original intent that used this payment
contracts/unifiedVerifier/UnifiedPaymentVerifier.sol:242-245
Payment Method Not Found in Registry
Symptoms:signalIntent() reverts with payment method error
Cause: Payment method not registered in PaymentVerifierRegistry
Solution:
Intent Lifecycle Issues
Cannot Signal Intent
Symptoms:signalIntent() reverts
Common Causes:
Insufficient Deposit Liquidity
Amount Below Minimum
Deposit Expired
Invalid Gating Signature
Cannot Fulfill Intent
Symptoms:fulfillIntent() reverts
Common Causes:
Intent Expired
Wrong Intent State
Payment Verification Failed
See Payment Verification Issues section above.Cannot Cancel Intent
Symptoms:cancelIntent() reverts
Cause: Intent not yet expired or already fulfilled
Solution:
Testing Issues
Tests Fail with Timeout
Symptoms: Tests hang or timeout Solutions:-
Increase Timeout:
-
Use Fast Tests:
-
Run Specific Suite:
Mock Contract Issues
Symptoms: Mock contracts behave unexpectedly Solution: Check mock configuration in test setupFoundry Tests Fail
Symptoms:yarn test:forge fails
Solutions:
-
Update Foundry:
-
Clean Cache:
-
Check Remappings:
Integration Issues
TypeScript Type Errors
Symptoms: TypeScript compilation errors with contract types Solution: Regenerate Typechain bindingstypechain/ directory.
Contract Address Not Found
Symptoms: Cannot find deployed contract address Solution: Check deployment artifactsdeployments/{network}/.
Event Parsing Fails
Symptoms: Cannot parse contract events Solution: Use correct event filter and parsingGas Estimation Fails
Symptoms: Transaction reverts during gas estimation Solutions:-
Simulate Transaction:
-
Manual Gas Limit:
Registry Permission Issues
”Caller is not owner”
Symptoms: Registry modification reverts with ownership error Cause: Only owner can modify registries Solution:“Caller does not have write permission”
Symptoms: Cannot write to NullifierRegistry Cause: UnifiedPaymentVerifier needs write permission Solution:01_deploy_unified_verifier.ts for setup example.
Network-Specific Issues
Base Network Issues
High Gas Prices
Solution: Wait for lower gas prices or increase gas budgetRPC Rate Limiting
Solution: Use dedicated RPC provider or implement retry logicBase Sepolia (Testnet) Issues
Insufficient Test ETH
Solution: Get test ETH from Base Sepolia faucetTest USDC Not Available
Solution: Deploy mock USDC for testingBuild & Compilation Issues
Compilation Fails
Symptoms:yarn compile fails with Solidity errors
Solutions:
-
Clean Build:
-
Check Solidity Version:
- Contracts require Solidity ^0.8.18
- Verify
hardhat.config.tscompiler version
-
Missing Dependencies:
Module Not Found
Symptoms: Import errors in TypeScript files Solution: Check module aliases intsconfig.json
Performance Issues
Slow RPC Responses
Solutions:-
Use Protocol Viewer: Batch queries instead of individual calls
- Cache Results: Store frequently accessed data locally
- Use Multicall: Batch multiple read operations
High Transaction Costs
Solutions:- Optimize Data: Minimize data in transactions
- Use Relayers: For gasless transactions (configure RelayerRegistry)
- Batch Operations: Combine multiple actions when possible
Getting More Help
If you’re still experiencing issues:- Check Test Files: See
test/for working examples - Review Deployment Scripts: See
deploy/for configuration examples - Read Contract Comments: Contracts have extensive NatSpec documentation
- Check GitHub Issues: zkp2p-v2-contracts issues
- Ask the Community: Visit zkp2p.xyz for community links