The solidity team is wondering how you are using the transfer
member function for the type address payable in your contracts.
The context for this question comes from this issue. We were looking
at redesigning the transfer function. The following is a short
summary.
-
transfershould be able to forward all gas.- Syntax
transfer{gas: max}(_value)to mean.call{gas: gas(), value: _value}("") - To denote the current behaviour, potentially use
min,
stipend, - Introduce globals such as
gas.stipend,gas.left, or
tx.gax.leftetc instead ofmaxormin.
- Syntax
- Deprecate
transferand replace it using library or free functions. - Potentially rename
transferand forward all gas.
Here are some questions that we would like to be answered:
- Do you need to use a mechanism to transfer Ether? Or is this
redundant because of ‘Wrapped Ether’ tokens? - Do you use
transferto only interact with EOA accounts or be
reentrant safe? - Do you avoid using
transferbecause it doesn’t forward all the
gas?