The LibWeth
library hardcodes the WETH
address, which makes all the wrapping/unwrapping functionality it entails to be unavailable/incompatible with the L2 chain where Beanstalk will be deployed.
Take a look at https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/8c8710df547f7d7c5dd82c5381eb6b34532e4484/protocol/contracts/libraries/Token/LibWeth.sol#L15-L37
This is the whole library that handles the wrapping and unwrapping Weth
, issue however is that the WETH
address has been hardcoded as 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
.
And with the Beanstalk the finale contest, The Beanstalk team hinted that the contracts are to be deployed on an L2, the votes for this has already been passed, and this snapshot shows how this would be done.
Problem however is that the 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
is only sure as the WETH
address on the EThereum mainnet if the contracts get deployed on an L2 that does not have the 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
address as WETH, then all the functionalities of this contract are effectively DOS'd and unaccessible.
Complete DOS to thee functionality of wrapping and unwrapping WETH
on the to-deploy L2 chain, would be key to note that in this case not only is the LibWeth
affected, but all functionalities that query this, i.e the TokenFacers
Manual review
Consider not hardcoding 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
as the WETH address, considering the protocol is to be deployed on multiple chains and then have the correct address be passed during deployment.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.