1

I am trying to reproduce the results on Remix with the smart-contract as written here: https://etherscan.io/address/0xb6ed7644c69416d67b522e20bc294a9a9b405b31#code

(for remix, go to http://remix.ethereum.org/)

The code compiles fine (with solidity ^0.4.18), however, when I try to deploy the _0xBitcoinToken contract, I get the "transaction execution failed" error. I am placing enough gas for a transaction, so that does not seem to be an issue. What am I doing wrong, and why does the error appear ?

  • Check the constructor for errors, like if a require is failing, it is making a call to an invalid address, or it is accessing an array/string without checking its length. – Ismael Jul 17 at 15:08
1

In Remix, there's a problem with blockhash() when using Javascript VM (https://github.com/ethereum/remix-ide/issues/1794).

If you try to deploy this contract in Ropsten, it will not fail.

So, the problem lies in line 375, which runs when the constructor is called.

challengeNumber = block.blockhash(block.number-1);

  • Thank you, I will experiment with Ropsten today, and accept if correct. – Damir Olejar Jul 17 at 16:35
  • 1
    You're welcome! – Daniel Portugal Jul 17 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.