6

I want my contract to check a given range of blocks and see whether there are any transactions between a given pair of addresses. Is this possible to do in Solidity? Otherwise how would I do it?

2

2 Answers 2

6

No, its not possible the EVM is pretty isolated. Alternative way is to watch the blockchain with a web3.js script and notify your contract. Of course this is a potential security hole. The opcodes of the EVM do only have limited access to the current block.

3

If those two addresses are contracts, they could be coded to inform a "watching" contract of any interactions. Unfortunately, they would have to be specifically programmed to do this.

1
  • 1
    Thank you for the answer. But in my case, the two addresses are not contracts.
    – l p
    Commented Jun 15, 2016 at 14:51

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.