DeFiVulnLabs
DeFiVulnLabs copied to clipboard
Inappropriate case in return-break.sol
The code in return-break.sol may not present significant issues if it’s simply intended to demonstrate the difference between return and break. However, from a business logic perspective, the example is flawed. Even in the fixed version (FixedBak), the addBanks function does not behave as its signature suggests. It fails to add all valid banks provided by the user into the banks array and instead only adds the first bank repeatedly. This can lead to unnecessary confusion, and I believe further modifications are required.
Thanks a lot, I have fixed this bug. https://github.com/SunWeb3Sec/DeFiVulnLabs/blob/main/src/test/return-break.sol