PaisaSave enables users to securely store and manage funds with smart contracts. It is a simple Ethereum smart contract written in Solidity. It lets users deposit ETH, check their balance, and withdraw their own funds. It keeps a mapping of addresses to balance.
The project's public github link :
https://github.com/sourashreemukherjeenit-web/PaisaSave
PaisaSave is a simple and secure Ethereum-based savings system designed to help users store and manage their cryptocurrency directly on the blockchain.
The mission of this project is to provide an easy-to-use, transparent, and decentralized way for users to deposit and withdraw funds without intermediaries.
If the withdraw(...) function sends ETH to the user before updating their balance, a malicious contract could exploit that by re-entering the withdraw function (i.e., calling it again in its fallback) and draining more than its rightful balance.
This is a well-known risk in such deposit-withdraw smart contracts.
The repo does not show any protection (like a reentrancy guard) in the README. (At least from what is publicly visible.)
Use OpenZeppelin’s ReentrancyGuard (or similar) to prevent reentrancy in the withdraw function.
Alternatively, implement a mutex: set a “locked” boolean before the external call and reset it after.
India