Im building kind of like ICO app, where user can connect wallet, and send ETH to my smart contract and get some tokens in return.
But also in this application I wanna read some data from blockchain and display it to the user even before the wallet will be connected.
Unfortunately before wallet connection my app is all the time in loading state. After couple of minutes thought came in that I don't have any one to call this functions, I don't have the signer?
Is my thinking on good track? And if so how can I read data from blockchain in that case?
My function to get contract looks like this:
const getEthereumContract = () => {
const provider = new ethers.providers.Web3Provider(ethereum);
const signer = provider.getSigner();
const icoContract = new ethers.Contract(contractIcoAddress, contractIcoABI, signer);
return icoContract;
}