TransWikia.com

Can't understand the problem with the code

Ethereum Asked on February 10, 2021

I am reading the following tutorial.

Tutorial

What is the problem with the following code:

function withdraw(uint amount) public {
     require(balances[msg.sender] >= amount);
     balances[msg.sender] -=amount;
     payable(msg.sender).transfer(amount);
     transactions++;

}

How is this code causing reentrancy attack?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP