Voltar para Documentação

Docs Técnicas

Error And Diagnostic Surfaces

Errors surface in two prefix families: MP (mempool / pre-ledger validation) and LE (ledger execution). The prefix tells you which component rejected the transaction — you do not need to reach the ledger to get an MP error.

O conteúdo abaixo vem das fontes técnicas do repositório e é prerenderizado no site para leitura direta por pessoas, crawlers e agentes.

Errors surface in two prefix families: MP (mempool / pre-ledger validation) and LE (ledger execution). The prefix tells you which component rejected the transaction — you do not need to reach the ledger to get an MP error.

MP — Mempool and Validation

Rejected before the transaction touches the ledger. Fix the payload and resubmit.

Auth and signature (MP-001 – MP-019)

| Code | Summary | | ---- | ------- | | MP-001 | Amount must be greater than zero | | MP-004 | Public key must be 32 bytes | | MP-006 | Public key derives to a different address than claimed from | | MP-007 | from address must be Bech32 (nbex… / nbhd…) | | MP-010 | Signature must be 64 bytes | | MP-011 | Invalid signature format | | MP-012 | Signature verification failed | | MP-015–019 | Same checks as MP-004–012 but for the fee payer |

Deduplication and nonce (MP-020 – MP-025)

| Code | Summary | | ---- | ------- | | MP-020 | Timestamp out of valid window | | MP-021 | Transaction already committed (replay) | | MP-022 | Mempool full | | MP-023 | Duplicate sender + nonce already pending |

Institutions and KYC (MP-013 – MP-014, MP-027 – MP-039)

| Code | Summary | | ---- | ------- | | MP-013 | Institution ID cannot be nil UUID | | MP-014 | Institution must declare at least one allowed asset | | MP-027–030 | KYC registration: signer/verifier/fee-payer checks | | MP-031–039 | Alias registration: permit, expiry, verifier checks | | MP-062–065 | KYC revocation checks | | MP-066–068 | Reserved sender requires fee-payer handoff |

Contract artifacts and calls (MP-040 – MP-068)

| Code | Summary | | ---- | ------- | | MP-040 | PublishContractArtifact requires artifact_id | | MP-041 | PublishContractArtifact requires source | | MP-042–043 | family_id and version_id cannot be empty | | MP-044 | Memo too long (max 256 bytes) | | MP-045–047 | InstantiateContract requires contract_id and artifact_id | | MP-048 | ContractCall requires contract_id | | MP-049 | Inline source override is no longer supported | | MP-050 | ContractCall requires entrypoint or entrypoint_selector | | MP-051 | ContractCall requires asset | | MP-053–056 | AcceptContractVersion field checks | | MP-057–061 | UpdateContractLifecycle field checks |

ImportContractState (MP-070 – MP-077)

| Code | Summary | | ---- | ------- | | MP-070 | Missing contract_id | | MP-071–072 | field_map.balances and field_map.total_supply cannot be empty | | MP-073 | manifest.origin cannot be empty | | MP-074–075 | Balance entry count: max 5 000, at least one required | | MP-076 | Balance entry address cannot be empty | | MP-077 | Memo too long (max 256 bytes) |

Size limits (MP-100 – MP-115)

| Code | Summary | | ---- | ------- | | MP-104 | Contract source too large for mempool admission | | MP-105–107 | Contract call argument count / size too large | | MP-108–111 | Transaction size or pool byte capacity exceeded | | MP-112–114 | Sender per-sender quota exceeded (tx count or bytes) | | MP-115 | Replacement fee too low for same sender + nonce |

FE — Fee Errors

| Code | Summary | | ---- | ------- | | FE-002 | Insufficient ATLAS balance for fees (amount + fee exceeds available) |

LE — Ledger Errors

LE-* codes are currently scoped by the ledger execution subsystem that emits them. Some historical numeric values are reused between contract execution and posting policy validation. Integrations must retain both the code and its error category/message when classifying a rejection; the numeric suffix alone is not globally unique.

Emitted by the ledger executor after the transaction passes mempool. The contract call was structurally valid but the ledger rejected it.

Auth and signature (LE-001 – LE-013)

| Code | Summary | | ---- | ------- | | LE-001–003 | Sender public key or signature invalid | | LE-004 | System accounts require Admin Key | | LE-005–009 | Fee payer public key, signature, or address checks | | LE-010 | Asset not registered in ledger state | | LE-011–013 | Sender or fee payer auth envelope incomplete |

Nonce (LE-020)

| Code | Summary | | ---- | ------- | | LE-020 | Nonce mismatch — expected sequential nonce |

Accounting engine (LE-030 – LE-042)

| Code | Summary | | ---- | ------- | | LE-030 | Generic accounting engine error | | LE-032 | Unbalanced entry — debit ≠ credit | | LE-040 | Asset not registered in ledger (execution phase) | | LE-041 | Unbalanced posting: net ≠ 0 | | LE-042 | Insufficient funds for account + asset |

Institution and asset registration (LE-050 – LE-088)

| Code | Summary | | ---- | ------- | | LE-050–051 | Registration fee must be paid in ATLAS; minimum 100 ATLAS | | LE-052 | Issuer mismatch (must register assets for own institution) | | LE-053–057 | Asset definition validation: format, JSON, metadata, duplicate | | LE-058–061 | Name, symbol, issuer empty or unauthorized institution | | LE-062 | Vault delegation unauthorized | | LE-070–076 | Delegation, bond, and staking limits and overflows | | LE-077–082 | System params governance: caller, asset, fee field validation | | LE-083–088 | Proposal signature and content validation |

Contracts — artifact and lifecycle (LE-100 – LE-127)

| Code | Summary | | ---- | ------- | | LE-100 | Contract execution target not instantiated | | LE-101 | Contract artifact missing | | LE-104 | Storage restore error | | LE-105 | Contract execution error (TREA runtime failure) | | LE-106 | Inline source override rejected (use published artifact) | | LE-108 | Default artifact missing | | LE-109 | Accepted artifact not published | | LE-110 | Accepted artifact belongs to wrong family | | LE-111 | Incompatible storage layout for upgrade | | LE-112 | Posting bucket not in chart of accounts | | LE-113 | Posting bucket not postable | | LE-114 | Entrypoint selector not found | | LE-115 | Entrypoint name does not match selector | | LE-117 | Caller is not contract admin | | LE-118 | Unsupported contract lifecycle state | | LE-124 | Artifact state rejects new bindings | | LE-125 | Contract lifecycle state blocks governed calls |

Imports and module resolution (LE-101, LE-102, LE-109)

| Code | Summary | | ---- | ------- | | LE-101 | Import path not found in contract registry | | LE-102 | Imported artifact unavailable | | LE-109 | Module parse or flatten error | | LE-110 | Module resolution error | | LE-112 | Resolved artifact belongs to wrong family |

Posting policy (LE-100 – LE-123)

| Code | Summary | | ---- | ------- | | LE-100 | Posting policy: post asset does not match transaction asset | | LE-101 | Post amount invalid | | LE-102 | Contract posting unbalanced | | LE-103 | Unsupported posting bucket | | LE-111 | Operation requires fungible asset | | LE-113 | Posting/context values cannot be persisted in storage | | LE-114 | Asset is non-transferable in this context | | LE-115 | Owner not eligible for posting bucket | | LE-118 | Bucket is product-scoped; cannot use with generic operation kind | | LE-120 | Posting bucket restricted to system holders | | LE-121 | Posting bucket is reserve-restricted | | LE-122 | Bucket requires issuer/client edge | | LE-123 | Posting edge not active for asset + operation |

Cross-contract calls (LE-130 – LE-137)

| Code | Summary | | ---- | ------- | | LE-130 | Cross-contract target not instantiated | | LE-131 | Artifact for cross-contract target not found | | LE-133 | Sub-contract default initialization error | | LE-134 | Sub-contract storage restore error | | LE-135 | Cross-contract call depth limit exceeded | | LE-137 | Cross-contract target does not implement required interface |

ImportContractState (LE-140 – LE-155)

| Code | Summary | | ---- | ------- | | LE-140 | Contract not instantiated | | LE-141 | Only the contract admin may import state | | LE-142 | Contract must be Active lifecycle state | | LE-143 | Contract already has a migration receipt (double-import) | | LE-144 | Duplicate balance address in manifest | | LE-145 | Balance sum overflow | | LE-146 | sum(balances) ≠ total_supply | | LE-147 | Allowances provided but field_map.allowances not set | | LE-148 | Allowance entry count exceeds maximum | | LE-149 | Duplicate allowance pair | | LE-150 | Artifact for contract not found | | LE-152 | field_map.balances field not found or wrong type in contract schema | | LE-153 | field_map.total_supply field not found or wrong type | | LE-154 | field_map.name/symbol/decimals field not found or wrong type | | LE-155 | field_map.allowances field not found or wrong type |

Authoring Diagnostics

Authoring diagnostics are advisory and compiler-backed reports for editor and review workflows. They do not replace verifier or ledger validation.

rust
let report = atlas_trea::analyze_contract_authoring(source)?;
for d in report.diagnostics {
    println!("{:?}: {}", d.severity, d.message);
}

Diagnostics cover:

  • parser and verifier errors;
  • naming style warnings;
  • guard-before-effect discipline;
  • manual loan posting assembly hints;
  • span information when available.

Severity levels: Error, Warning, Info. Only Error blocks publication.