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?
-
Related: ethereum.stackexchange.com/questions/5894 – galahad Jun 20 '16 at 19:32
-
1More info: ethereum.stackexchange.com/questions/2531 – galahad Jun 20 '16 at 19:33
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.
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.
-
1Thank you for the answer. But in my case, the two addresses are not contracts. – l p Jun 15 '16 at 14:51