Ethernaut: Fallout
Overview
I recently launched a blog post series where I will be posting about my journey in Web3/Blockchain security.
During this series, I will be posting about Web3/Blockchain bugs and exploits, alongside writeups for Ethernaut and Damn Vulnerable DeFi challenges.
You can check the second ‘Fallback’ Ethernaut challenge here.
Today, I am following up on the Ethernaut challenges series presented to us by OpenZeppelin !
Hope you enjoy it and learn something new!
‘Fallout’ Challenge

Overview
Fallout is the third challenge in the Ethernaut series.
Link to the original challenge.
Github repo link that contains challenge code and solver.
Challenge Description
1 | Claim ownership of the contract below to complete this level. |
1 | // SPDX-License-Identifier: MIT |
Understanding the contract
Instead of solving the challenge on the browser using developer tools, I just want to do it locally this time by compiling the smart contract and interacting with it directly through unit tests. Which is the same as interacting with it on-chain.
First, we notice that we are using solidity version 0.6.0 which is compatible with SafeMath.
In older solidity versions, specifically before 0.4.22, a constructor naming convention was to utilize a function having the same name as the contract for constructing the contract. In our case, since we are using 0.6.0, any function having the same name as the contract will be ignored, and only an explicit
constructorwill be utilized.A user can allocate (donate) to the contract using the
allocate()function which increases his share of allocations:
1 | function allocate() public payable { |
- A user can also send his allocations (withdraw) by invoking the
sendAllocation()function:
1 | function sendAllocation(address payable allocator) public { |
- The owner of the contract has the ability to withdraw all funds from the contract:
1 | function collectAllocations() public onlyOwner { |
Point of Failure
- Since we are on solidity 0.6.0, and as we explained above that the constructor name matching the contract name is ignored in solidity versions that came after 0.4.22, we can conclude that the
function Fal1out()is misname, first by usingl1instead oflland second by that its naming convention should not be that way.
Exploitation
We have 1 objective out of this challenge: to become owner
Exploitation Steps
The only function that modifies the owner of the conract is function Fal1out(), and as we explained earlier, it is not viewed nor used as a contructor. So anyone can basically just call it:
1 | function Fal1out() public payable { |
- First, we will create our attacker and give him some ETH:
1 | const [deployer, attacker] = await ethers.getSigners(); |
- Then we can simply call the
Fal1outfunction that will make us owner:
1 | const falloutAsAttacker = fallout.connect(attacker); |
Exploit test case
You can find below the full Proof of Concept:
1 | import { expect } from "chai"; |
And below is the output showcasing our successful exploitation:
1 | $ npx hardhat test |
Conclusion
We can conclude from what we have seen that confusing different implementation between different solidity versions and not being attentive with our naming conventions can be very dangerous in allowing users to manipulate contract invariants.
That was it for Fallout challenge from Ethernaut series.
You can find through this github link the repository that contains my solver and all the future Ethernaut solutions Inshallah!
See you next time~
- Title: Ethernaut: Fallout
- Author: Foued SAIDI
- Created at : 2026-01-28 16:39:35
- Updated at : 2026-01-31 18:51:25
- Link: https://kujen5.github.io/2026/01/28/Ethernaut-Fallout/
- License: This work is licensed under CC BY-NC-SA 4.0.