Skip to content

sir-josh/Hackable-smart-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hackable smart contract

This is a one time hackable smart contract that models after a vending machine(that gives out only peanut).

Just like the traditional vending machine, users will first deposit before buying peanuts from the contract, the least amount you can deposit before using the vending machine is 0.1 ether, this is because each peanut price is pegged at 0.1 ether. Users can also deposit more than the minimum amount requirement, purchase peanuts and withdraw any of their balance left from the contract.

Nonetheless there is a bug in the contract. The contract has a reserve balance of 1 ether, any hacker can penetrate this contract.

Figure out the bug in the contract and use it to your advantage.

VendingMachine: deployed to: https://goerli.etherscan.io/address/0x00f4b86F1aa30a7434774f6Bc3CEe6435aE78174

Feel free to attack.