Open code423n4 opened 3 years ago
WatchPug
https://github.com/code-423n4/2021-10-ambire/blob/bc01af4df3f70d1629c4e22a72c19e6a814db70d/contracts/wallet/Zapper.sol#L137-L140
function wrapETH() payable external { // TODO: it may be slightly cheaper to call deposit() directly payable(WETH).transfer(msg.value); }
Change to:
interface IWETH { function deposit() external payable; } function wrapETH() payable external { IWETH(WETH).deposit{ value: msg.value }(); }
resolved in https://github.com/AmbireTech/adex-protocol-eth/commit/263192503524f9177fe0d52eb68b81feb0fc5e97
Since the fallback takes extra logic, using .deposit saves gas. The sponsor has applied the improvement
.deposit
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-10-ambire/blob/bc01af4df3f70d1629c4e22a72c19e6a814db70d/contracts/wallet/Zapper.sol#L137-L140
Recommendation
Change to: