0

I understand that smart contracts can emit events, but I'm curious if there's a way for a smart contract to listen to on-chain events and react to them. Is it possible for a smart contract to monitor events emitted by other contracts or take action when certain events occur on-chain?

1 Answer 1

0

Short answer No. Smart contracts can't listen to events, it is more like a way for contracts to communicate with the "outside world".

You can create a program that listens to events (offchain) and then pushes the data into a contract (onchain). The contract's storage can then be read onchain by your contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.