1

I'm working on a smart contract that can hold some ETH.

Currently, I'm unable to see what is its balance in the Remix IDE.

I'm trying to use the console:

enter image description here

I have access to web3 but how to check the balance? Or maybe it's somewhere in the UI, that would be even better.

Sample contract that can receive Ether via fallback function:

pragma solidity ^0.4.25;

contract Payable {
    function() external payable { }
}
1

From Remix docs 'web3 is only available if the web provider or injected provider mode is selected', so you can't use web3 with JavaScript VM.

As a workaround you may add a function that returns this.balance in your contract

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.