Challenge Description#
Tighten your seatbelts and get ready to embark on an exhilarating journey through the world of blockchain technology! This intro challenge will help you get started.
Solution#
This challenge is an intro to blockchain. In particular, the challenge contract has a withdraw function, which simply
allows us to withdraw all money. Therefore, we only need to perform the correct API calls to call this contract.
For this purpose, we use the web3.py framework and the python bindings for solc-x.
In particular, the process is the following:
- Start challenge and get all relevant parameters
- Create a
Web3instance to communicate with the blockchain - Compile the contracts with the
solcxmodule to get ABI and bytecode so that we can call the contract - Create respective
w3.eth.contractobjects to communicate with the contracts. - Call
chal_instance.functions.withdraw(balance).transact()to steal money