Skip to main content

Events and Errors

Reference for all runtime events and errors in Orbinum pallets.


Table of Contents


Shielded Pool

Events

Shielded

Emitted when tokens are shielded (deposited to pool).

Shielded {
sender: AccountId,
commitment: [u8; 32],
value: Balance,
}
FieldTypeDescription
senderAccountIdAccount that shielded tokens
commitment[u8; 32]Note commitment added to tree
valueBalanceAmount shielded

PrivateTransfer

Emitted when a private transfer is executed.

PrivateTransfer {
nullifiers: Vec<[u8; 32]>,
commitments: Vec<[u8; 32]>,
}
FieldTypeDescription
nullifiersVec<[u8; 32]>Spent note nullifiers
commitmentsVec<[u8; 32]>New note commitments

Unshielded

Emitted when tokens are unshielded (withdrawn from pool).

Unshielded {
recipient: AccountId,
nullifier: [u8; 32],
value: Balance,
}
FieldTypeDescription
recipientAccountIdAccount receiving tokens
nullifier[u8; 32]Spent note nullifier
valueBalanceAmount unshielded

Errors

ErrorDescription
InsufficientBalanceAccount has insufficient public balance to shield
InvalidProofZK proof verification failed
NullifierAlreadySpentNullifier has already been used (double-spend attempt)
InvalidMerkleRootMerkle root not found in historic roots
PoolOverflowShielding would exceed pool capacity
PoolUnderflowInsufficient pool balance for unshield
InvalidCommitmentCommitment format invalid
TreeFullMerkle tree has reached maximum capacity

ZK Verifier

Events

ProofVerified

Emitted when a proof is successfully verified.

ProofVerified {
circuit_id: CircuitId,
verifier: AccountId,
}
FieldTypeDescription
circuit_idCircuitIdCircuit that was verified
verifierAccountIdAccount that submitted proof

VerificationKeyRegistered

Emitted when a new verification key is registered.

VerificationKeyRegistered {
circuit_id: CircuitId,
registrar: AccountId,
}
FieldTypeDescription
circuit_idCircuitIdCircuit ID for the key
registrarAccountIdAccount that registered key

VerificationKeyUpdated

Emitted when a verification key is updated.

VerificationKeyUpdated {
circuit_id: CircuitId,
updater: AccountId,
}

Errors

ErrorDescription
InvalidProofProof does not verify against verification key
CircuitNotFoundNo verification key registered for circuit
InvalidPublicInputsPublic inputs count or format incorrect
ProofTooLargeProof exceeds maximum size
CircuitAlreadyRegisteredCircuit ID already has a verification key
UnauthorizedKeyUpdateCaller not authorized to update key

EVM

Events

Created

Emitted when a contract is deployed.

Created {
address: H160,
}
FieldTypeDescription
addressH160Deployed contract address

CreatedFailed

Emitted when contract deployment fails.

CreatedFailed {
address: H160,
}

Executed

Emitted when a transaction is executed.

Executed {
address: H160,
}

ExecutedFailed

Emitted when transaction execution fails.

ExecutedFailed {
address: H160,
}

Log

Emitted for EVM logs (events from contracts).

Log {
log: Log,
}

Errors

ErrorDescription
BalanceLowInsufficient balance for transaction
FeeOverflowFee calculation overflow
PaymentOverflowPayment calculation overflow
WithdrawFailedFailed to withdraw from sender
GasPriceTooLowGas price below minimum
InvalidNonceTransaction nonce incorrect
GasLimitTooLowGas limit insufficient
GasLimitTooHighGas limit exceeds block limit
InvalidChainIdTransaction chain ID mismatch
InvalidSignatureTransaction signature invalid
ReentrancyReentrant call detected

Ethereum

Events

Executed

Emitted when an Ethereum transaction is executed.

Executed {
from: H160,
to: H160,
transaction_hash: H256,
exit_reason: ExitReason,
extra_data: Vec<u8>,
}
FieldTypeDescription
fromH160Sender address
toH160Recipient address
transaction_hashH256Transaction hash
exit_reasonExitReasonExecution result
extra_dataVec<u8>Additional data

Exit Reasons

ReasonDescription
Succeed(Stopped)Execution completed
Succeed(Returned)Returned data
Revert(Reverted)Transaction reverted
Error(OutOfGas)Ran out of gas
Error(InvalidCode)Invalid EVM opcode
Fatal(CallErrorAsFatal)Fatal call error

System Events

ExtrinsicSuccess

Transaction executed successfully.

ExtrinsicSuccess {
dispatch_info: DispatchInfo,
}

ExtrinsicFailed

Transaction execution failed.

ExtrinsicFailed {
dispatch_error: DispatchError,
dispatch_info: DispatchInfo,
}

Common Dispatch Errors

ErrorDescription
BadOriginInvalid origin for call
CannotLookupFailed to lookup account
ModulePallet-specific error
Token(NoFunds)Insufficient balance
ArithmeticArithmetic error (overflow/underflow)

Listening for Events

Using Polkadot.js

const { ApiPromise, WsProvider } = require('@polkadot/api');

async function listenEvents() {
const api = await ApiPromise.create({
provider: new WsProvider('ws://localhost:9944')
});

api.query.system.events((events) => {
events.forEach(({ event }) => {
const { section, method, data } = event;

console.log(`${section}.${method}:`, data.toString());

// Handle specific events
if (section === 'shieldedPool' && method === 'Shielded') {
const [sender, commitment, value] = data;
console.log('Shielded:', {
sender: sender.toString(),
commitment: commitment.toHex(),
value: value.toString()
});
}
});
});
}

Using Ethers.js (EVM Events)

const { ethers } = require('ethers');

async function listenLogs() {
const provider = new ethers.JsonRpcProvider('http://localhost:9944');

// Subscribe to contract events
const filter = {
address: '0x1234...',
topics: [ethers.id('Transfer(address,address,uint256)')]
};

provider.on(filter, (log) => {
console.log('Transfer event:', log);
});
}