Smart contract has quite limited abilities to observe blockchain content. Basically, Solidity allows reading the following information:
- Hashes of 256 most recent blocks
- Current block's miner address
- Current block difficulty
- Current block gas limit
- Current block number
- Current block timestamp
- Current transaction gas price
- Current transaction origin (i.e. from address)
- Current contract's storage slots allocated for state variables
- Current balance of arbitrary address
EVM allows reading a bit more (available in Solidity via inline assembly):
- Arbitrary slots of current contract's storage
- Byte code of arbitrary contract
- Hash of byte code of arbitrary contract
And that's basically it.