solidity icon indicating copy to clipboard operation
solidity copied to clipboard

block.coinbase should not be payable

Open thegostep opened this issue 4 years ago • 6 comments

thegostep avatar Dec 25 '20 15:12 thegostep

Good catch, the coinbase does not need to be actually payable, since the "coinbase transaction" is not executing any code.

axic avatar Dec 26 '20 16:12 axic

there are use cases where you would want to send eth to the miner

see: https://ethresear.ch/t/flashbots-frontrunning-the-mev-crisis/8251

thegostep avatar Dec 26 '20 18:12 thegostep

@thegostep given your last comment, are you suggesting it should or should not be payable?

leonardoalt avatar Dec 28 '20 10:12 leonardoalt

I think it should default to non-payable for consistency but still work with payable(block.coinbase).transfer()

thegostep avatar Dec 28 '20 20:12 thegostep

I guess this should have been changed in 0.8.0 along with the types of the other addresses. Do we consider it a bug or just a missing feature?

cameel avatar Dec 30 '20 23:12 cameel

It doesn't actually hurt anyone, so I would just schedule for 0.9

chriseth avatar Jan 08 '21 16:01 chriseth

block.coinbase is the address that receives the block reward (ETH emission) and priority fees. Why shouldn't it be payable? As I understand it, payable denotes an address's ability to receive ETH. I would assume that many interactions with the coinbase address involve sending ETH to it, such as for conditional payments related to MEV. So, why make Solidity less convenient for developers in these scenarios?

k06a avatar Sep 01 '25 17:09 k06a

Good catch, the coinbase does not need to be actually payable, since the "coinbase transaction" is not executing any code.

This still holds. Even staking withdrawals follow the same non-executing logic.

axic avatar Sep 01 '25 17:09 axic