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?
Asked
Active
Viewed 190 times
4
-
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
1 Answers
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.
Nick Johnson
- 8,144
- 1
- 28
- 35