Unsafe Delegatecall (part 1) | Hack Solidity (0.6)
Channel: Smart Contract Programmer
Date: 2020-07-15

What can go wrong when you forget that delegatecall preserves context? One exploit that is possible from an unsafe delegatecall is to bypass any access control and directly update state variables. In this video I will show you how to update a state variable although the smart contract does not have any function to update it.

#Solidity #delegatecall #hack

Code: https://solidity-by-example.org/hacks/delegatecall/

References
https://github.com/ethereumbook/ethereumbook/blob/develop/09smart-contracts-security.asciidoc
https://solidity-05.ethernaut.openzeppelin.com/

Remix IDE: http://remix.ethereum.org
Solidity: https://solidity.readthedocs.io

Follow on Twitter: @ProgrammerSmart https://twitter.com/ProgrammerSmart
Join me on Discord: https://discord.gg/Ny8sPaj
Website: https://smartcontractprogrammer.com