WETH was never set in baseLeverageExecutor.sol
The WETH state variable in BaseLeverageExecutor.sol was never initialised, so it remained the zero address. This would prevent the contract from wrapping and unwrapping ETH.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-02-tapioca-judging/issues/12
Found by
AuditorPraise
Summary
WETH State Var was never set in baseLeverageExecutor.sol
Vulnerability Details
see summary
Impact
WETH will be address zero, it won't be possible to wrap and unwrap ETH
Code Snippet
Tool used
Manual Review
Recommendation
initialize the WETH state Var via the constructor.
Discussion
sherlock-admin2
1 comment(s) were left on this issue during the judging contest.
WangAudit commented:
looks like it's intended
nevillehuang
@0xRektora @maarcweiss
Just to double confirm, afaik weth seems to be never be set anywhere in the contracts so this issue is true correct?
cryptotechmaker
Fixed here https://github.com/Tapioca-DAO/Tapioca-bar/pull/346
sherlock-admin4
The protocol team fixed this issue in PR/commit https://github.com/Tapioca-DAO/Tapioca-bar/pull/346.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
WETH will be the zero address, making it impossible to wrap and unwrap ETH.
What the attacker needed
None
The fix
The issue was fixed by initialising the WETH state variable via the constructor.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract has a variable meant to hold the address of WETH, a special version of Ether used in contracts. The developers forgot to set this address, so it stayed as the default zero address. As a result, any function that tries to use WETH would fail because it points to nothing.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.