balancer / balancer-v3-monorepo

GNU General Public License v3.0
37 stars 10 forks source link

Remove ERC4626 wrap/unwrap verification from critical path #820

Closed joaobrunoah closed 1 month ago

joaobrunoah commented 1 month ago

Description

Verifying if an ERC4626 wrapper returned the correct amount of tokens is an expensive task in terms of gas and bytecode, and is only effective in the scenario in which the buffer has liquidity, but not enough to do the wrap/unwrap operation (situation in which we need to compare the convert and actual operations). This PR removes this verification, which removes 700 bytes from the Vault code.

A fuzz test of ERC4626 wrappers will compensate for the lack of this verification.

Type of change

Checklist:

joaobrunoah commented 1 month ago

@EndymionJkb https://www.notion.so/Decision-Log-7257a5ae01e44e4cb8c48f65937f2a37?pvs=4#568014ea070d4eaf9c8b444263303229