hyperledger-labs / learning-tokens

Uses the composable Interwork Alliance Token Taxonomy Framework (IWA TTF) to produce a Learning Token
Apache License 2.0
15 stars 15 forks source link

Reentrancy in solidity smart contract #33

Open MukulKolpe opened 6 months ago

MukulKolpe commented 6 months ago

Hello, I was reviewing the smart contract and noticed a common pattern where state variables are updated after external calls. This often creates a vulnerability for reentrancy attacks. To confirm this, I used Slither, a static analysis tool, to check for any potential reentrancy issues. The analysis revealed several instances where reentrancy attacks are possible. Here is a list of some of the functions where this vulnerability exists:

To address these vulnerabilities, the following are some of the mitigation approaches:

OpenZeppelin's ReentrancyGuard is gas-efficient and can be implemented without interfering with the existing business logic of the contract, making it a suitable solution for this case.

Please let me know if you would like me to proceed with a pull request to address this issue.