3

I've been trying to make an upgradeable smart contract using openzeppelin in Harmony blockchain which uses EVM and Solidity... It is deployable when not using openzeppelin, but when i do, it throws the above error... And one of my teammates was able to deploy it with no errors...

I don't know if it is the problem with my system, or with Harmony's TruffleProvider... they seem to be trying to fix this and building on this branch https://github.com/harmony-one/sdk/tree/truffle_provider , my teammate was able to finally deploy it, but i'm still getting the same error:

$ oz deploy

Nothing to compile, all contracts are up to date.

? Pick a contract to instantiate: Ball

? Pick a network: stable

✓ Added contract: Ball

Returned error: The method web3_clientVersion does not exist/is not available

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

-1

Replace

var web3 = new Web3(window.web3.currentProvider);

with

var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));

Adjust the url to the ethereum node address (ganache-cli in my case).

In my case the error was being thrown when calling web3.version.getNode(). Found out this method has been replaced by web3.eth.getNodeInfo() on web3 v1.0. Tried updating the code to web3.eth.getNodeInfo() but is would throw the error "web3Obj.eth.getNodeInfo is not a function". Most likely there was a version conflict between ganashe-cli and metamask web3 providers. Making that change fixed the problem.

Joao Leme
  • 9,598
  • 3
  • 33
  • 47