I am building a crowd-funding dApp using ethersjs to connect my smart contract to my front end, and I am looking to display public variables like total campaigns on my index page for style purposes.
Right now, I am calling a public variable totalCampaigns
to get the returned number of total campaigns. The issue is, is I have to connect my wallet to view the number. If I don't, then no number is displayed.
In ethersjs, is there a way I can view public variables with getter functions, like my totalCampaigns
variable without needing someone to connect their wallet? Or is it supposed to be connected by design and I should just scrap the idea all together?