Skip to main content

Error Codes

This reference documents all error codes returned by ACDC APIs, SDKs, and CLI tools.

JSON-RPC Errors

Standard JSON-RPC 2.0 error codes:

CodeNameDescription
-32700Parse errorInvalid JSON
-32600Invalid requestMissing required fields
-32601Method not foundUnknown RPC method
-32602Invalid paramsInvalid parameter type or value
-32603Internal errorServer-side error

ACDC-Specific RPC Errors

CodeNameDescription
-32000Transaction rejectedTransaction validation failed
-32001Insufficient fundsAccount balance too low
-32002Nonce too lowTransaction nonce already used
-32003Nonce too highGap in transaction nonce sequence
-32004Gas too lowGas limit below minimum
-32005Gas price too lowGas price below network minimum
-32006Execution revertedContract execution failed
-32007Block not foundRequested block does not exist
-32008Transaction not foundRequested transaction does not exist
-32009Account not foundAddress has no on-chain state
-32010Contract errorContract-specific error
-32011Rate limitedToo many requests
-32012Subscription errorWebSocket subscription failed
-32013Proof invalidZK proof verification failed
-32014Record spentAlpha chain record already spent

Transaction Errors

Validation Errors

CodeNameDescriptionResolution
TX_INVALID_SIGNATUREInvalid signatureSignature does not match senderRe-sign transaction
TX_INVALID_NONCEInvalid nonceNonce mismatchGet current nonce
TX_INVALID_GAS_LIMITInvalid gas limitBelow intrinsic gasIncrease gas limit
TX_INVALID_GAS_PRICEInvalid gas priceBelow minimumIncrease gas price
TX_INVALID_VALUEInvalid valueNegative or overflowCheck amount
TX_INVALID_DATAInvalid dataMalformed calldataCheck encoding
TX_INVALID_TOInvalid recipientMalformed addressValidate address
TX_TOO_LARGETransaction too largeExceeds size limitReduce data

Execution Errors

CodeNameDescriptionResolution
EXEC_REVERTExecution revertedContract revertedCheck revert reason
EXEC_OUT_OF_GASOut of gasGas limit exhaustedIncrease gas limit
EXEC_STACK_OVERFLOWStack overflowCall stack too deepReduce call depth
EXEC_INVALID_JUMPInvalid jumpInvalid EVM jumpFix contract code
EXEC_INVALID_OPCODEInvalid opcodeUnknown instructionFix contract code
EXEC_WRITE_PROTECTIONWrite protectionStatic call modified stateUse non-static call

Revert Reasons

When a contract reverts, the reason is included in the error:

{
"code": -32006,
"message": "Execution reverted",
"data": {
"reason": "ERC20: insufficient balance",
"data": "0x08c379a0..."
}
}

Common revert reasons:

ReasonDescription
ERC20: insufficient balanceToken balance too low
ERC20: insufficient allowanceApproval amount too low
Ownable: caller is not ownerNot contract owner
Pausable: pausedContract is paused
ReentrancyGuard: reentrant callReentrancy detected

SDK Errors

TypeScript SDK

import {
AcdcError,
RpcError,
NetworkError,
InvalidAddressError,
InsufficientFundsError,
NonceError,
SignatureError,
TimeoutError
} from '@acdc/sdk';

try {
await client.sendTransaction(tx);
} catch (error) {
if (error instanceof InsufficientFundsError) {
console.log('Need more ACDC');
console.log('Required:', error.required);
console.log('Available:', error.available);
} else if (error instanceof NonceError) {
console.log('Nonce issue:', error.message);
console.log('Expected:', error.expected);
console.log('Got:', error.got);
} else if (error instanceof RpcError) {
console.log('RPC Error:', error.code, error.message);
} else if (error instanceof NetworkError) {
console.log('Network Error:', error.message);
}
}
Error ClassCodeDescription
RpcErrorvariesJSON-RPC error from node
NetworkErrorNETWORK_ERRORConnection failed
TimeoutErrorTIMEOUTRequest timed out
InvalidAddressErrorINVALID_ADDRESSAddress format invalid
InsufficientFundsErrorINSUFFICIENT_FUNDSBalance too low
NonceErrorNONCE_ERRORNonce mismatch
SignatureErrorSIGNATURE_ERRORSigning failed
ContractErrorCONTRACT_ERRORContract call failed

Rust SDK

use acdc_sdk::{AcdcError, RpcError};

match client.send_transaction(tx).await {
Ok(receipt) => println!("Success: {:?}", receipt),
Err(AcdcError::Rpc(RpcError { code, message, .. })) => {
eprintln!("RPC error {}: {}", code, message);
}
Err(AcdcError::InsufficientFunds { required, available }) => {
eprintln!("Need {} but have {}", required, available);
}
Err(AcdcError::Network(e)) => {
eprintln!("Network error: {}", e);
}
Err(e) => eprintln!("Error: {}", e),
}
Error VariantDescription
AcdcError::RpcJSON-RPC error
AcdcError::NetworkConnection error
AcdcError::TimeoutRequest timeout
AcdcError::InvalidAddressAddress invalid
AcdcError::InsufficientFundsBalance too low
AcdcError::SignatureSigning error
AcdcError::AbiABI encode/decode error

CLI Errors

Exit CodeNameDescription
0SuccessCommand completed
1General errorUnspecified error
2Invalid argumentsBad command line args
3Network errorConnection failed
4Transaction errorTransaction failed
5Wallet errorWallet operation failed
6Contract errorContract interaction failed
7Configuration errorBad config file

CLI Error Messages

# Insufficient funds
acdc send --to dx1... --amount 1000000
# Error: Insufficient funds
# Required: 1000000 ACDC
# Available: 100 ACDC
# Exit code: 4

# Invalid address
acdc send --to invalid_address --amount 1
# Error: Invalid address format
# Provided: invalid_address
# Expected: dx1... or ax1...
# Exit code: 2

# Network error
acdc query balance --network mainnet
# Error: Failed to connect to RPC endpoint
# URL: https://delta-rpc.ac-dc.network
# Reason: Connection refused
# Exit code: 3

Alpha Chain Errors

Record Errors

CodeNameDescription
RECORD_NOT_FOUNDRecord not foundRecord does not exist
RECORD_SPENTRecord spentRecord already consumed
RECORD_INVALIDInvalid recordRecord structure invalid
RECORD_MISMATCHRecord mismatchRecord does not match proof

Proof Errors

CodeNameDescription
PROOF_INVALIDInvalid proofZK proof verification failed
PROOF_EXPIREDProof expiredProof timestamp too old
PROOF_MALFORMEDMalformed proofProof structure invalid

View Key Errors

CodeNameDescription
VIEW_KEY_INVALIDInvalid view keyView key format wrong
VIEW_KEY_MISMATCHView key mismatchView key does not match address
DECRYPT_FAILEDDecryption failedCould not decrypt record

Staking Errors

CodeNameDescription
STAKE_INSUFFICIENTInsufficient stakeStake amount below minimum
STAKE_LOCKEDStake lockedStake in unbonding period
VALIDATOR_NOT_FOUNDValidator not foundUnknown validator address
VALIDATOR_INACTIVEValidator inactiveValidator not accepting delegates
VALIDATOR_JAILEDValidator jailedValidator is slashed/jailed
REWARDS_NONENo rewardsNo rewards to claim
UNBONDING_EXISTSUnbonding in progressAlready unbonding

Governance Errors

CodeNameDescription
PROPOSAL_NOT_FOUNDProposal not foundUnknown proposal ID
PROPOSAL_NOT_ACTIVEProposal not activeVoting period ended
PROPOSAL_THRESHOLDBelow thresholdNot enough stake to propose
ALREADY_VOTEDAlready votedCannot vote twice
NO_VOTING_POWERNo voting powerNo staked tokens
INVALID_VOTEInvalid voteVote must be yes/no/abstain

Bridge Errors

CodeNameDescription
BRIDGE_PAUSEDBridge pausedBridge temporarily disabled
BRIDGE_LIMITBridge limitDaily/transaction limit exceeded
BRIDGE_PROOF_INVALIDInvalid proofBridge proof failed
BRIDGE_ALREADY_CLAIMEDAlready claimedTokens already claimed
BRIDGE_NOT_FINALIZEDNot finalizedCross-chain tx not finalized

HTTP Status Codes

REST API responses:

StatusDescription
200Success
400Bad request / Invalid parameters
401Unauthorized / Invalid API key
403Forbidden / Rate limited
404Not found
429Too many requests
500Internal server error
502Bad gateway
503Service unavailable

WebSocket Close Codes

CodeDescription
1000Normal closure
1001Going away
1002Protocol error
1003Unsupported data
1006Abnormal closure
1008Policy violation
1009Message too big
1011Unexpected condition
4000Rate limited
4001Invalid subscription
4002Subscription limit
4003Authentication failed

Debugging Errors

Enable Debug Logging

TypeScript:

const client = new AcdcClient({
chain: 'delta',
network: 'mainnet',
logLevel: 'debug'
});

Rust:

std::env::set_var("RUST_LOG", "acdc_sdk=debug");
let client = AcdcClient::new(Network::DeltaMainnet)?;

CLI:

ACDC_LOG=debug acdc send --to dx1... --amount 1

Get Detailed Error Info

try {
const tx = await signer.sendTransaction(request);
} catch (error) {
if (error.code === 'CALL_EXCEPTION') {
// Get revert reason
const reason = await client.call(request).catch(e => e.reason);
console.log('Revert reason:', reason);

// Simulate to get trace
const trace = await client.debug.traceCall(request);
console.log('Trace:', trace);
}
}