Skip to content

Commit e3b1f78

Browse files
committed
add note about deprecated transfer function
1 parent 6633838 commit e3b1f78

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docs/base-account/more/troubleshooting/usage-details/unsupported-calls.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ Future versions of Base Account may support it.
2727
You can use a factory contract or a transaction with the `CREATE2` opcode to deploy a smart contract.
2828
</Tip>
2929

30+
## Solidity's Builtin `transfer` function
31+
32+
The `transfer` function is a builtin member of the `address` type in Solidity that can be used to send ETH to an address. Base Account wallets cannot receive ETH using this function.
33+
This function has long been considered deprecated in favor of `call` by the Solidity community, but some older contracts still use it.
34+
35+
The reason for this is that `transfer` only forwards 2300 gas to the `transfer` call, a protective mechanism that was designed to prevent reentrancy attacks by limiting the amount of
36+
gas available to a smart contract that might reenter the caller.
37+
In the modern world of smart contract wallets (including for Base Account), this is often not enough gas for the smart contract's `receive` or `fallback` functions to complete their work,
38+
causing the transaction to revert.
39+
40+
### Known affected contracts
41+
42+
- The [WETH9 contract](https://basescan.org/token/0x4200000000000000000000000000000000000006) uses `transfer` to send ETH to the user's wallet and therefore Base Accounts cannot directly unwrap ETH from it.
43+
3044
import PolicyBanner from "/snippets/PolicyBanner.mdx";
3145

3246
<PolicyBanner />

0 commit comments

Comments
 (0)