Did you know that the WETH contract can be slightly different on different chains? It can play a costly trick on your code during token transfers. Let's see what can go wrong.
There was a Med severity issue on the Abracadabra Money protocol. There’s a method to create a pool for native tokens by wrapping them to their “wrapped” counterpart before sending them to the newly created pool.
See the code below, line 92
The transfer done using address(weth).safeTransferFrom.
This works fine on most chains (Ethereum, Optimism, Polygon, BSC) which uses the standard WETH9 contract that handles the case when src == msg.sender:
The problem is that the WETH implementation on Blast uses a different contract, and does not have this src == msg.sender handling.
Also, the issue is presented in Wrapped Arbitrum and Wrapped Fantom.
Blast contract:
Be careful when using the same WETH functions for different chains. You should check the contract sourse code before each time you want to use that contract.
#weth
#blast
#chain
Completely free courses
Learn more about the blockchain world
Free education videos
by RareSkills
by Jeiwan
by RareSkills
by RareSkills
by Andreas M. Antonopoulos, Gavin Wood
by Micah Dameron
Compare execution layer differences between chains
Dive deep into the storage of any contract