4

I plan on creating some tokens and want to create code that will execute if the one of the tokens is used within a smart contract. Is this possible?

  • Can you explain more about "if one of the tokens is used"? Used how? That will help me best answer your question. – Raine Revere May 19 '16 at 19:52
2

You can compare msg.sender and tx.origin; if the two are different, your code is being called by another contract. That other contract could be someone's wallet, however - or just about anything else - and it's probably a bad idea to make decisions on that basis.

| improve this answer | |

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.