This document provides concrete JSON payload examples for downstream clients (SDKs and dashboards) interacting with the ZK Payroll contracts. These samples reduce ambiguity in serialization and event consumption.
These represent the arguments passed to Soroban contract invocations. Depending on the SDK (e.g., soroban-cli or JS SDK), arguments might be passed as JSON arrays or objects. The examples below show the logical JSON representations of the arguments.
Stores a new salary commitment for an employee.
{
"employee": "GB7TAYRUZGE6TVT7NHP5SMIZRNQA6UJWEHLVDJLSB3C0S...",
"commitment": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}(Note: BytesN<32> is often represented as a hex string in higher-level SDKs.)
Executes a single payroll payment.
{
"company_id": 1,
"employee": "GB7TAYRUZGE6TVT7NHP5SMIZRNQA6UJWEHLVDJLSB3C0S...",
"amount": 5000,
"proof_a": "0x...",
"proof_b": "0x...",
"proof_c": "0x...",
"nullifier": "0x...",
"period": 1
}Executes a batch payroll payment.
{
"company_id": 1,
"employees": [
"GB7TAYRUZGE6TVT7NHP5SMIZRNQA6UJWEHLVDJLSB3C0S...",
"GA2C5QQZAOWTJJFFAQ44XQR5A2RIV5C2P4XQ..."
],
"amounts": [5000, 6500],
"proofs_a": ["0x...", "0x..."],
"proofs_b": ["0x...", "0x..."],
"proofs_c": ["0x...", "0x..."],
"nullifiers": ["0x...", "0x..."],
"period": 1
}These represent the event data emitted by the contracts and indexed by downstream consumers.
Topics:
"CommitmentUpdated"(Symbol)employee(Address)
Data:
[
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
](Tuple containing the new commitment BytesN<32>)
Topics:
"PayrollProcessed"(Symbol)company_id(u64)
Data:
[
"GB7TAYRUZGE6TVT7NHP5SMIZRNQA6UJWEHLVDJLSB3C0S...",
5000,
1
](Tuple containing employee (Address), amount (i128), and period (u32))
Topics:
"PeriodCreated"(Symbol)company_id(u64)
Data:
[
2
](Tuple containing next_id (u32))
To maintain consistency as the contract API evolves:
- Always update this document alongside any pull request that modifies
#[contracttype]structs, entrypoint signatures, orenv.events().publish()calls. - Ensure that integration tests output or validate against these exact JSON structures where possible.
- If new data types are introduced (e.g., nested structs), add a representative sample here with all fields fully populated.