Omniscia 0xPhase Audit

Core Protocol Security Audit

Audit Report Revisions

Commit HashDateAudit Report Hash
3dd3d7bf0cMay 25th 2023a81bb35c28
19668501f8May 27th 20237d92cf96f9
f921b6c4f9May 31st 202366d4a4b03a

Audit Overview

We were tasked with performing an audit of the 0xPhase codebase and in particular their novel collateral-based borrowing system that permits an algorithmic stablecoin to be minted by supplying collateral to the system.

Over the course of the audit, we identified multiple vulnerabilities of varying severity, the most important of which is the capability to force an ill-health / misconfigured credit line to an unsuspecting user.

We advise the 0xPhase 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.

Post-Audit Conclusion

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

We evaluated all alleviations performed by 0xPhase and have identified that certain exhibits have not been adequately dealt with. We advise the 0xPhase team to revisit the following exhibits: CAV-01M, VSF-01M, VBE-01C, VAF-01C

Post-Audit Conclusion (19668501f8)

The 0xPhase team revised their codebase to address the remaining 4 findings. In their revisions, finding CAV-01M was improperly alleviated as it performs the recommended course of action in an incorrect order.

We advise the 0xPhase team to revisit the exhibit and correctly alleviate it.

Post-Audit Conclusion (f921b6c4f9)

The final CAV-01M exhibit has been properly alleviated in the latest iteration by re-ordering the transfer status updates. As a result, all exhibits of the report have been adequately dealt with.

Contracts Assessed

Files in ScopeRepositoryCommit(s)
AccessControl.sol (ACL)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
AccessControlBase.sol (ACB)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
AccessControlFacet.sol (ACF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
AccessControlCutFacet.sol (ACC)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
AdminUpgradeableProxy.sol (AUP)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
BytesLib.sol (BLB)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
CallLib.sol (CLB)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ClockBase.sol (CBE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
CashOracle.sol (COE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
CloneDiamond.sol (CDD)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
CreditAccountV1.sol (CAV)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ChainlinkOracleV1.sol (COV)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
DBV1.sol (DBV)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
DebtLib.sol (DLB)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
Diamond.sol (DDN)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
DiamondLib.sol (DLI)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
DiamondLoupeFacet.sol (DLF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
Element.sol (ETN)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ERC20Base.sol (ERC)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ERC20Facet.sol (ERF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ElementBase.sol (EBE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ElementFacet.sol (EFT)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
EIP712Upgradeable.sol (EIP)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ERC20VotesUpgradeable.sol (ERV)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ERC20PermitUpgradeable.sol (ERP)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
FixedOracle.sol (FOE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
FixedRateInterest.sol (FRI)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
IDB.sol (IDB)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
IVault.sol (IVT)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
IPegToken.sol (IPT)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ITreasury.sol (ITY)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ISystemClock.sol (ISC)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ICreditAccount.sol (ICA)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
IChainlinkOracle.sol (ICO)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
Manager.sol (MRE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
MathLib.sol (MLB)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
MasterOracle.sol (MOE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
MulticallFacet.sol (MFT)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
OwnableBase.sol (OBE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
OwnableFacet.sol (OFT)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
OwnableCutFacet.sol (OCF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
Proxy.sol (PYX)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
PegTokenV1.sol (PTV)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ProxyOwnable.sol (POE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ProxyInitializable.sol (PIE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
SlotLib.sol (SLB)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
ShareLib.sol (SLI)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
SimpleProxy.sol (SPY)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
SystemClockV1.sol (SCV)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
StorageUpgradeableProxy.sol (SUP)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
TreasuryV1.sol (TV1)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
VaultBase.sol (VBE)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
VaultConstants.sol (VCS)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
VaultInitializer.sol (VIR)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
VaultGettersFacet.sol (VGF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
VaultSettersFacet.sol (VSF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
VaultAccountingFacet.sol (VAF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
VaultLiquidationFacet.sol (VLF)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9
WETHAdapter.sol (WET)contracts2ccd464158,
3dd3d7bf0c,
19668501f8,
f921b6c4f9

Audit Synopsis

SeverityIdentifiedAlleviatedPartially AlleviatedAcknowledged
7502
434300
181800
8800
111100

During the audit, we filtered and validated a total of 11 findings utilizing static analysis tools as well as identified a total of 76 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: