1

Is there a difference between sending ether to a user account or to a smart contract. E.g.:

contract ThisIsAContract{
    function()
        public
        payable
    {}
}

Now I call (pseudocode)

address(0x0).transfer(payout);

and also

address(ThisIsAContract.address).transfer(payout);

Are both okay and do they act the same?

1

The only difference is that transactions to non-contracts always cost 21k (unless you have tx data included), whereas transactions to contracts will execute the byte code at that address, which may cost more than 21k. So when you transfer to a contract, you should always do a gas estimate and set the gas amount manually.

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.