Reproduced Exploit
DayContract / Polarx — Spot Manip + Rigid Principal Guarantee
DayContract.deposit converts USDT → LP via Pancake spot reserves (no TWAP). withdraw always calls vault.settlePrincipal(user, fullPrincipal, 0), and the vault’s _ensureUSDTBalance redeems shared vault LP until it can pay that principal — regardless of the order’s own post-manipulation NAV.
Loss
~$10.6K attacker profit; ~$29.7K protocol insolvency
Chain
BNB Chain
Category
oracle
Date
Mar 2026
Source
DeFiHackLabs
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.
Source & credit. Exploit reproduction, trace data, and analysis adapted from DeFiHackLabs by SunWeb3Sec — an open registry of reproduced on-chain exploits. Standalone Foundry PoC and full write-up: 2026-03-DayContract_exp in the
evm-hack-registrymirror. Upstream DeFiHackLabs PoC:src/test/…/DayContract_exp.sol.
Vulnerability classes: vuln/oracle/price-manipulation · vuln/logic/missing-check
Reproduction: Foundry PoC in this project folder — ONLINE BSC archive fork. Verbose run: output.txt. Sources: sources/DayContract.sol, sources/SettlementVault.sol.
Key info#
| Loss | ~$10.6K attacker profit; ~$29.7K protocol insolvency |
| Vulnerable contract | DayContract — 0x587984549f7e61c0ed8131b1f6614f592573a43c |
| SettlementVault | 0x66426a835c71c20ac222c8441117f78aa8f2ff12 |
| PSTAR token | 0xa0d94224e5434471638b82985af61b79109e09f5 |
| PSTAR/USDT pair | 0x3f7b54e8b46b8a0780628a2361dcd9c3873fa9d9 |
| Attacker EOA | 0xf25d6a026c7853829e7cd5e98cd958a5a41be5e8 |
| Attack contract | 0x0e59d33cc16b5d660725869c29bc26562c9975f1 |
| Attack tx | 0xf3b8ceae…91755e7 |
| Chain / block / date | BSC / 89,610,264 (fork at 89,610,263) / Mar 30, 2026 |
| Bug class | Spot-priced LP mint + unconditional principal settlement on shared vault LP |
TL;DR#
DayContract.deposit converts USDT → LP via Pancake spot reserves (no TWAP).
withdraw always calls vault.settlePrincipal(user, fullPrincipal, 0), and the vault’s
_ensureUSDTBalance redeems shared vault LP until it can pay that principal —
regardless of the order’s own post-manipulation NAV.
Attacker flow (atomic):
- Flash/deal ~2.04M USDT; deploy 38 registered helpers.
- Two fair deposits of 1,000 USDT.
- Buy ~2M USDT of PSTAR → spike spot.
- 36 more 1,000 USDT deposits at inflated spot (sandwich meat + overvalued LP receipts).
- Dump PSTAR → ~2.01M USDT back (manip profit from deposit-side buys/liquidity).
- Withdraw all 38 orders → each gets full 1,000 USDT principal paid by draining shared LP.
PoC profit ~10,655 USDT (matches ExVul ~$10.6K).
Vulnerable code#
Spot LP mint (sources/DayContract.sol)#
function deposit(uint256 amount) external nonReentrant {
// ...
uint256 lpReceived = _convertToLP(amount); // spot reserves only
// store order.principal = amount (USDT face value)
vault.receiveLP(msg.sender, orderId, lpReceived);
vault.increaseDeposit(msg.sender, amount);
}
Rigid principal (sources/DayContract.sol + vault)#
function withdraw(uint256 orderId) external nonReentrant {
// ...
vault.redeemLP(msg.sender, orderId); // may yield ≪ principal after dump
// ...
vault.settlePrincipal(msg.sender, returnAmount, 0); // returnAmount ≈ full principal
}
// SettlementVault
function settlePrincipal(...) external onlyAuthorized {
_ensureUSDTBalance(principal); // redeems SHARED vault LP until balance ≥ principal
usdt.transfer(user, returnAmount);
}
Attack flow#
PoC notes#
- ONLINE:
BSC_RPC_URL=... forge test --match-contract DayContract_exp -vv --gas-limit 100000000 - Capital via
deal(live: Moolah flash loan). - Referral sponsor: live depositor
0xB08d…bF58. - Offline
anvil_state.jsonnot shipped (large state; ONLINE only).
References#
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 2026-03-DayContract_exp (evm-hack-registry mirror).
- Upstream DeFiHackLabs PoC:
DayContract_exp.sol. - Attack transaction: view on explorer.
Alerts & third-party analyses
- Original alert / thread: post on X.
- DeFiHackLabs incident explorer: search "DayContract / Polarx".
- Web3Sec X hacked database: search.
- Rekt leaderboard: search.
- Solodit incident search: search.
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.