code-423n4 / 2021-12-amun-findings

0 stars 0 forks source link

PolygonERC20Wrapper can emit burn event instead of calling ERC20 functions #208

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

kenzo

Vulnerability details

Upon withdraw and withdrawTo, PolygonERC20Wrapper calls _mint and _burn, presumably to be able to generate a burn event. But it can just emit a burn event, just like how it emits a deposit event in deposit. This will save the gas of calling and executing the ERC20 functions. Code ref

Recommended Mitigation Steps

Change _mint and _burn to emit Transfer(user/recipient, address(0), amount).