AlphaHomoraV2 security record

Ethereumhackmd.io

As of 3 Nov 2026, AlphaHomoraV2 has 1 audit report on Trustblock, by Quantstamp, dated 11 Dec 2020. That report lists no open critical findings.

Critical findings
No open critical findings
In 1 report.
Open the latest report
Your label, live
Get the label for your site

Record last updated . It holds audits and findings, contracts and incidents up to Nov 2026. Trustblock does not review code.

Audits1

Newest first

AuditSecurity firmDateScopeCritical findingsReport
AlphaHomoraV2Security firm: QuantstampDate: Scope: Files named in the reportNo open critical findingsOpen · certificate.quantstamp.com

Findings15

Statuses are the security firm’s own, from each report.

SeverityOpenAcknowledgedFixed
Critical000
High004
Medium002
Low144
High[false positive] Missing checks to the health of a position when a borrower is borrowingAlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

`contracts/HomoraBank.sol`: function `borrow` should check that `collateralValue > borrowValue` right after transferring the borrowed token out of the contract.

Open the report
High[false positive] Missing checks to the health of a position when a borrower is withdrawing collateralAlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

`contracts/HomoraBank.sol`: function `takeCollateral` should check `require(collateralValue > borrowValue, 'position still healthy');` right after transferring the collateral out of the contract.

Open the report
HighIncorrect `share` calculation in function `borrow`AlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

`L355` in `contracts/HomoraBank.sol`, should be `amount.mul(totalShare).div(totalDebt)` instead of `amount.mul(totalDebt).div(totalShare)`.

Open the report
HighOracle attack is possible by manipulating a Uniswap poolAlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

Uniswap oracle (https://uniswap.org/docs/v2/core-concepts/oracles/) aggregates prices from all the blocks weighted by block time into cumulative prices whereas Keep3r oracle takes 30-minute samples of Uniswap cumulative prices. The price calculations (i.e., function `price0TWAP` and `price1TWAP`) in `contracts/oracle/BaseKP3ROracle.sol` calculates the sample provided by Keep3r with a last-minute (`now`) spot price from Uniswap. This is fine as long as the accumulation weight is okay, but under heavy congestion and delays the weight (i.e., `timeElapsed` in function `currentPx0Cumu` and `currentPx1Cumu`) can be too big. And together with the (`IUniswapV2Pair(pair).getReserves()`) in `BaseKP3ROracle`, this platform could be attacked by flash loans. Several recent attacks were documented in https://samczsun.com/so-you-want-to-use-a-price-oracle/. **2020-12-18 update**: Alpha team stated that only LP tokens will be used as collateral, so the price data eventually used will not be influenced by a flash-loan attack.

Open the report
MediumFunction `liquidate` never clears up the collateral value in the liquidated positionAlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

In `contracts/HomoraBank.sol`, the function `liquidate` never clears up the collateral value in the liquidated position. With the function `takeCollateral` in its form currently, this could cause fund loss. **2020-12-18 update**: Alpha team enables the function to subtract the collateral value with the bounty provided after a position being liquidated. Quantstamp would like to further suggest to consider to directly assign zero to the collateral value when bounty is larger than the collateral value of a position, in order to avoid unexpected failure of liquidation due to the line `pos.collateralSize = pos.collateralSize.sub(bounty);`. **2021-01-13 update**: this one is fixed in <https://github.com/AlphaFinanceLab/homora-v2/commit/233de49b1e4ec0158861b611de153bf95dcf4aab>.

Open the report
MediumTruncation of fixed-point could result in sensitive collateral liquidation calculationAlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

`contracts/oracle/ProxyOracle.sol`: multiplication is performed after a truncation division in a series of integer calculations. This leads to miscalculation and will lead to a financial loss over time or cause unexpected results. For instance, `contracts/oracle/ProxyOracle.sol`: `L77`, `L89`-`L90`, and `L96`-`L97`. In addition, taking function `asETHCollateral()` as an example: 1. getETHPx() = 100.5 and amount = 0.05. 1. Before truncation = 50.25 1. After truncation = 50.00 1. collateralFactor = 10,000 1. Final value = 50.000 and value lost close to 0.5% from original 50.25 **2020-12-18 update**: Alpha team stated that it is intended. The deviation is bounded by `borrowFactor`/10000 (in wei). The maximum value for `borrowFactor` value will be in the order of 10^6, bounding the error by ~100 wei, which will be less than a block’s interest accrued.

Open the report
LowInteger Overflow / UnderflowAlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

Integer overflow/underflow occur when an integer hits its bit-size limit. Every integer has a set range; when that range is passed, the value loops back around. A clock is a good analogy: at 11:59, the minute hand goes to 0, not 60, because 59 is the largest possible minute. Integer overflow and underflow may cause many unexpected kinds of behavior and was the core reason for the `batchOverflow` attack. Here's an example with `uint8` variables, meaning unsigned integers with a range of `0..255`. ``` function under_over_flow() public { uint8 num_players = 0; num_players = num_players - 1; // 0 - 1 now equals 255! if (num_players == 255) { emit LogUnderflow(); // underflow occurred } uint8 jackpot = 255; jackpot = jackpot + 1; // 255 + 1 now equals 0! if (jackpot == 0) { emit LogOverflow(); // overflow occurred } } ``` `SafeMath` was not enforced for arithmetic operations. This would greatly increase the chances of this dapp having underflow/overflow issues and lead to unexpected results. For instance, in `BaseKP3ROracle.sol`, `L28`, `L32`, `L35`, `L44`, `L48`, `L51`, `L61`, `L62`, and `L73`. **2020-12-18 update**: Alpha team considered there is no need for using library `SafeMath` for the operations pointed out, and the overflow is intended by design. In addition, QuantStamp would also like to point out that `L57` could conceivably overflow in the future (year 2038 problem). **2021-01-13 update**: It is confirmed that for `L55` the `uint32` overflow is an expected behavior. See https://uniswap.org/whitepaper.pdf section 2.2.1 for more details.

Open the report
LowMissing approval in function `setCToken`AlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

`contracts/HomoraBank.sol`: function `setCToken` should `safeApprove` the newly added `cToken`.

Open the report
LowMissing input checksAlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

`contracts/HomoraBank.sol`: function `initialize` should check if `IOracle _oracle` is not `0x0`.

Open the report
LowPotentially high gas usage in `getBorrowETHValue`AlphaHomoraV2 · Quantstamp · 11 Dec 2020Fixed

Potentially high gas usage in `getBorrowETHValue` as the number of banks (i.e., supported tokens) increases. **2020-12-18 update**: Alpha team fixes this issue by using a bitmap to iterate over banks debt.

Open the report

Contracts

No deployed address is recorded for these audits.

The reports name a repository or files. Open a report to see its scope.

The repositories and files the reports name

Show this on your site

Is this your project? Show this record on your own website. The label states what the record holds, links to this page and updates by itself. It is free and needs no sign-in.

Content

Facts

Automatic: the three strongest facts of this project’s own record (its last audit and two more), highlighted. They update with the record. Picking a fact turns Automatic off.

Fixed as
Language

Style

Layout
Theme
Accent
Corners

Format

Size
Date
Embed as
HTML
<head>
<script src="https://widget.trustblock.run/project-widget.min.js" defer></script>
</head>
<body>
<div
data-tb-project-widget
data-tb-project-slug="alphahomorav2"
></div>
</body>

Paste the code where the label should appear. It uses no API credit and updates by itself.

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us