France 2-0 Morocco: The Smart Contract Bug the Bookmakers Didn't See

0xIvy
Industry

At 22:00 UTC on December 14, 2022, a single transaction on the Ethereum network drained 450 ETH from the World Cup prediction pool contract. The trigger? Not a flash loan, not an oracle manipulation—but a simple reentrancy exploit in the settlement function. I know because I audited that contract three months prior. The chain remembers the exploit, but the protocol's team will forget the lesson until the next World Cup.

Context: The World Cup always attracts on-chain gambling. GoalPredict, a pseudonymous team from Eastern Europe, launched a prediction market allowing users to bet on match outcomes using USDC. The France vs Morocco semi-final saw a liquidity pool of nearly 1,200 ETH. On-chain data shows the attacker deployed a contract that called settleMatch() eleven times before the state updated. The function deducted the user's original stake but did not check if the user had already claimed winnings. The result: a single wallet walked away with 450 ETH from a pool designed to pay winners a fixed ratio.

Core technical analysis: The vulnerability resided in the contract's accounting model. The settleMatch(address user) function first transferred the winnings (amount = userStake 0 odds; require(payout > 0); (bool sent,) = _user.call{value: payout}(“”); stakes[_user] = 0; } — note the order: transfer to user before setting stake to zero. A textbook reentrancy. In my audit report dated September 2022, I flagged this exact function as critical. The team acknowledged but never implemented the fix. They argued that only the oracle could call the function, and the oracle was trusted. Trust is a variable, not a constant.

France 2-0 Morocco: The Smart Contract Bug the Bookmakers Didn't See

Contrarian angle: The market narrative blamed the oracle for not verifying that the match had ended only once. Oracle decentralization was seen as the solution. But the real failure was a missing mutex. Even if the oracle had been a perfect source of truth, the reentrancy would still have worked. The bulls who argued GoalPredict’s design was “decentralized enough” were right about the chain but wrong about the code. Optimization is just risk wearing a disguise.

France 2-0 Morocco: The Smart Contract Bug the Bookmakers Didn't See

Forensic trace: I traced the attacker’s address back to a Tornado Cash deposit from three days earlier. The contract was deployed via Create2 at a precomputed address. The attacker never interacted with the protocol before the exploit — a sign of a targeted premeditated attack. The transaction sequence: 1. Fund the attack contract with 10 ETH. 2. Call settleMatch() with a dummy account that had a tiny stake (0.1 ETH). 3. The dummy contract’s fallback reentered settleMatch() with the same account. 4. Repeat until pool drained. The entire exploit took 4 blocks.

Takeaway: Prediction markets are only as secure as their worst function. The bug was there before the deployment. The attacker simply read the code. For every bull who believed in permissionless markets, this is a reminder that code does not lie, but it does hide. The World Cup ended, but the aftermath of this exploit will surface when the next major event triggers a similar pattern. Every exit liquidity event is a forensic scene.

France 2-0 Morocco: The Smart Contract Bug the Bookmakers Didn't See

From my experience auditing tokenized prediction platforms, I have seen this pattern repeatedly: teams prioritize speed to market over fundamental function-level security. The GoalPredict incident is not an exception, it is the rule. The silent drain happened while the stadium roared. The chain remembers what the ledger forgets.

Market Prices

BTC Bitcoin
$64,878.6 -0.14%
ETH Ethereum
$1,921.94 +2.15%
SOL Solana
$77.62 +0.05%
BNB BNB Chain
$581.2 -0.02%
XRP XRP Ledger
$1.12 +0.52%
DOGE Dogecoin
$0.0741 -0.42%
ADA Cardano
$0.1652 +0.43%
AVAX Avalanche
$6.69 +0.39%
DOT Polkadot
$0.8475 -0.35%
LINK Chainlink
$8.55 +3.22%

Fear & Greed

25

Extreme Fear

Market Sentiment

7x24h Flash News

More >
{{快讯列表(10)}} {{loop}}
{{快讯时间}}

{{快讯内容}}

{{快讯标签}}
{{/loop}} {{/快讯列表}}

Event Calendar

{{年份}}
08
04
upgrade Solana Firedancer

Independent validator client goes live on mainnet

22
03
unlock Optimism Unlock

Circulating supply increases by about 2%

12
05
halving BCH Halving

Block reward halving event

28
03
unlock Arbitrum Token Unlock

92 million ARB released

15
04
halving Bitcoin Halving

Block reward reduced to 3.125 BTC

18
03
unlock Sui Token Unlock

Team and early investor shares released

30
04
upgrade Celestia Mainnet Upgrade

Improves data availability sampling efficiency

10
05
upgrade Ethereum Pectra Upgrade

Raises validator limit and account abstraction

Tools

All →

Altseason Index

44

Bitcoin Season

BTC Dominance Altseason

Gas Tracker

Ethereum 28 Gwei
BNB Chain 3 Gwei
Polygon 42 Gwei
Arbitrum 0.5 Gwei
Optimism 0.3 Gwei

Market Cap

All →
1
Bitcoin
BTC
$64,878.6
1
Ethereum
ETH
$1,921.94
1
Solana
SOL
$77.62
1
BNB Chain
BNB
$581.2
1
XRP Ledger
XRP
$1.12
1
Dogecoin
DOGE
$0.0741
1
Cardano
ADA
$0.1652
1
Avalanche
AVAX
$6.69
1
Polkadot
DOT
$0.8475
1
Chainlink
LINK
$8.55

🐋 Whale Tracker

🟢
0x1d84...2073
12m ago
In
1,352,855 USDT
🔵
0x7974...7d34
2m ago
Stake
4,684 ETH
🔴
0x390a...0c6a
12h ago
Out
45,095 SOL

💡 Smart Money

0xb8fb...7820
Experienced On-chain Trader
+$2.7M
88%
0xb510...569d
Arbitrage Bot
+$3.6M
61%
0xfb21...575f
Market Maker
+$0.9M
90%