I am new to solidity and trying to develop a small smart contract. I want to send ether from the sender account to a given account. But I always get this error "VM error: revert. revert The transaction has been reverted to the initial state. Reason provided by the contract: "Insufficient balance". Debug the transaction to get more information."

pragma solidity >= <0.9.0;

contract SimpleTranaction {
    address  payable public receiver =  0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;

    function sendTo(uint amount)   public  payable  {
        require(msg.sender.balance < amount, "Insufficient balance");

I use Remix IDE. The sender account has an enough balance enter image description here

What could be the reason for this? Am I doing something theoretically wrong? If so what is the best approach to do this?

1 Answer 1


First you really should not use such a big range of pragma. ">=0.8.0" should be fine for the moment.

require(msg.sender.balance < amount, "Insufficient balance");

Checks if the balance of the sending Externally Owned Account (EOA) is smaller than "amount".

If you change the condition to ">=" in runs through.

pragma solidity >=0.8.0;
contract SimpleTransaction {
address payable receiver = payable(0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2);

function sendTo(uint256 amount)   external  payable  {
    require(msg.sender.balance >= amount, "Error because balance");


  • toothleth_byte thanks for your response. I changed the code as you proposed. But I get the same error. What I dont understand is when I call receiver.transfer(amount) is it transfer from EOA to the receiver or from the contract address to the receiver? . When I enter the same amount into the Value field of Remix, the transaction was successfully completed.
    – Rama
    Commented Feb 3, 2021 at 19:33
  • address.transfer tries to send ether from the Smart Contract Owned Account to the receiver address. That said, you use a very big range of pragmas, I will change my answer a little bit with a working example. Commented Feb 3, 2021 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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