Reproduced Exploit
CWBC — Arkouda.claimReward mints before rewardGenerationStartTime is set
Chain
Other
Category
logic
Date
Feb 2022
Source
AuditVault
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, Balances (native / ERC-20 / NFT), 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. Reproduction of a public audit finding curated by AuditVault — the original finding: 56419-user-can-claim-rewards-before-the-start-zokyo-none-cwbc-mark. Standalone Foundry PoC and full write-up: 56419-user-can-claim-rewards-before-the-start-zokyo-none-cwbc-mark_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/wrong-condition · vuln/logic/reward-calculation · vuln/logic/missing-check
Reproduction: Local Foundry reproduction.
rewardGenerationStartTimestays 0. No fork. Trace: output.txt.
Root cause#
rewardGenerationStartTime defaults to 0 and is written by a separate startRewardGeneration call. claimReward never rejects 0, so block.timestamp >= rewardGenerationStartTime is true before rewards are started. A holder whose NFT was acquired at timestamp 1, observed in the block at timestamp 1 + 10 days, mints 10 * BASE_REWARD = 100 ARK.
require(block.timestamp >= rewardGenerationStartTime, "before start");
// @> VULN:
lastReward = daysHeld * BASE_REWARD;
The block timestamp is set once for the whole transaction. run() does not warp.
Attack path#
PoC#
The exploit asserts the start time is still 0, lastDays is 10, and the mint is 100 ARK. Those 100 ARK are transferred to the holder.
The fixed claim reverts with "not started" and mints 0.
cd 56419-user-can-claim-rewards-before-the-start-zokyo-none-cwbc-mark_exp
forge test -vv
Remediation#
Require rewardGenerationStartTime != 0 before the timestamp comparison, and set the start once.
References#
- AuditVault finding 56419
- Report: https://github.com/solodit/solodit_content/blob/main/reports/Zokyo/2022-02-27-CWBC.md
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 56419-user-can-claim-rewards-before-the-start-zokyo-none-cwbc-mark_exp (evm-hack-registry mirror).
- AuditVault finding: 56419-user-can-claim-rewards-before-the-start-zokyo-none-cwbc-mark.
Alerts & third-party analyses
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.