DeFiVulnLabs icon indicating copy to clipboard operation
DeFiVulnLabs copied to clipboard

Inappropriate case in return-break.sol

Open DeepJoyPo opened this issue 9 months ago • 1 comments

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.

DeepJoyPo avatar Mar 27 '25 03:03 DeepJoyPo

Thanks a lot, I have fixed this bug. https://github.com/SunWeb3Sec/DeFiVulnLabs/blob/main/src/test/return-break.sol

SunWeb3Sec avatar Apr 24 '25 04:04 SunWeb3Sec