High-accuracy Solidity reconstruction from closed-source EVM bytecode.
Our service recovers readable, complete smart contracts from unverified contracts, delivering near-original source reconstructions suitable for deep security analysis.
DM for inquiries or sample evaluations.
Decompiled unverified contract (0xe74d17c1bE3721E65e0af286D47B3BA58B08062e): gist.github.com/256cisco/69c…
On July 30, an attacker drained 16.623 WETH (~$30.6K) on Base by exploiting a closed-source contract.
Both the vulnerable contract and the attacker's helper were unverified, so I reconstructed both contracts directly from their EVM bytecode.
The root cause was an unrestricted external call inside the contract's “universal swap” function:
aggregator.call(data)
The caller controlled both aggregator and data, with no allowlist or validation of the target call.
The attacker's helper supplied:
• aggregator = WETH
• amountIn = 0
• tokenIn = tokenOut = WETH
• data = WETH.transferFrom(victim, executor, 16.623 WETH)
Because the victim had an existing WETH allowance to the vulnerable executor, the call pulled the WETH into the contract.
The executor then interpreted its new WETH balance as swap output and transferred the entire balance to the attacker's helper, which immediately forwarded it to the beneficiary.
The helper was deployed and the drain executed atomically in the same transaction.
Full decompiled contracts and exploit transaction in the first reply.
Victim contract reconstruction:
gist.github.com/256cisco/5d0…
Exploit helper reconstruction:
gist.github.com/256cisco/996…
Exploit transaction:
basescan.org/tx/0xe831f39911…
In practice, high-fidelity reconstruction of contracts therefore usually involves more than running a tool once. It often requires careful manual analysis, cross-checking against the original bytecode, and multiple rounds of refinement. Work that can take hours rather than seconds. The difference between a rough automated output and a reconstruction you can actually trust for deep security analysis is largely the amount of refinement applied to the hard cases.
256cisco retweeted
Our thanks go first to the whitehat, who engaged with the team and returned the funds under the agreed terms.
Thanks to @officer_secret, @NoxosIntel, @b_block_oficial, @osint_based and @256cisco for their analytical work on the case and for covering the incident.
And thanks to everyone else who contributed to resolving it: address labelling and attribution, exchange communication and smart contract analysis. Your work made the outcome possible.
Tracing, attribution and case coordination were handled by the AML Crypto investigations team, working around the clock from the first hours after the compromise.
@amlcrypto
Original Solidity vs my decompiler vs Dedaub, all from the same bytecode.
Even widely used decompilers can produce incorrect output on simple contracts. That matters, when the reconstruction is wrong, researchers may end up analysing behaviour that does not actually exist.
My decompilation recovers the correct contract behaviour instead of producing misleading code.