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...
References
https://github.com/ethereumbook/ether...
https://solidity-05.ethernaut.openzep...
Remix IDE: http://remix.ethereum.org
Solidity: https://solidity.readthedocs.io
Follow on Twitter: @ProgrammerSmart / programmersmart
Join me on Discord: / discord
Website: https://smartcontractprogrammer.com