Omniscia Native Audit

DeFi Exchange Security Audit

Audit Overview

We were tasked with performing an audit of the Native codebase and in particular their specialized exchange implementation loosely based on the Uniswap V3 paradigm.

Over the course of the audit, we identified multiple vulnerabilities of varying severity, one of which related to the arithmetic model employed by the exchange.

The exchange itself utilizes a recursive model for performing trades which can become inoperable as well as a unique pricing model per token pair.

The latter incorporates an off-chain pricing mechanism into the exchange whereby the orders provided to a particular pool are "trusted" as signed by an off-chain entity.

We advise the Native team to closely evaluate all minor-and-above findings identified in the report and promptly remediate them as well as consider all optimizational exhibits identified in the report.

In order to consider the codebase fully audited, the off-chain pricing capabilities need to be clearly specified via relevant documentation as well as example token pairs and pricing model associations to evaluate that the overall system will behave as the Native team expects it to.

Post-Audit Conclusion

The Native team iterated through all findings within the report and provided us with a revised commit hash to evaluate all exhibits on.

As part of their remediation process, the Native team removed the exactOutput / exactOutputSingle functions from their Router implementation instead supporting only exact input swaps.

We evaluated all alleviations performed by Native and have identified that certain exhibits have not been adequately dealt with. We advise the Native team to revisit the following exhibits: BLB-01C, LGS-01M, RYR-04C, PFY-02C, PLO-02S, PLO-09C, PLO-04S, PLO-03S, PLO-07C

Contracts Assessed

Files in ScopeRepositoryCommit(s)
BytesLib.sol (BLB)native.orgc8653d2041,
e2688efd95
ConstantSumPricer.sol (CSP)native.orgc8653d2041,
e2688efd95
CallbackValidation.sol (CVN)native.orgc8653d2041,
e2688efd95
FullMath.sol (FMH)native.orgc8653d2041,
e2688efd95
GenericERC20.sol (GER)native.orgc8653d2041,
e2688efd95
LowGasSafeMath.sol (LGS)native.orgc8653d2041,
e2688efd95
Multicall.sol (MLL)native.orgc8653d2041,
e2688efd95
NoDelegateCall.sol (NDC)native.orgc8653d2041,
e2688efd95
Order.sol (ORE)native.orgc8653d2041,
e2688efd95
Pool.sol (PLO)native.orgc8653d2041,
e2688efd95
PoolFactory.sol (PFY)native.orgc8653d2041,
e2688efd95
PoolDeployer.sol (PDR)native.orgc8653d2041,
e2688efd95
PeripheryPayments.sol (PPS)native.orgc8653d2041,
e2688efd95
PeripheryValidation.sol (PVN)native.orgc8653d2041,
e2688efd95
PeripheryImmutableState.sol (PIS)native.orgc8653d2041,
e2688efd95
Router.sol (RRE)native.orgc8653d2041,
e2688efd95
Registry.sol (RYR)native.orgc8653d2041,
e2688efd95
SafeCast.sol (SCT)native.orgc8653d2041,
e2688efd95
TransferHelper.sol (THR)native.orgc8653d2041,
e2688efd95
UniswapV2Pricer.sol (UVP)native.orgc8653d2041,
e2688efd95

Audit Synopsis

SeverityIdentifiedAlleviatedPartially AlleviatedAcknowledged
4301
483729
141310
2200
3300

During the audit, we filtered and validated a total of 12 findings utilizing static analysis tools as well as identified a total of 59 findings during the manual review of the codebase. We strongly recommend that any minor severity or higher findings are dealt with promptly prior to the project's launch as they can introduce potential misbehaviours of the system as well as exploits.

The list below covers each segment of the audit in depth and links to the respective chapter of the report: