It is possible to read json value from ipfs file in solidity contract?
1 Answer
This is entirely impossible. Solutions that would come the closest are: relying on oracles to feed in off-chain data, or, having the json data be created on-chain.
-
I want to have information about game items, e.g. in json to use in contract. How to do this? Arrays? This is big amount of items (10k) Feb 18, 2022 at 15:34
-
1Projects have implemented optimised gamified contracts by storing a uint256 as a tokens dna. Best example is to look at cryptozombies.io If you are looking to use this information in a contract, it must be on-chain. You can then either have the metadata json be created on-chain in the tokenURI function, or retroactively create the metadata (uploaded to ipfs) to match the on-chain information or set up a web-server that will dynamically server metadata jsons by reading on-chain data.– phazeFeb 18, 2022 at 15:49
-