3

The EVM evaluates smart contracts by reading code in the DATA field of an Ethereum transaction. This is why you shouldn't trust someone who asks you to include an unknown series of characters in a transaction.

However, you can also use that DATA field to send basic text messages.

If I want to send a transaction with a basic text message, how can I ensure that I'm not accidentally sending a potentially risky smart contract?

3
  • 1
    As you might be doing things off-chain per ethereum.stackexchange.com/questions/29717/… some ideas from rollups might help you, for example research.paradigm.xyz/optimism I think you will still get better answers if you explain more because it looks like you are jumping to a solution and could be missing other designs.
    – eth
    May 14, 2021 at 10:33
  • Exactly. Unfortunately it's a technically dense field and it's taking a while to penetrate.
    – tjr226
    May 21, 2021 at 17:58
  • Take your time. You're right asking good questions takes good effort :)
    – eth
    May 23, 2021 at 10:39

1 Answer 1

2

Just check the recipient of your transaction is an EOA (and not a smart contract) : an account controlled by a private key that does not "contain" a code (aka a wallet).

To verify an address is an EOA, you can use Etherscan or a high-level library such as web3js for example (see this : How to detect if an address is a contract?).

Also note that if you send a transaction to a smart contract with random data attached to it, the likelihood that your data matches a valid payload triggering a contract function is very very unlikely.

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.