question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

block.coinbase does only return 0x

See original GitHub issue

Expected Behavior

I expected to get accounts[0] as block.coinbase.

Current Behavior

I got 0x0000000000000000000000000000000000000000 as block.coinbase.

curl -X POST --data '{"jsonrpc":"2.0", "method":"eth_coinbase", "params":[],"id":9999}' 127.0.0.1:8545 Gives me accounts[0].

Possible Solution

Steps to Reproduce (for bugs)

  1. run ganache-cli
  2. deploy contract
pragma solidity ^0.4.24;


contract TestCoinbase {

    function getCoinbase() public returns (address){
        return block.coinbase;
    }
}
  1. call getCoinbase

Context

Try to run tests for code that uses block.coinbase.

Your Environment

Ganache CLI v6.1.8 (ganache-core: 2.2.1) OSX 10.13.6

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
Goldenflamercommented, Jan 29, 2020

This is still an issue in 2020

2reactions
nicholasjpaternocommented, Jan 29, 2020

@Goldenflamer Thanks for the bump on this issue. Unfortunately this is a little lower priority than some of our other issues. That said, I plan on fixing this ASAP but if this is a blocker for you we highly encourage PR’s!

Read more comments on GitHub >

github_iconTop Results From Across the Web

block.coinbase does only return 0x · Issue #201 - GitHub
The reason the block coinbase can't be accounts[0] by default is that each block would change the accounts balance, and would then break...
Read more >
What does block.coinbase return when contract is being ...
When a miner includes the transaction in a block he's mining (and succeeds in solving the PoW puzzle) he broadcasts the block and...
Read more >
Earn rewards with staking and inflation on Coinbase
Are rewards guaranteed? Coinbase does not guarantee that you'll receive staking rewards, any specific reward, or any staking return over time.
Read more >
Advanced API Reference - Coinbase Cloud
The Advanced API provides access to token balances for accounts, transactions and transfers for accounts, smart contract event logs, and more. API constraints:....
Read more >
0x (ZRX) Price, Charts, and News | Coinbase: zrx, zrx crypto, 0x
Trading under ZRX, 0x is an open protocol that allows a frictionless exchange of Ethereum-based assets. As numerous DApps are built on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found