This is a simple demonstration of reentrancy attack in solidity

Reentrancy attacks are one of the most dangerous threats to be aware of when implementing smart contracts with Solidity. They’re dangerous for two reasons: they can exhaust your smart contract’s ether and, if you’re not careful, they can find their way into your code.

Demonstrating the attack using Banking contract and Attacker contract.

Banking contract code

--

--