1

I have deployed a contract, testContract, onto bsc testnet

I have a test wallet with sufficient funds and can seemingly make transfers to other wallet addresses without any issues.

I am just trying to load the testContract address with wBNB.

me = accounts.load(abc)
me2 = accounts.load(xyz)
me.transfer(me2.address, 100)

This all works fine with no issues. But if I try:

me.transfer(*contract_address*, 100)

I get:

Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.

If I manually enter gas parameters I am met with 'execution reverted'. I have no idea what is going on :(

1 Answer 1

1

Per the solidity docs

Contracts that receive Ether directly (without a function call, i.e. using send or transfer) but do not define a receive Ether function or a payable fallback function throw an exception,sending back the Ether (this was different before Solidity v0.4.0).

This means, you need to define a receive function in the contract in order for it to be able to accept ETH (or, BNB, in the case of binance smart chain)

Your Answer

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

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