I want to have a whitelisted addresses array, but in a gas-efficient way. What I want is to let users that hold an ERC20 token which is on polygon, to mint nfts on ethereum. I know that from ethereum it is impossible to read from another blockchain (as I’m concerned), so, is it more gas expensive to create a state array of addresses or rather create a json file uploaded to ipfs, and then import it in solidity?
So let's start from the beginning.
there isn't any way to import json data inside solidity and parse it, you have also to import files at the time of deployment, this means that you already have the addresses of the people in the whitelist in your hand before the deploy, so if you really want to save, you could hard coding them directly (even if it would be horrible)
even if it were possible to import json files, this would require a lot of memory usage, so it would be extremely expensive if the json started to be "medium" length
having said that leaving you few possibilities I would tell you to use state variables