Reproduced Exploit
CWBC — Arkouda rewards use days held and ignore stakeCBWC
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: 56420-staking-is-not-used-to-calculate-arkouda-tokens-to-be-reward. Standalone Foundry PoC and full write-up: 56420-staking-is-not-used-to-calculate-arkouda-tokens-to-be-reward_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/reward-calculation · vuln/logic/missing-check · vuln/logic/wrong-condition
Reproduction: Local Foundry reproduction. An unstaked NFT is paid the same 100 ARK as a staked one. No fork. Trace: output.txt.
Root cause#
stakeCBWC sets staked[id]. claimReward reads that flag into ignoredStakeFlag and then does not use it. The mint is daysHeld * BASE_REWARD for any owner. Rewards have already started (rewardGenerationStartTime = 1), so this is not the pre-start claim.
An NFT acquired at timestamp 1, claimed in the block at 1 + 10 days, mints 100 ARK whether or not it was staked. The unstaked mint is 100 ARK that a staking-gated claim would not pay.
ignoredStakeFlag = staked[tokenId] ? 1 : 0;
// @> VULN:
lastReward = daysHeld * BASE_REWARD;
run() does not warp. The block timestamp is fixed for the transaction.
Attack path#
PoC#
Unstaked mint and staked mint are both 100 ARK. stakeCalls is 1, and it happens after token 1 was paid. The unstaked 100 ARK is transferred to the holder.
The fixed claim reverts with "not staked" for an unstaked id and still pays a staked id.
cd 56420-staking-is-not-used-to-calculate-arkouda-tokens-to-be-reward_exp
forge test -vv
Remediation#
Require staked[tokenId] before computing the reward, and size the reward from the stake rather than from days held alone.
References#
- AuditVault finding 56420
- 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: 56420-staking-is-not-used-to-calculate-arkouda-tokens-to-be-reward_exp (evm-hack-registry mirror).
- AuditVault finding: 56420-staking-is-not-used-to-calculate-arkouda-tokens-to-be-reward.
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.