Duplicated code in unbond
and unbondAndBreak
functions
#178
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
nathaniel
Vulnerability details
Impact
A large portion of the
unbond
andunbondAndBreak
code of Bonding.sol is the same, to reduce code bloat and gas when calling the contractProof of Concept
https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/Bonding.sol#L97-L109
Tools Used
Manual
Recommended Mitigation Steps
I would suggest wrapping the duplicated code into an internal function called by
unbond
andunbondAndBreak
.The text was updated successfully, but these errors were encountered: