Since contracts are just ethereum addresses with code attached and a contract address can be calculated deterministically before even deploying a contract, is it possible to send ETH to an address which you know will hold a contract at a later time? What happens to the contract and the ETH?
1 Answer
is it possible to send ETH to an address which you know will hold a contract at a later time?
Yes, it is. This is discussed here.
What happens to the contract and the ETH?
The contract will be deployed as normal. If the contract has some kind of "withdraw" functionality that allows you to access the balance then you can withdraw it. Otherwise the balance will sit in the contract forever, unrecoverable, and potentially messing with your contract logic if it assumes that you started with zero balance.