0

When sending funds to an Ethereum address, Should my wallet check in the blockchain whether the address is associated with a smart contract? In order to choose the gas limit automatically.

If someone just created the contract, is there a race condition between my payment transaction to his creation transaction?

Seems like an opening for exploits, don't you think?

Thanks

0

There are no race conditions per se in Ethereum blockchain. All transactions are executed in some order and there is no parallelism in that fashion.

I'm not quite sure what your fear is. You want to send Ether to an address but you don't know whether it's a contract address or an EOA (Externally Owned Address, so a wallet)? Such functionality is most likely not available in typical wallet clients. I'm not sure if even nodes have such functionality. But of course you can find it out using different online services or in a Solidity contract (https://stackoverflow.com/a/40939341/2318492).

You should of course always know already in advance why you send Ethers to a specific address. And typically you also know already whether it's a contract or an EOA. If it's a contract and you're worried about gas limits, you should contact the contract's owners to make sure. Automatic gas estimations are always just estimations and they might fail completely.

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.