Yes, it is possible, but you may not know how to read the data since it may not be in the order declared in the contract and it will be encoded, so you would need to know the indices of the state variable in the contract and some other details like if that value was added to a mapping, array, struct, etc., to be able to write code to figure out what data belongs to which variable and try to decode it.
There's a good example of how to get all the data directly here: is there an easy way to get the full state of a contract?
You may be better off using something like web3.eth.getStorageAt(contractAddress, indexOfTheVariable)
. Write functionality that knows how to get each data of the smart contract.
Here is an article that explains step by step how the variables are laid out in storage and how to get state storage variable values directly using web3.eth.getStorageAt
and decode them. Maybe this article would help you create a tool to decode any storage trie data given the abi of a contract or something like that.