Web3 · Smart Contract Audit

Ternoa Security Audit

softstack completed a smart contract audit of Ternoa's Bridge Relayer in May 2022, reporting 9 findings (2 medium, 5 low and 2 informational), of which 7 were resolved or mitigated before the final report. The full report is published in the softstack public audit archive.

Key facts

Client
Ternoa
Completed
Chains
Ethereum
Languages
TypeScript
Commit
841f6087bd13
Market cap
$818,937 as of 2026-09-30

About the project

Ternoa is a Substrate-based blockchain developed by Capsule Corp and aimed at NFT-driven applications. The chain is designed to store data and transmit it securely to chosen recipients over long periods, including after the owner's death. Its NFTs can hold private data with owner-defined conditions for automated transfer, lending or sharing.

Scope

Source repositorygithub.com/capsule-corp-ternoa/ternoa-bridge-core

Components reviewed

14 modules · 15 files
  1. totalsrc/chains/ethereum/ABIs.ts
  2. src/chains/ethereum/chain.ts
  3. totalsrc/chains/ethereum/connection.ts
  4. src/chains/ethereum/listener.ts
  5. src/chains/ethereum/transaction.ts
  6. src/chains/ethereum/writer.ts
  7. src/chains/substrate/chain.ts
  8. src/chains/substrate/connection.ts
  9. src/chains/substrate/listener.ts
  10. src/chains/substrate/writer.ts
  11. src/utils/blockstore.ts
  12. src/utils/chain-interface.ts
  13. src/utils/core.ts
  14. src/utils/msg.ts

Findings

0Critical
0High
2Medium
5Low
2Informational

7 of 9 findings resolved before the final report.

IDTitleSeverityStatus
6.2.1Parameter Pending Is Missing

getTransactionCount() should have the second parameter set to “pending”. Because the default is “latest” which could result in using a nonce which is in use by a pending transaction.

Mediumfixed
6.2.2No Error Handling For pollBlocks()

If pollBlocks() throws or returns an error, it will just be displayed. There is no error handling to restart pollBlocks() or to exit the process, to have it auto restarted externally. This can lead to bridge errors and outages.

Mediumfixed
6.2.3Incorrect Assertion Of GasPrice And GasLimit

The types of gasPrice and gasLimit should not be asserted to BigNumber. gasPrice and gasLimit should be checked for being undefined and an error should be thrown if they are.

Lowfixed
6.2.4Incorrect Operator Used

An operator defines some function that will be performed on the data. The data on which operators work are called operands. Wrong operators can lead to undefined results.

Lowfixed
6.2.5Feature Chain ID Problems > 255

If originDomainID (chain ID) is greater than 255 the resulting value will be ambiguous for some depositNonce values.

Lowacknowledged
6.2.6Variables Could Be Declared As Constant

Variables can be declared using const similar to var or let declarations. The const makes a variable a constant where its value cannot be changed. Const variables have the same scoping rules as let variables.

Lowfixed
6.2.7Dead Or Commented Out Code

Programmers should not comment out code as it bloats programs and reduces readability.

Lowfixed
6.2.8Parameter Restriction

The parameter “chainName” could be restricted to names of chains that are used to prevent typos on calling the function.

Informationalacknowledged
6.2.9Use Different Method Instead Of cmp()

Certain methods instead of cmp() will improve the code readability

Informationalfixed

About this engagement

A smart contract audit reviews on-chain code for flaws an attacker could exploit. Engineers trace how assets move through the contracts, check who can call privileged functions, and test the arithmetic, external calls and upgrade paths. Each finding is rated by severity, and fixes are re-checked before the final report.

How softstack runs smart contract audits

Methodology

Review process

  1. Scoping and threat modelling

    The commit hash is frozen and the attack surface is mapped: asset flows, trust assumptions, privileged roles and the external systems the code depends on.

  2. Automated analysis

    Static analysers sweep the full codebase to surface known weakness patterns, unreachable states and deviations from established conventions.

  3. Manual code review

    Independent engineers read the code line by line, concentrating on business logic, access control, arithmetic and the handling of external calls.

  4. Adversarial testing

    Property-based fuzzing and invariant tests attack the assumptions the protocol relies on, targeting states that ordinary unit tests never reach.

  5. Reporting

    Every finding is documented with a severity rating, its impact, the steps to reproduce it and a concrete remediation the team can act on.

  6. Remediation verification

    Submitted fixes are re-reviewed against the original finding, and the final report records the resolved state of each one.

Standards and references

  • CWECommon Weakness Enumeration
  • OWASP Top 10The ten most critical web application risks

FAQ

Ternoa was audited by softstack GmbH, a German Web3 security and software company based in Flensburg and certified to ISO/IEC 27001 by TÜV SÜD. softstack completed a smart contract audit for Ternoa in May 2022. The full report is linked on this page and published in the softstack public audit archive.

The review reported 9 findings: 2 medium, 5 low and 2 informational. 7 of 9 were resolved or mitigated before the final report.

15 source files were reviewed in github.com/capsule-corp-ternoa/ternoa-bridge-core at commit 841f608. The published report lists every file covered.

This report covers the code as reviewed in May 2022 at commit 841f608. Any code changed after that point is outside the reviewed scope.

Related audits

Browse all security audits

Disclaimer

This audit represents a point-in-time security assessment of the reviewed codebase and is intended for informational purposes only. While Softstack applies industry-standard security review methodologies, no audit can guarantee the absence of vulnerabilities, bugs, or other security risks. This report does not constitute financial, legal, regulatory, or investment advice, nor does it endorse the project, its business model, products, or services. Security is an ongoing process, and we strongly recommend conducting a new assessment following any material code changes or at least every 6 months to address newly emerging threats, vulnerabilities, and ecosystem developments.