three sigma logo
Ojo Network

Code Audit

Ojo Network

A decentralized network providing AI-driven data privacy and secure computations.

Blockchain security isn't optional.

Protect your smart contracts and DeFi protocols with Three Sigma, a trusted security partner in blockchain audits, smart contract vulnerability assessments, and Web3 security.

Get a Quote Today

Introduction

Ojo built a time-weighted-average-price (TWAP) oracle that converts Pendle Principal Tokens (PT) to their underlying asset. The contract surfaces prices in Morpho’s standard oracle interface so PT collateral can plug directly into Morpho markets.

Why Did They Need an Audit?

If the oracle mis-scales decimals or reads stale data, Morpho would mis-price PT collateral. Ojo asked Three Sigma for a one-day security sweep focused on:

  • correct decimal handling for Pendle markets,
  • safe deployment/initialisation checks,
  • robust access control on owner-only functions.

Scope of the Engagement

  • File audited: OjoPTOraclePriceAdapter.sol
  • Team: 1 auditor - 1 day
  • Chain: Ethereum

Audit Date: 2024-12-06

Language: Solidity

Type: Code Audit

Results and Findings

Informational Suggestions

Enforce 18-decimals markets

  • Description: The adapter assumes the PT market mints tokens with 18 decimals. Pendle could, in theory, list markets with a different precision.
  • Resolution: The constructor now queries market.decimals() and reverts unless the value equals 18 (commits 1b9e9ed, b216be3, e64e52a).

Ensure Pendle oracle is initialised

  • Description: getPtToAssetRate() reverts inside Pendle’s oracle if the TWAP hasn’t been bootstrapped with at least one update. Deploying the adapter against an un-initialised oracle would brick price queries.
  • Resolution: A pre-flight check verifies the Pendle oracle’s initialisation flag at deployment and reverts otherwise (same commits as above).

Severity Issues

critical
high

0

informational

2

medium

0

low

0

Audit Period

1 Day

Report

In conclusion

Three Sigma’s rapid assessment uncovered no security vulnerabilities; only two defensive checks were recommended and implemented. With decimal-validation and oracle-initialisation guards in place, Ojo’s PT TWAP feed is ready for production use in Morpho markets.

Secure Your Crypto Project Before It’s Too Late. Get in Touch Today.

Get a Quote Today