I was working with one of my contracts in remix, running in javascript vm environment.

And i just had to check the balance of my contract. when i tried this in the console


it says

this.provider[(intermediate value)] is not a function

I tried async method with callback.. same response. none of the methods seem to be working.. what is the correct way to do so..

i know i can connect to injected web3/web3 provider and run commands in terminal. but i want to be able to do it in Javascript vm as it is faster while testing..


Remix uses a Sandbox EVM. This EVM does not support RPC, so web3 APIs wont work.

You can hook into raw EVM API (since EVM itself is implemented in JS). But that would be too much work.

  • but in the consol it says the console has web3 1.0 and when i type web3 or web3.eth it logs [object object]. which means they are defined.. also i tried web3.eth.accounts , the output was [object object] Dec 6 '18 at 4:23

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.