1

I want to understand the difference of sending some ETH to a wallet of someone or to a smart contract. It seems costs are not the same. Is this correct?

If so, why does it probably cost more to send ETH to a smart contract than to another wallet?

Maybe someone has an idea or solution to reduce this gas fee for a smart contract receiver.

1 Answer 1

2

If the transaction's recipient is a contract the Ethereum's rules state its bytecode will be executed, so at least one opcode will be executed.

A contract compiled with solidity will make several checks to determine if it is a function call and dispatch it properly.

In order to accept ether payments a contract has to implement the receive function (or the more general fallback function).

For solc v0.8.3 the minimum contract compiled without optimizations uses 33 gas to receive ether.

contract Test {

    receive() external payable {
        /* Nothing to do here */
    }
}

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.